{"id":14971415,"url":"https://github.com/drift-labs/protocol-v2","last_synced_at":"2026-01-08T15:18:07.580Z","repository":{"id":38784859,"uuid":"497045217","full_name":"drift-labs/protocol-v2","owner":"drift-labs","description":"On-chain perpetuals dex with multiple liquidity mechanisms","archived":false,"fork":false,"pushed_at":"2025-05-12T19:06:44.000Z","size":35933,"stargazers_count":272,"open_issues_count":78,"forks_count":141,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-12T20:27:31.034Z","etag":null,"topics":["rust","smart-contracts","solana"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drift-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"AUDIT.md","citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-27T15:21:34.000Z","updated_at":"2025-05-12T04:33:53.000Z","dependencies_parsed_at":"2023-12-21T19:02:34.979Z","dependency_job_id":"19f5f0c1-f141-459a-a345-9d840bc88d82","html_url":"https://github.com/drift-labs/protocol-v2","commit_stats":{"total_commits":4434,"total_committers":46,"mean_commits":96.3913043478261,"dds":0.5523229589535408,"last_synced_commit":"b0b3be2b1702106207c4bd431ac56e6ff827ee15"},"previous_names":[],"tags_count":184,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drift-labs%2Fprotocol-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drift-labs%2Fprotocol-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drift-labs%2Fprotocol-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drift-labs%2Fprotocol-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drift-labs","download_url":"https://codeload.github.com/drift-labs/protocol-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253999809,"owners_count":21997336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","smart-contracts","solana"],"created_at":"2024-09-24T13:45:10.058Z","updated_at":"2026-01-08T15:18:07.575Z","avatar_url":"https://github.com/drift-labs.png","language":"TypeScript","funding_links":[],"categories":["Awesome Drift","TypeScript","DeFi Agents","DeFi"],"sub_categories":["Official resources","Benchmark Reality Check (real-world tool use)","Derivatives"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg height=\"120x\" src=\"https://uploads-ssl.webflow.com/611580035ad59b20437eb024/616f97a42f5637c4517d0193_Logo%20(1)%20(1).png\" /\u003e\n\n  \u003ch1 style=\"margin-top:20px;\"\u003eDrift Protocol v2\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://drift-labs.github.io/v2-teacher/\"\u003e\u003cimg alt=\"Docs\" src=\"https://img.shields.io/badge/docs-tutorials-blueviolet\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://discord.com/channels/849494028176588802/878700556904980500\"\u003e\u003cimg alt=\"Discord Chat\" src=\"https://img.shields.io/discord/889577356681945098?color=blueviolet\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/project-serum/anchor?color=blueviolet\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# Drift Protocol v2\n\nThis repository provides open source access to Drift V2's Typescript SDK, Solana Programs, and more.\n\nIntegrating Drift? [Go here](./sdk/README.md)\n\n# SDK Guide\n\nSDK docs can be found [here](./sdk/README.md)\n\n# Example Bot Implementations\n\nExample bots (makers, liquidators, fillers, etc) can be found [here](https://github.com/drift-labs/keeper-bots-v2)\n\n# Building Locally\n\nNote: If you are running the build on an Apple computer with an M1 chip, please set the default rust toolchain to `stable-x86_64-apple-darwin`\n\n```bash\nrustup default stable-x86_64-apple-darwin\n```\n\n## Compiling Programs\n\n```bash\n# build v2\nanchor build\n# install packages\nyarn\n# build sdk\ncd sdk/ \u0026\u0026 yarn \u0026\u0026 yarn build \u0026\u0026 cd ..\n```\n\n## Running Rust Test\n\n```bash\ncargo test\n```\n\n## Running Javascript Tests\n\n```bash\nbash test-scripts/run-anchor-tests.sh\n```\n\n# Development (with devcontainer)\n\nWe've provided a devcontainer `Dockerfile` to help you spin up a dev environment with the correct versions of Rust, Solana, and Anchor for program development.\n\nBuild the container and tag it `drift-dev`:\n```\ncd .devcontainer \u0026\u0026 docker build -t drift-dev .\n```\n\nOpen a shell to the container:\n```\n# Find the container ID first\ndocker ps\n\n# Then exec into it\ndocker exec -it \u003cCONTAINER_ID\u003e /bin/bash\n```\n\nAlternatively use an extension provided by your IDE to make use of the dev container. For example on vscode/cursor:\n\n```\n1. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)\n2. Type \"Dev Containers: Reopen in Container\"\n3. Select it and wait for the container to build\n4. The IDE terminal should be targeting the dev container now\n```\n\nUse the dev container as you would a local build environment:\n```\n# build program\nanchor build\n\n# update idl\nanchor build -- --features anchor-test \u0026\u0026 cp target/idl/drift.json sdk/src/idl/drift.json\n\n# run cargo tests\ncargo test\n\n# run typescript tests\nbash test-scripts/run-anchor-tests.sh\n```\n\n# Bug Bounty\n\nInformation about the Bug Bounty can be found [here](./bug-bounty/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrift-labs%2Fprotocol-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrift-labs%2Fprotocol-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrift-labs%2Fprotocol-v2/lists"}