Solana IDL reference › Drift V2 › User
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:User").
Discriminator (computed with the standard Anchor rule: first 8 bytes of sha256("account:User"))
hex 0x9f755fe3ef973aec
bytes [159, 117, 95, 227, 239, 151, 58, 236]
base58 TfwwBiNJtao
| Field | Type | Offset | Size |
|---|---|---|---|
| authority | pubkey | 8 | 32 |
| delegate | pubkey | 40 | 32 |
| name | [u8; 32] | 72 | 32 |
| spotPositions | [SpotPosition; 8] | 104 | 320 |
| perpPositions | [PerpPosition; 8] | 424 | 768 |
| orders | [Order; 32] | 1192 | 3072 |
| lastAddPerpLpSharesTs | i64 | 4264 | 8 |
| totalDeposits | u64 | 4272 | 8 |
| totalWithdraws | u64 | 4280 | 8 |
| totalSocialLoss | u64 | 4288 | 8 |
| settledPerpPnl | i64 | 4296 | 8 |
| cumulativeSpotFees | i64 | 4304 | 8 |
| cumulativePerpFunding | i64 | 4312 | 8 |
| liquidationMarginFreed | u64 | 4320 | 8 |
| lastActiveSlot | u64 | 4328 | 8 |
| nextOrderId | u32 | 4336 | 4 |
| maxMarginRatio | u32 | 4340 | 4 |
| nextLiquidationId | u16 | 4344 | 2 |
| subAccountId | u16 | 4346 | 2 |
| status | u8 | 4348 | 1 |
| isMarginTradingEnabled | bool | 4349 | 1 |
| idle | bool | 4350 | 1 |
| openOrders | u8 | 4351 | 1 |
| hasOpenOrder | bool | 4352 | 1 |
| openAuctions | u8 | 4353 | 1 |
| hasOpenAuction | bool | 4354 | 1 |
| marginMode | MarginMode | 4355 | 1 |
| poolId | u8 | 4356 | 1 |
| padding1 | [u8; 3] | 4357 | 3 |
| lastFuelBonusUpdateTs | u32 | 4360 | 4 |
| padding | [u8; 12] | 4364 | 12 |
Every User 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: 4376 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": "TfwwBiNJtao"
}
},
{
"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.