Market Types
Drift Protocol supports two primary market types, each with distinct characteristics and use cases.sdk/src/types.ts
Perpetual Markets
Perpetual futures are derivative contracts that track the price of an underlying asset without an expiration date.Perpetual Market Account
Each perp market maintains extensive state:sdk/src/types.ts
Contract Types
Drift supports multiple contract types:sdk/src/types.ts
Perpetual contracts are the most common and have no expiration. Future contracts settle at a specific expiry time. Prediction markets are binary contracts that settle to 0 or 1.
AMM Mechanism
The AMM uses a virtual constant product market maker with dynamic repegging: Constant Product Formula: Price Calculation: ThepegMultiplier is adjusted periodically to keep the AMM price close to the oracle price, using protocol fees to cover the cost of repegging.
Funding Rates
Funding rates incentivize the perpetual price to track the oracle (spot) price:- Positive funding: Longs pay shorts (when mark > oracle)
- Negative funding: Shorts pay longs (when mark < oracle)
- Payment interval: Typically every hour
- Rate calculation: Based on the gap between mark and oracle TWAPs
sdk/src/types.ts
Margin Requirements
Perp markets have tiered margin requirements based on size: Initial Margin Ratio: Required to open new positions Maintenance Margin Ratio: Required to keep positions openSpot Markets
Spot markets enable trading, lending, and borrowing of assets on a cross-collateralized basis.Spot Market Account
sdk/src/types.ts
Asset Tiers
Spot markets are categorized by asset quality:sdk/src/types.ts
Interest Rate Model
Spot markets use a utilization-based interest rate curve: Utilization: Borrow Rate (when util ≤ optimal): Borrow Rate (when util > optimal): Deposit Rate:Scaled Balances
Spot positions use a scaled balance system for efficient interest accrual:sdk/src/types.ts
Collateral Weights
Asset and liability weights determine how much collateral value each asset provides:- Initial Asset Weight (e.g., 0.8 = 80%): Collateral value for opening positions
- Maintenance Asset Weight (e.g., 0.9 = 90%): Collateral value for maintaining positions
- Initial Liability Weight (e.g., 1.2 = 120%): Borrow weight for opening positions
- Maintenance Liability Weight (e.g., 1.1 = 110%): Borrow weight for maintaining positions
Higher quality assets (like USDC) have weights closer to 1.0, while volatile assets have more conservative weights.
Market Operations
Paused Operations
Both perp and spot markets support granular operation pausing:sdk/src/types.ts
Market Data
Historical Oracle Data
Markets track oracle price history for various purposes:sdk/src/types.ts
Next Steps
Positions
Learn how to manage positions in these markets
Oracles
Understand oracle integrations and price feeds
Margin System
Deep dive into margin calculations
Orders
Explore order types and execution