Drift
drift-reserve is the liquid reserve sleeve.
The implementation lives in services/adapters/src/drift.ts.
Supported paths
Fixture mode
Used when no live RPC is provided. Good for:- offline tests
- deterministic demos
- no-network development
SDK mode
Used whenDRIFT_RPC_URL is set.
Current supported operations:
depositrequest_withdrawfinalize_withdrawvia the same withdraw path
Important behavior
- deposit can initialize the Drift user account automatically
- withdraw requires an existing user account with collateral
- the adapter emits
instructionLabelsandinstructionEnvelopesfor Ranger
Main environment variables
Validation order
node --experimental-strip-types services/ranger/src/drift-smoke.ts- set
DRIFT_SMOKE_MODE=depositfirst - use
drift-live-send.tsonly after bundle construction is working - use
withdrawonly after a real deposit exists for that signer
Common failure mode
If you runwithdraw too early, you should expect an error that the Drift user account does not exist yet.