You’ll need an API key to follow this guide. Contact the Vanish team via Discord to get one during onboarding.
Environment Setup
Before starting, make sure you have the following available:- Vanish API key - provisioned during onboarding
- Solana RPC endpoint - any standard Solana RPC URL
- User keypair - the Ed25519 keypair for the wallet you’re trading from
- Solana balance - enough SOL to cover the deposit and transaction fees
Client Setup
One helper wraps every Vanish call: it attaches thex-api-key header, sets the JSON content type, and throws on a non-2xx response.
Sign Requests
Most endpoints require a signed message proving ownership ofuser_address. Every message shares the same prefix and differs only in its Details: line - see Signing Requests for the line each endpoint expects.
signature on the account reads, user_signature on every other signed endpoint.
Broadcast and Commit
Vanish responds in one of two ways: it returns a signedtransaction for you to broadcast, or it submits the transaction itself and returns none. broadcast covers both - it sends the transaction if there is one, and does nothing if there is not. commit then polls until the action reaches a terminal status.
Fund Your Account
Every Vanish flow spends the user’s Vanish balance, so fund it before anything else. Fetch a deposit address, send the funds on-chain, then commit the transaction - all three steps use the helpers above.1
Get a deposit address
2
Send SOL on-chain
100_000_000 lamports is 0.1 SOL. See Amount Units.3
Commit the deposit
Next Steps
Trade
Execute your first private trade against the balance you funded.
Lend
Open a position, then settle it and close the wallet.
