SetupIntegration

Guide for setting up a Flash Trade v2 integration from scratch.

1. Verify connectivity

export FLASH_API_URL="https://flashapi.trade"          # API host (v2 lives under /v2)
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"
export V2_RPC_URL="<v2-rpc-endpoint>"                   # for v2 trade submission

# Health + reference data
curl $FLASH_API_URL/v2/health
curl $FLASH_API_URL/v2/tokens
curl $FLASH_API_URL/v2/prices

2. Know where to submit

Each endpoint's transaction submits to one of two RPC endpoints. Get this right or submissions will fail:

Endpoint group
Submit to

init-deposit-ledger, init-basket, deposit-direct, delegate-basket, request-withdrawal, execute-withdrawal

SOLANA_RPC_URL

All trading endpoints (open/close/reverse, collateral, triggers, limits)

V2_RPC_URL

3. Dependencies (by language)

Language
HTTP Client
Solana Signing
Basket Decoding

TypeScript

fetch (built-in)

@solana/web3.js

v2 client SDK

Python

requests / httpx

solders

decode raw bytes manually

Rust

reqwest

solana-sdk

v2 Rust SDK

Any

Any HTTP client

base64 decode + sign

SDK or manual Borsh

To turn the streamed basketData bytes into native PositionMeta[] / OrderMeta[], use the v2 client SDK. The API's positionMetrics / orderMetrics already give you UI-ready strings if you don't need the raw structs.

4. One-time wallet setup

A wallet must be initialized and delegated before it can trade. Build each transaction via the API, sign with the owner, submit to your Solana RPC, and confirm:

5. Verify your integration

  1. Read market data? GET /v2/prices, GET /v2/tokens.

  2. Read wallet state? GET /v2/owner/<WALLET> (basket snapshot).

  3. Build a quote? open-position without owner (preview-only).

  4. Trade? Build open-position, sign, submit to the v2 RPC, then confirm via the basket snapshot/WS.

Next: BuildTransaction.

Last updated

Was this helpful?