Solana IDL reference › Drift V2 › Constituent
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:Constituent").
Discriminator (computed with the standard Anchor rule: first 8 bytes of sha256("account:Constituent"))
hex 0x003d2423b14cd8cd
bytes [0, 61, 36, 35, 177, 76, 216, 205]
base58 13KPJt5eHLQ
| Field | Type | Offset | Size |
|---|---|---|---|
| pubkey | pubkey | 8 | 32 |
| mint | pubkey | 40 | 32 |
| lpPool | pubkey | 72 | 32 |
| vault | pubkey | 104 | 32 |
| totalSwapFees | i128 | 136 | 16 |
| spotBalance | ConstituentSpotBalance | 152 | 32 |
| scaledBalance | u128 | 152 | 16 |
| cumulativeDeposits | i64 | 168 | 8 |
| marketIndex | u16 | 176 | 2 |
| balanceType | SpotBalanceType | 178 | 1 |
| padding | [u8; 5] | 179 | 5 |
| lastSpotBalanceTokenAmount | i64 | 184 | 8 |
| cumulativeSpotInterestAccruedTokenAmount | i64 | 192 | 8 |
| maxWeightDeviation | i64 | 200 | 8 |
| swapFeeMin | i64 | 208 | 8 |
| swapFeeMax | i64 | 216 | 8 |
| maxBorrowTokenAmount | u64 | 224 | 8 |
| vaultTokenBalance | u64 | 232 | 8 |
| lastOraclePrice | i64 | 240 | 8 |
| lastOracleSlot | u64 | 248 | 8 |
| oracleStalenessThreshold | u64 | 256 | 8 |
| flashLoanInitialTokenAmount | u64 | 264 | 8 |
| nextSwapId | u64 | 272 | 8 |
| derivativeWeight | u64 | 280 | 8 |
| volatility | u64 | 288 | 8 |
| constituentDerivativeDepegThreshold | u64 | 296 | 8 |
| constituentDerivativeIndex | i16 | 304 | 2 |
| spotMarketIndex | u16 | 306 | 2 |
| constituentIndex | u16 | 308 | 2 |
| decimals | u8 | 310 | 1 |
| bump | u8 | 311 | 1 |
| vaultBump | u8 | 312 | 1 |
| gammaInventory | u8 | 313 | 1 |
| gammaExecution | u8 | 314 | 1 |
| xi | u8 | 315 | 1 |
| status | u8 | 316 | 1 |
| pausedOperations | u8 | 317 | 1 |
| padding | [u8; 2] | 318 | 2 |
Every Constituent 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: 320 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": "13KPJt5eHLQ"
}
},
{
"memcmp": {
"offset": 8,
"bytes": "<pubkey 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.