This page hasn't been translated yet. Showing English version.

Trading API

Everything a bot, a market maker or a data consumer can call on TRUE: venue REST for orders, market data over REST, SSE and WebSocket, and the MCP endpoint.

TRUE runs a perpetuals venue on Solana with an oracle mark from Pyth, an on chain custody vault and a sequencer that matches orders. This section documents every surface an outside program can use, exactly as deployed. Nothing here is aspirational: where something is planned it says so.

The three surfaces

SurfaceBase URLCredentialUse it for
Venue REST (sequencer)https://dex-prod.truefinance.aiAPI key (apikey_…) plus Ed25519 signature on writes; none for public readsplacing, modifying and cancelling orders; account, positions, transfers; raw market data
TRUE market datahttps://app.truefinance.ainone for public dataorder book, best bid and offer, oracle marks, trades, klines, 24h stats, over REST, SSE or WebSocket
MCP (AI assistants)https://app.truefinance.ai/api/v1/mcpMCP key (true_sk_…) or OAuthletting Claude, ChatGPT, Cursor or your own agent read a portfolio and place approved trades

Which one you want

Bots

A trading bot

Venue REST for orders, TRUE WebSocket or SSE for market data. Every write is signed with your own key; TRUE never holds it.

Market makers

Quoting on the book

The WebSocket orderbook topic delivers sequence numbered deltas; quotes go through the same signed REST calls with POST_ONLY.

Data consumers

Screeners, aggregators, listing sites

TRUE market data only. No key, no signature. Markets, stats, book, trades and klines, plus venue totals for TVL and volume.

Assistants

An AI acting for a person

MCP. Every order proposed through MCP is approved by the user in the TRUE app before it executes; leveraged orders never auto approve.

The sequence a bot follows

01
Markets
GET /v1/markets once: lot size, tick, status per market. Refresh every few minutes.
02
Subscribe
Open the WebSocket, subscribe orderbook, bbo, mark and trades for your markets, plus marks:ALL if you quote many.
03
Book
Apply the snapshot, then deltas by sequence number. On a gap, resubscribe the book. Never render a book after a gap.
04
Order
POST /v1/orders with the signed headers. POST_ONLY for maker quotes, REDUCE_ONLY for closes.
05
Fills
Your own fills arrive on trades:SYM; confirm with GET /v1/orders/{id}.
06
Mark
Mark to market on mark:SYM. The mark is the settlement and liquidation price, not the last fill.
Retries

Treat any write without a 2xx within 5 seconds as unknown. Read GET /v1/orders before retrying, so a retry never doubles an order.

Prices: mark, not last fill

Every price TRUE shows, the header, the chart, the list and liquidations, is the oracle mark. The last fill (last_traded_price in stats) sits on a thin book and can differ from the mark by tens of dollars. If you display TRUE prices anywhere, use the mark: the mark event, the marks:ALL topic, or the TRUE kline endpoint, which builds bars from the mark.

Last updated: