Gateway API for the True Markets trading platform - order orchestration, quotes, and balance management
True Markets Gateway API (1.0.0)
Limit price per unit of base asset as a decimal string. Required for limit orders; must not be sent for market orders.
Unit of the quantity.
- base — Quantity is denominated in the base asset. Required for limit orders. Supported for market sell orders.
- quote — Quantity is denominated in the quote asset. Required for market buy orders. For DeFi sell orders,
basemust be used instead.
The type of order to place.
- market — Execute immediately at the best available price. Buy orders require
qty_unit: quote. Price must not be specified. - limit — Place an order at a specific price. Requires
priceandqty_unit: base. Only supported on CeFi;chainmust not be specified.
The side of the order.
- buy — Purchase the base asset using the quote asset.
- sell — Sell the base asset in exchange for the quote asset.
- Mock server
https://docs.truemarkets.co/_mock/apis/gateway/v1/orders
- Production
https://api.truemarkets.co/v1/conductor/orders
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.truemarkets.co/_mock/apis/gateway/v1/orders \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"base_asset": "BTC",
"quote_asset": "USD",
"qty": "100",
"price": "67500.00",
"qty_unit": "quote",
"type": "market",
"side": "buy",
"chain": "solana"
}'Order created successfully
The current status of the order.
- initialized — Order has been created but not yet submitted. For DeFi orders, the client must sign the returned payloads and call the execute endpoint. For CeFi buy orders with insufficient balance, a funding bridge is prepared first.
- pending — Order has been submitted but is not yet confirmed by the CeFi exchange or on-chain.
- active — Order was accepted by the CeFi exchange and is open for trading. Applies to limit orders that are working in the order book.
- cancel_pending — A cancellation request has been sent to the CeFi exchange and is awaiting confirmation.
- complete — Order has been fully executed. For CeFi orders this means the CeFi exchange reported a fill; for DeFi orders the on-chain swap was confirmed.
- canceled — Order was successfully canceled via a cancel request or by exchange/market conditions.
- failed — Order was rejected by the CeFi exchange or DeFi execution failed (e.g. on-chain transaction reverted, balance check failed).
Unsigned transaction payloads that the client must sign and return via the execute endpoint. Present for DeFi orders and CeFi buy orders that require a funding bridge. Empty or absent when the order is submitted immediately (e.g. CeFi sell orders).
{ "order_id": "string", "status": "complete", "payloads": [ { … } ], "quote": { "base_asset": "string", "quote_asset": "string", "qty": "string", "qty_out": "string", "fee": "string", "fee_asset": "string", "issues": [ … ] }, "web_authn_payload": "string" }
- Mock server
https://docs.truemarkets.co/_mock/apis/gateway/v1/orders
- Production
https://api.truemarkets.co/v1/conductor/orders
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.truemarkets.co/_mock/apis/gateway/v1/orders?limit=50&cursor=2019-08-24T14%3A15%3A22Z&status=pending%2Ccanceled' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "data": [ { … } ], "pagination": { "next_cursor": "2019-08-24T14:15:22Z", "limit": 0 } }
Signed stamps for the unsigned payloads, in the same order as the payloads returned by the create endpoint. Each signature corresponds to one payload.
- Mock server
https://docs.truemarkets.co/_mock/apis/gateway/v1/orders/{id}/execute
- Production
https://api.truemarkets.co/v1/conductor/orders/{id}/execute
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.truemarkets.co/_mock/apis/gateway/v1/orders/{id}/execute' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"signatures": [
"string"
],
"auth_type": "api_key"
}'Order execution initiated
The current status of the order.
- initialized — Order has been created but not yet submitted. For DeFi orders, the client must sign the returned payloads and call the execute endpoint. For CeFi buy orders with insufficient balance, a funding bridge is prepared first.
- pending — Order has been submitted but is not yet confirmed by the CeFi exchange or on-chain.
- active — Order was accepted by the CeFi exchange and is open for trading. Applies to limit orders that are working in the order book.
- cancel_pending — A cancellation request has been sent to the CeFi exchange and is awaiting confirmation.
- complete — Order has been fully executed. For CeFi orders this means the CeFi exchange reported a fill; for DeFi orders the on-chain swap was confirmed.
- canceled — Order was successfully canceled via a cancel request or by exchange/market conditions.
- failed — Order was rejected by the CeFi exchange or DeFi execution failed (e.g. on-chain transaction reverted, balance check failed).
{ "status": "complete" }
Request
Submits a cancellation request for a pending limit order on CeFi.
Cancellation is asynchronous — the order moves to cancel_pending immediately, then the order syncer reconciles the final state:
cancelledif the CeFi exchange confirms the cancellationcompleteif the order filled before the cancel landed (race condition)
Only CeFi limit orders in pending or active status are cancellable. DeFi orders and market orders return 400.
- Mock server
https://docs.truemarkets.co/_mock/apis/gateway/v1/orders/{id}
- Production
https://api.truemarkets.co/v1/conductor/orders/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://docs.truemarkets.co/_mock/apis/gateway/v1/orders/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'- Mock server
https://docs.truemarkets.co/_mock/apis/gateway/v1/orders/{id}/status
- Production
https://api.truemarkets.co/v1/conductor/orders/{id}/status
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.truemarkets.co/_mock/apis/gateway/v1/orders/{id}/status' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Order status retrieved
The current status of the order.
- initialized — Order has been created but not yet submitted. For DeFi orders, the client must sign the returned payloads and call the execute endpoint. For CeFi buy orders with insufficient balance, a funding bridge is prepared first.
- pending — Order has been submitted but is not yet confirmed by the CeFi exchange or on-chain.
- active — Order was accepted by the CeFi exchange and is open for trading. Applies to limit orders that are working in the order book.
- cancel_pending — A cancellation request has been sent to the CeFi exchange and is awaiting confirmation.
- complete — Order has been fully executed. For CeFi orders this means the CeFi exchange reported a fill; for DeFi orders the on-chain swap was confirmed.
- canceled — Order was successfully canceled via a cancel request or by exchange/market conditions.
- failed — Order was rejected by the CeFi exchange or DeFi execution failed (e.g. on-chain transaction reverted, balance check failed).
{ "status": "complete" }
- Mock server
https://docs.truemarkets.co/_mock/apis/gateway/v1/balances/unified
- Production
https://api.truemarkets.co/v1/conductor/balances/unified
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.truemarkets.co/_mock/apis/gateway/v1/balances/unified \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "data": [ { … } ] }