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: the Bot API with Hummingbot and ccxt connectors, venue REST, market data streams and MCP.

TRUE runs a perpetuals venue on Solana with an oracle mark from TRUE’s price index (the median of major exchange books), 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 four surfaces

SurfaceBase URLCredentialUse it for
Bot APIhttps://app.truefinance.ai/api/bot/v1bot key (tbk_…) plus secret, HMAC-SHA256 headersexchange-style JSON trading for Hummingbot, ccxt, Freqtrade and your own code: markets, orders, positions, fills, candles, an account stream and a WebSocket token
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

The Bot API: a key and secret from the Bots tab, HMAC headers, JSON orders, ready connectors for Hummingbot, ccxt and Freqtrade. TRUE signs the venue order for the one account the key was made for; the key cannot withdraw.

Own keys

Signing orders yourself

Venue REST: every write carries an Ed25519 signature from a key you hold, and TRUE never sees it. More work, no intermediary.

Market makers

Quoting on the book

The WebSocket orderbook topic delivers sequence numbered deltas; quotes go through the Bot API with postOnly or through signed venue REST 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 /api/bot/v1/markets once: lot size, tick, fees, max leverage, status per market. Refresh every few minutes.
02
Subscribe
POST /api/bot/v1/ws-token, 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 /api/bot/v1/orders with the HMAC headers. postOnly for maker quotes, reduceOnly for closes, a clientOrderId so a retry cannot double.
05
Fills
Your own fills arrive on the account SSE stream and on GET /api/bot/v1/fills; confirm an order with GET /api/bot/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 your open orders before retrying, or retry with the same clientOrderId on the Bot API, 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: