Velocity for Developers
Velocity is a perpetual futures exchange that runs as a Solana program. Trading is non-custodial: an account is an onchain PDA, orders are accounts the program owns, and nothing sits between the trader and the chain except an RPC node. Building on it means reading those accounts and sending those instructions, which is what the TypeScript SDK exists to make bearable.
Velocity forked Drift and then diverged: its own deployment, its own SDK package, and a deliberately reduced feature set. An integration being ported from upstream should start with the migration guide, which lists every behavioral and API difference rather than leaving them to be found.
The Velocity program is not open source yet. It will be published once the post-fork audit report is final. These docs are the reference until then, and the docs site itself is public: file a correction as an issue or a pull request. See Contributing.
Start here
Concepts
The onchain model: what accounts exist, how positions and orders are stored, and why a slot is not a fixed amount of time.
SDK setup
Install the package, build a VelocityClient, subscribe, and place a first order.
Migrate from Drift
Every difference from upstream, for an integration that already works against Drift.
The two interfaces
The SDK is the write path. @velocity-exchange/sdk wraps the program: placing and canceling orders, managing subaccounts and positions, computing margin, subscribing to account and event streams, and building the transactions that carry all of it. It reads live state from the chain, so it is the right tool for anything that has to be current.
| Package | Version | Where the source lives |
|---|---|---|
@velocity-exchange/sdk | 0.20.0 | velocity-v1/packages/sdk |
@velocity-exchange/vaults-sdk | Published, trails the monorepo | velocity-v1/packages/vaults-sdk |
There is no Python SDK. A Rust client (velocity-rs) exists in the velocity-v1 monorepo but is source-only and not on crates.io. The monorepo itself is not public yet, so those paths name locations that cannot be browsed from outside the team.
The Data API is the read path for history. It serves indexed events over HTTP, fills, funding payments, liquidations, settlements, candles, leaderboards, so an analytics or portfolio surface does not have to run an indexer. It is the wrong tool for live order state and the right one for anything older than the current block.
Guides by integration type
| Integration | Go to |
|---|---|
| An app, dashboard, or analytics surface over Velocity data | Ecosystem builders |
| A quoting strategy or a maker bot | Market makers |
| A keeper bot, or automated execution from an existing service | Trading automation |
| A managed vault that trades depositor capital | Vault managers |
| A frontend on top of someone else's vault | Vault depositors |
| A frontend that earns a per-order fee on the flow it routes | Builder codes |
Getting help
Ask in #research-and-dev-chat on Discord. If a page here disagrees with what the program does, that is a bug: report it against the docs repository.