Solana IDL reference › Drift V2 › State

State 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:State").

Discriminator (computed with the standard Anchor rule: first 8 bytes of sha256("account:State"))

hex 0xd8926b5e684bb6b1

bytes [216, 146, 107, 94, 104, 75, 182, 177]

base58 dE27dVH2wR2

Fields (offsets include the 8-byte discriminator)

FieldTypeOffsetSize
adminpubkey832
whitelistMintpubkey4032
discountMintpubkey7232
signerpubkey10432
srmVaultpubkey13632
perpFeeStructureFeeStructure168360
feeTiers[FeeTier; 10]168320
fillerRewardStructureOrderFillerRewardStructure48824
rewardNumeratoru324884
rewardDenominatoru324924
timeBasedRewardLowerBoundu12849616
referrerRewardEpochUpperBoundu645128
flatFillerFeeu645208
spotFeeStructureFeeStructure528360
feeTiers[FeeTier; 10]528320
fillerRewardStructureOrderFillerRewardStructure84824
rewardNumeratoru328484
rewardDenominatoru328524
timeBasedRewardLowerBoundu12885616
referrerRewardEpochUpperBoundu648728
flatFillerFeeu648808
oracleGuardRailsOracleGuardRails88848
priceDivergencePriceDivergenceGuardRails88816
markOraclePercentDivergenceu648888
oracleTwap5minPercentDivergenceu648968
validityValidityGuardRails90432
slotsBeforeStaleForAmmi649048
slotsBeforeStaleForMargini649128
confidenceIntervalMaxSizeu649208
tooVolatileRatioi649288
numberOfAuthoritiesu649368
numberOfSubAccountsu649448
lpCooldownTimeu649528
liquidationMarginBufferRatiou329604
settlementDurationu169642
numberOfMarketsu169662
numberOfSpotMarketsu169682
signerNonceu89701
minPerpAuctionDurationu89711
defaultMarketOrderTimeInForceu89721
defaultSpotAuctionDurationu89731
exchangeStatusu89741
liquidationDurationu89751
initialPctToLiquidateu169762
maxNumberOfSubAccountsu169782
maxInitializeUserFeeu169802
featureBitFlagsu89821
lpPoolFeatureBitFlagsu89831
padding[u8; 8]9848

getProgramAccounts filter

Every State account starts with the same discriminator, so a memcmp at offset 0 selects this account type. The second filter matches admin at offset 8. A dataSize: 992 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": "dE27dVH2wR2"
          }
        },
        {
          "memcmp": {
            "offset": 8,
            "bytes": "<admin 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.