Skip to main content
Market accounts store configuration and state for perpetual and spot markets.

PerpMarket Account

Perpetual market configuration and AMM state.

Key Fields

marketIndex
u16
Unique market identifier
amm
AMM
Automated market maker state including reserves, oracle, and funding
marginRatioInitial
u32
Initial margin requirement
marginRatioMaintenance
u32
Maintenance margin requirement
imfFactor
u32
Initial margin fraction factor for size-based scaling
status
MarketStatus
Market status (ACTIVE, PAUSED, etc.)
contractType
ContractType
PERPETUAL or FUTURE
contractTier
ContractTier
Risk tier (A, B, C, SPECULATIVE, ISOLATED)

SpotMarket Account

Spot market configuration for collateral assets.

Key Fields

marketIndex
u16
Unique market identifier
mint
Pubkey
SPL token mint address
vault
Pubkey
Token vault holding deposits
initialAssetWeight
u32
Weight for initial margin calculations
maintenanceAssetWeight
u32
Weight for maintenance margin
depositBalance
u128
Total deposits in the market
borrowBalance
u128
Total borrows in the market
optimalUtilization
u32
Optimal utilization rate for interest

TypeScript Types

Market Types

Full TypeScript interfaces

Perp Markets API

Access market data

Spot Markets API

Spot market methods

Market Concepts

Understanding markets

Build docs developers (and LLMs) love