Solana IDL reference › Drift V2 › UserStats
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
| Field | Type | Offset | Size |
|---|---|---|---|
| authority | pubkey | 8 | 32 |
| referrer | pubkey | 40 | 32 |
| fees | UserFees | 72 | 48 |
| totalFeePaid | u64 | 72 | 8 |
| totalFeeRebate | u64 | 80 | 8 |
| totalTokenDiscount | u64 | 88 | 8 |
| totalRefereeDiscount | u64 | 96 | 8 |
| totalReferrerReward | u64 | 104 | 8 |
| currentEpochReferrerReward | u64 | 112 | 8 |
| nextEpochTs | i64 | 120 | 8 |
| makerVolume30d | u64 | 128 | 8 |
| takerVolume30d | u64 | 136 | 8 |
| fillerVolume30d | u64 | 144 | 8 |
| lastMakerVolume30dTs | i64 | 152 | 8 |
| lastTakerVolume30dTs | i64 | 160 | 8 |
| lastFillerVolume30dTs | i64 | 168 | 8 |
| ifStakedQuoteAssetAmount | u64 | 176 | 8 |
| numberOfSubAccounts | u16 | 184 | 2 |
| numberOfSubAccountsCreated | u16 | 186 | 2 |
| referrerStatus | u8 | 188 | 1 |
| disableUpdatePerpBidAskTwap | bool | 189 | 1 |
| padding1 | [u8; 1] | 190 | 1 |
| fuelOverflowStatus | u8 | 191 | 1 |
| fuelInsurance | u32 | 192 | 4 |
| fuelDeposits | u32 | 196 | 4 |
| fuelBorrows | u32 | 200 | 4 |
| fuelPositions | u32 | 204 | 4 |
| fuelTaker | u32 | 208 | 4 |
| fuelMaker | u32 | 212 | 4 |
| ifStakedGovTokenAmount | u64 | 216 | 8 |
| lastFuelIfBonusUpdateTs | u32 | 224 | 4 |
| padding | [u8; 12] | 228 | 12 |
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>"
}
}
]
}
]
}
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.