Solana IDL reference › Drift V2 › SpotMarket
Drift V2 account type. Program ID dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH. Data starts with the 8-byte account discriminator, computed with the standard Anchor rule: first 8 bytes of sha256("account:SpotMarket").
Discriminator (computed with the standard Anchor rule: first 8 bytes of sha256("account:SpotMarket"))
hex 0x64b1086ba8414127
bytes [100, 177, 8, 107, 168, 65, 65, 39]
base58 HqqNdyfVbzv
| Field | Type | Offset | Size |
|---|---|---|---|
| pubkey | pubkey | 8 | 32 |
| oracle | pubkey | 40 | 32 |
| mint | pubkey | 72 | 32 |
| vault | pubkey | 104 | 32 |
| name | [u8; 32] | 136 | 32 |
| historicalOracleData | HistoricalOracleData | 168 | 48 |
| lastOraclePrice | i64 | 168 | 8 |
| lastOracleConf | u64 | 176 | 8 |
| lastOracleDelay | i64 | 184 | 8 |
| lastOraclePriceTwap | i64 | 192 | 8 |
| lastOraclePriceTwap5min | i64 | 200 | 8 |
| lastOraclePriceTwapTs | i64 | 208 | 8 |
| historicalIndexData | HistoricalIndexData | 216 | 40 |
| lastIndexBidPrice | u64 | 216 | 8 |
| lastIndexAskPrice | u64 | 224 | 8 |
| lastIndexPriceTwap | u64 | 232 | 8 |
| lastIndexPriceTwap5min | u64 | 240 | 8 |
| lastIndexPriceTwapTs | i64 | 248 | 8 |
| revenuePool | PoolBalance | 256 | 24 |
| scaledBalance | u128 | 256 | 16 |
| marketIndex | u16 | 272 | 2 |
| padding | [u8; 6] | 274 | 6 |
| spotFeePool | PoolBalance | 280 | 24 |
| scaledBalance | u128 | 280 | 16 |
| marketIndex | u16 | 296 | 2 |
| padding | [u8; 6] | 298 | 6 |
| insuranceFund | InsuranceFund | 304 | 112 |
| vault | pubkey | 304 | 32 |
| totalShares | u128 | 336 | 16 |
| userShares | u128 | 352 | 16 |
| sharesBase | u128 | 368 | 16 |
| unstakingPeriod | i64 | 384 | 8 |
| lastRevenueSettleTs | i64 | 392 | 8 |
| revenueSettlePeriod | i64 | 400 | 8 |
| totalFactor | u32 | 408 | 4 |
| userFactor | u32 | 412 | 4 |
| totalSpotFee | u128 | 416 | 16 |
| depositBalance | u128 | 432 | 16 |
| borrowBalance | u128 | 448 | 16 |
| cumulativeDepositInterest | u128 | 464 | 16 |
| cumulativeBorrowInterest | u128 | 480 | 16 |
| totalSocialLoss | u128 | 496 | 16 |
| totalQuoteSocialLoss | u128 | 512 | 16 |
| withdrawGuardThreshold | u64 | 528 | 8 |
| maxTokenDeposits | u64 | 536 | 8 |
| depositTokenTwap | u64 | 544 | 8 |
| borrowTokenTwap | u64 | 552 | 8 |
| utilizationTwap | u64 | 560 | 8 |
| lastInterestTs | u64 | 568 | 8 |
| lastTwapTs | u64 | 576 | 8 |
| expiryTs | i64 | 584 | 8 |
| orderStepSize | u64 | 592 | 8 |
| orderTickSize | u64 | 600 | 8 |
| minOrderSize | u64 | 608 | 8 |
| maxPositionSize | u64 | 616 | 8 |
| nextFillRecordId | u64 | 624 | 8 |
| nextDepositRecordId | u64 | 632 | 8 |
| initialAssetWeight | u32 | 640 | 4 |
| maintenanceAssetWeight | u32 | 644 | 4 |
| initialLiabilityWeight | u32 | 648 | 4 |
| maintenanceLiabilityWeight | u32 | 652 | 4 |
| imfFactor | u32 | 656 | 4 |
| liquidatorFee | u32 | 660 | 4 |
| ifLiquidationFee | u32 | 664 | 4 |
| optimalUtilization | u32 | 668 | 4 |
| optimalBorrowRate | u32 | 672 | 4 |
| maxBorrowRate | u32 | 676 | 4 |
| decimals | u32 | 680 | 4 |
| marketIndex | u16 | 684 | 2 |
| ordersEnabled | bool | 686 | 1 |
| oracleSource | OracleSource | 687 | 1 |
| status | MarketStatus | 688 | 1 |
| assetTier | AssetTier | 689 | 1 |
| pausedOperations | u8 | 690 | 1 |
| ifPausedOperations | u8 | 691 | 1 |
| feeAdjustment | i16 | 692 | 2 |
| maxTokenBorrowsFraction | u16 | 694 | 2 |
| flashLoanAmount | u64 | 696 | 8 |
| flashLoanInitialTokenAmount | u64 | 704 | 8 |
| totalSwapFee | u64 | 712 | 8 |
| scaleInitialAssetWeightStart | u64 | 720 | 8 |
| minBorrowRate | u8 | 728 | 1 |
| fuelBoostDeposits | u8 | 729 | 1 |
| fuelBoostBorrows | u8 | 730 | 1 |
| fuelBoostTaker | u8 | 731 | 1 |
| fuelBoostMaker | u8 | 732 | 1 |
| fuelBoostInsurance | u8 | 733 | 1 |
| tokenProgramFlag | u8 | 734 | 1 |
| poolId | u8 | 735 | 1 |
| padding | [u8; 40] | 736 | 40 |
Every SpotMarket account starts with the same discriminator, so a memcmp at offset 0 selects this account type. The second filter matches pubkey at offset 8. A dataSize: 776 filter would also work only while live accounts still have the snapshot size; programs often add fields in upgrades, so it is left out here. getProgramAccounts on a large program is heavy; many RPC providers limit or disable it.
{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH",
{
"encoding": "base64",
"filters": [
{
"memcmp": {
"offset": 0,
"bytes": "HqqNdyfVbzv"
}
},
{
"memcmp": {
"offset": 8,
"bytes": "<pubkey as base58>"
}
}
]
}
]
}
Decoding runs on Rugsight's server against the bundled snapshot. Nothing is fetched from the chain. Paste public account data only; never paste a private key or seed phrase.
Drift V2 instructions · Explain a transaction
Data: solana-idls@1.2.1 (MIT, © Obsidian Protocol) and SPL Token / Token-2022 state layouts (Apache-2.0), snapshot 2026-11-17. Programs can upgrade and an IDL snapshot can lag the deployed program, so check important offsets against current account data.