Solana IDL reference › Drift V2 › SpotMarket

SpotMarket account layout

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

Fields (offsets include the 8-byte discriminator)

FieldTypeOffsetSize
pubkeypubkey832
oraclepubkey4032
mintpubkey7232
vaultpubkey10432
name[u8; 32]13632
historicalOracleDataHistoricalOracleData16848
lastOraclePricei641688
lastOracleConfu641768
lastOracleDelayi641848
lastOraclePriceTwapi641928
lastOraclePriceTwap5mini642008
lastOraclePriceTwapTsi642088
historicalIndexDataHistoricalIndexData21640
lastIndexBidPriceu642168
lastIndexAskPriceu642248
lastIndexPriceTwapu642328
lastIndexPriceTwap5minu642408
lastIndexPriceTwapTsi642488
revenuePoolPoolBalance25624
scaledBalanceu12825616
marketIndexu162722
padding[u8; 6]2746
spotFeePoolPoolBalance28024
scaledBalanceu12828016
marketIndexu162962
padding[u8; 6]2986
insuranceFundInsuranceFund304112
vaultpubkey30432
totalSharesu12833616
userSharesu12835216
sharesBaseu12836816
unstakingPeriodi643848
lastRevenueSettleTsi643928
revenueSettlePeriodi644008
totalFactoru324084
userFactoru324124
totalSpotFeeu12841616
depositBalanceu12843216
borrowBalanceu12844816
cumulativeDepositInterestu12846416
cumulativeBorrowInterestu12848016
totalSocialLossu12849616
totalQuoteSocialLossu12851216
withdrawGuardThresholdu645288
maxTokenDepositsu645368
depositTokenTwapu645448
borrowTokenTwapu645528
utilizationTwapu645608
lastInterestTsu645688
lastTwapTsu645768
expiryTsi645848
orderStepSizeu645928
orderTickSizeu646008
minOrderSizeu646088
maxPositionSizeu646168
nextFillRecordIdu646248
nextDepositRecordIdu646328
initialAssetWeightu326404
maintenanceAssetWeightu326444
initialLiabilityWeightu326484
maintenanceLiabilityWeightu326524
imfFactoru326564
liquidatorFeeu326604
ifLiquidationFeeu326644
optimalUtilizationu326684
optimalBorrowRateu326724
maxBorrowRateu326764
decimalsu326804
marketIndexu166842
ordersEnabledbool6861
oracleSourceOracleSource6871
statusMarketStatus6881
assetTierAssetTier6891
pausedOperationsu86901
ifPausedOperationsu86911
feeAdjustmenti166922
maxTokenBorrowsFractionu166942
flashLoanAmountu646968
flashLoanInitialTokenAmountu647048
totalSwapFeeu647128
scaleInitialAssetWeightStartu647208
minBorrowRateu87281
fuelBoostDepositsu87291
fuelBoostBorrowsu87301
fuelBoostTakeru87311
fuelBoostMakeru87321
fuelBoostInsuranceu87331
tokenProgramFlagu87341
poolIdu87351
padding[u8; 40]73640

getProgramAccounts filter

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>"
          }
        }
      ]
    }
  ]
}

Decode account data

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.

Other Drift V2 account types

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.