Skip to main content
Every Vanish flow shares the same foundation: an authenticated HTTP client, a signing helper, and one pair of helpers for broadcasting and committing. Set these up once and both the trading and lending walkthroughs build straight on top of them.
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.

Set Up the Client


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.
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 signs transactions; you submit them. These two helpers are used by both walkthroughs - broadcast is a no-op when Vanish has already submitted the transaction itself, and commit polls until the action reaches a terminal status.

Next Steps

Trade

Fund a Vanish balance and execute your first private trade.

Lend

Open a position, then settle it and close the wallet.