Skip to Content
DevelopersConceptsProtocol Concepts

Protocol Concepts

Core concepts for understanding Drift’s onchain architecture. Language-agnostic fundamentals that apply to all SDKs.

Understanding Drift’s Onchain Model

Program Structure

High-level overview of Drift’s account architecture

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

  • State account (global config)
  • Market accounts (perp & spot)
  • User accounts & stats
  • PDAs and account relationships

Start here to understand what accounts exist and their purpose.

Account Model

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

Read this to understand how trading actually works onchain.

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

Last updated on