Skip to Content
DevelopersConceptsUnderstanding Velocity's Onchain Model

Understanding Velocity’s Onchain Model

These pages explain how Velocity’s Solana program works at the account level. Understanding these concepts helps you build better integrations, debug issues, and optimize performance.

Program Structure

Deep dive into positions, orders, and calculations

Understand the mechanics of trading:

  • How positions are tracked and updated
  • Order lifecycle and execution
  • Collateral and margin calculations
  • Cross-margin accounting
Understand how trading actually works onchain ↗

Account Model

High-level overview of Velocity’s account architecture

Learn about the different account types that make up the protocol:

  • State account (global config, cold/warm/hot admin keys)
  • Market accounts (perp & spot)
  • User accounts & stats
  • PDAs and account relationships
Understand what accounts exist and their purpose ↗

Slot Duration

Why a slot count is not a fixed amount of time

Solana’s slot time is shrinking from 400ms to 200ms. Learn how to convert correctly:

  • The State fields that hold the live slot length
  • Reading and converting with the SDK’s math/time helpers
  • Which protocol timings move with it
Convert slots to wall-clock time correctly ↗

Optimizations

How the AMM manages liquidity depth and risk

Learn how the AMM adapts to market conditions:

  • Concentration factor and formulaic K liquidity adjustments
  • Participating in the JIT auction
  • P&L settlement and terminal state handling
See how the AMM adjusts its own liquidity ↗

Program & Vault Addresses

Mainnet program IDs for Velocity and Velocity Vaults

Find the deployed addresses you need to point an integration at:

  • Velocity program ID
  • Velocity Vaults program ID
Get the mainnet program and vault addresses ↗
Last updated on