For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quickstart

One golden path from an empty wallet to a trade and back to cash.

Go from an empty wallet to an open position and back out in one pass. This is the only page that stitches every step together — each endpoint is documented in full under API reference.

Base URL: https://flashapi.trade

export FLASH_API_URL="https://flashapi.trade"
export WALLET="<your-wallet-pubkey>"

Every builder returns an unsigned transaction — you sign client-side and submit to the right RPC:

Transaction kind
Submit to

Account & funds (deposit, delegate-basket, withdraw, …)

your Solana RPC

Trading (open-position, close-position, …)

the v2 RPC endpoint

See Signing & submitting for the decode-sign-send code.

1. Check the service and read a price

curl $FLASH_API_URL/health
curl $FLASH_API_URL/prices/SOL

2. Fund the wallet

deposit moves collateral in and bundles any one-time setup (basket, deposit ledger, delegation, trade vault) into the same transaction.

curl -X POST $FLASH_API_URL/transaction-builder/deposit \
  -H 'Content-Type: application/json' \
  -d '{ "owner": "'$WALLET'", "tokenSymbol": "USDC", "amount": "100.0" }'

Sign with the owner, submit to your Solana RPC, confirm.

3. Delegate (enable trading)

One-time per wallet. Submit to your Solana RPC.

4. Open a position

The response carries a quote (entry price, liq price, fees) plus transactionBase64. Sign and submit to the v2 RPC.

Tip: omit owner to get the quote back with transactionBase64: null — a free preview before you commit.

5. Read your position

Don't reconstruct state from the trade response — read the basket:

positionMetrics gives UI-ready PnL, leverage, and liquidation price keyed by market. For live updates, use the WebSocket instead of polling.

6. Close

Submit to the v2 RPC.

7. Withdraw

feePayer must differ from owner; the client co-signs both. If the response says custodySettlementRequired, settle first and retry — see Withdraw funds. Submit to your Solana RPC.


Next steps

Last updated

Was this helpful?