Skip to main content
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
Store sensitive values - your API key and keypair - in environment variables. Never expose them in source code or client-side bundles.

Client Setup

One helper wraps every Vanish call: it attaches the x-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 of user_address. Every message shares the same prefix and differs only in its Details: line - see Signing Requests for the line each endpoint expects.
The signature goes in the request body: signature on the account reads, user_signature on every other signed endpoint.
Timestamps must be Unix time in milliseconds - Date.now() in TypeScript, timestamp_millis() in Rust - and every value you sign must match the value you send in the request body.

Broadcast and Commit

Vanish responds in one of two ways: it returns a signed transaction 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

Always fetch a fresh address before each deposit - addresses may rotate to ensure maximum privacy.
2

Send SOL on-chain

Amounts are in the token’s smallest unit - 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.