Conventions
Rules shared by every endpoint — base URL, units, errors, enums.
Last updated
Was this helpful?
Rules shared by every endpoint — base URL, units, errors, enums.
These apply across the whole API and aren't repeated on each endpoint page.
https://flashapi.tradeNo API key. Reads are plain HTTP; every transaction-builder endpoint returns an unsigned transaction you sign client-side. See Signing & submitting.
UI units — human-readable decimal strings (e.g. "100.0" USDC, "148.52" price). Request bodies and *Ui response fields use these. The server converts to native using each token's decimals (including Token-2022 scaling).
Native units — raw integers (e.g. price + exponent). Apply value × 10^exponent.
Trading and preview endpoints identify a position by (owner, marketSymbol, side) — e.g. "SOL" + "LONG". No position pubkeys. See The Basket model.
Two keys, two surfaces — always check both:
{ "error": "…" } // HTTP-level failure (4xx / 5xx)
{ "err": "…" } // compute failure returned inside a 200 body (quote endpoints)200
Success
101
WebSocket upgrade
400
Bad request / validation error / invalid pubkey
404
Resource not found (account, price symbol, pool)
429
Too many requests (per-owner WebSocket limit)
500
Internal server error / compute error / blockhash fetch failed
503
Service unavailable (price missing, global connection limit)
Full recovery guidance: Errors.
TradeType (SCREAMING_SNAKE_CASE) — LONG, SHORT. SWAP is not supported.
OrderType — MARKET (executes immediately), LIMIT (executes at trigger price).
MarginAction — ADD, REMOVE.
transactionBase64
Unsigned v0 transaction. null in preview-only mode
receipt
Receipt PDA to poll (withdrawal/settlement builders)
err
Set when a quote computation failed
Last updated
Was this helpful?
Was this helpful?

