For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/gateway/compute-quote.md.

Compute market quote

POST
/quotes

Non-binding price preview for a market order. base_asset and quote_asset quote a CeFi pair. asset_id quotes any listing for the caller, and needs a bearer token.

Rate limit: counts against the Quotes limit, 120 a minute (user token, per user); 1,200 a minute (organization api key, per organization); 120 a minute (no token, per ip address). See Rate limits.

Request Body

application/json
  1. body

Request to compute a market quote. Provide asset_id for a listing, or base_asset and quote_asset for a CeFi pair.

base_asset?string

Base asset identifier (e.g. BTC, ETH, SOL)

quote_asset?string

Quote asset identifier (e.g. USD, USDC)

asset_id?string

A listing's id from GET /assets. Requires a bearer token.

leverage?integer

Leverage for a perp listing's asset_id; required there and accepted nowhere else.

Range1 <= value
qty*string

Quantity as a positive decimal string

qty_unit*string

Unit of the quantity.

  • base — Quantity is denominated in the base asset (e.g. 0.5 BTC).
  • quote — Quantity is denominated in the quote asset (e.g. 1000 USD).
Value in"base""quote"
side*OrderSide

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.
Value in"buy""sell"

Response Body

Quote computed successfully

application/json
  1. response

Quote computation result with the expected quantity, execution price, notional and fee

qty?string

Expected base asset quantity as a decimal string, for buys and sells and for both qty_unit values. With qty_unit=quote it is rounded down to the base increment. For a DeFi perp open, the position size.

price?string

Effective execution price per unit of base asset as a decimal string

notional?string

Expected quote asset amount the order executes, before fees, as a decimal string. With qty_unit=quote it can be slightly less than the requested amount after base increment rounding.

fee?string

The whole fee the order is quoted to pay, every venue fee included, in quote asset units as a decimal string. Added to the cost on a buy and deducted from the proceeds on a sell.

Example Request
curl -X POST 'https://api.truemarkets.co/v1/gateway/quotes' \  -H 'Content-Type: application/json' \  -d '{  "qty": "0.5",  "qty_unit": "quote",  "side": "buy"}'
Example Response
{  "qty": "0.00156",  "price": "64000",  "notional": "99.84",  "fee": "0.039936"}