Solana IDL reference › Drift V2 › UserStats

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

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

hex 0xb0df881b7a4f20e3

bytes [176, 223, 136, 27, 122, 79, 32, 227]

base58 WathPFYFksc

Fields (offsets include the 8-byte discriminator)

FieldTypeOffsetSize
authoritypubkey832
referrerpubkey4032
feesUserFees7248
totalFeePaidu64728
totalFeeRebateu64808
totalTokenDiscountu64888
totalRefereeDiscountu64968
totalReferrerRewardu641048
currentEpochReferrerRewardu641128
nextEpochTsi641208
makerVolume30du641288
takerVolume30du641368
fillerVolume30du641448
lastMakerVolume30dTsi641528
lastTakerVolume30dTsi641608
lastFillerVolume30dTsi641688
ifStakedQuoteAssetAmountu641768
numberOfSubAccountsu161842
numberOfSubAccountsCreatedu161862
referrerStatusu81881
disableUpdatePerpBidAskTwapbool1891
padding1[u8; 1]1901
fuelOverflowStatusu81911
fuelInsuranceu321924
fuelDepositsu321964
fuelBorrowsu322004
fuelPositionsu322044
fuelTakeru322084
fuelMakeru322124
ifStakedGovTokenAmountu642168
lastFuelIfBonusUpdateTsu322244
padding[u8; 12]22812

getProgramAccounts filter

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