Solana instructions › Drift V2 › endSwap

endSwap

Drift V2 instruction. Program ID dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH. Position in this snapshot: 34.

Discriminator or tag: 0xb1b81bc1220dd291 — computed from the standard Anchor rule (first 8 bytes of sha256("global:<snake_case_name>")); confirm against a published IDL or a live transaction before relying on it in production code.

Accounts

#AccountRole
0stateread-only
1userwritable
2userStatswritable
3authoritysigner
4outSpotMarketVaultwritable
5inSpotMarketVaultwritable
6outTokenAccountwritable
7inTokenAccountwritable
8tokenProgramread-only
9driftSignerread-only
10instructionsread-only

Arguments

ArgumentType
inMarketIndexu16
outMarketIndexu16
limitPriceoption<u64>
reduceOnlyoption<SwapReduceOnly>

Other Drift V2 instructions

To see which instructions a confirmed transaction actually ran, paste its signature into the Rugsight transaction explainer.

Instruction lists and published discriminators come from solana-idls@1.2.1 (MIT) and, for the System Program, Compute Budget and Associated Token Account programs, from their public instruction enums (Apache-2.0). Snapshot date 2026-11-17. Programs can upgrade, so a live program may differ from this snapshot. Computed Anchor discriminators are the first 8 bytes of sha256("global:<snake_case_name>") and are labelled as computed.