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

Conventions

Rules shared by every endpoint — base URL, units, errors, enums.

These apply across the whole API and aren't repeated on each endpoint page.

Base URL

https://flashapi.trade

No API key. Reads are plain HTTP; every transaction-builder endpoint returns an unsigned transaction you sign client-side. See Signing & submitting.

Units

  • 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.

Position identity

Trading and preview endpoints identify a position by (owner, marketSymbol, side) — e.g. "SOL" + "LONG". No position pubkeys. See The Basket model.

Error shapes

Two keys, two surfaces — always check both:

{ "error": "" }   // HTTP-level failure (4xx / 5xx)
{ "err": "" }     // compute failure returned inside a 200 body (quote endpoints)

Status codes

Code
Meaning

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.

Enums

TradeType (SCREAMING_SNAKE_CASE) — LONG, SHORT. SWAP is not supported.

OrderTypeMARKET (executes immediately), LIMIT (executes at trigger price).

MarginActionADD, REMOVE.

Transaction responses

Field
When

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?