---
title: "Compute market quote"
url: https://docs.truemarkets.co/api/gateway/compute-quote
description: "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."
---

Docs index: https://docs.truemarkets.co/llms.txt

# Compute market quote

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](https://docs.truemarkets.co/developer-resources/rate-limits).

## Request

```
POST https://api.truemarkets.co/v1/gateway/quotes
```

### Body

`application/json`, required

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `base_asset` | string | no | Base asset identifier (e.g. `BTC`, `ETH`, `SOL`) |
| `quote_asset` | string | no | Quote asset identifier (e.g. `USD`, `USDC`) |
| `asset_id` | string | no | A listing's id from `GET /assets`. Requires a bearer token. |
| `leverage` | integer | no | Leverage for a perp listing's `asset_id`; required there and accepted nowhere else. |
| `qty` | string | yes | Quantity as a positive decimal string |
| `qty_unit` | string, one of `base`, `quote` | yes | 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). |
| `side` | string, one of `buy`, `sell` | yes | 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. |

## Responses

Every error status returns the same body, described in [Errors](https://docs.truemarkets.co/developer-resources/errors.md).

### 200

Quote computed successfully

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `qty` | string | no | 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 | no | Effective execution price per unit of base asset as a decimal string |
| `notional` | string | no | 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 | no | 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. |

### 400

Bad request

### 422

Request is well-formed but cannot be processed (e.g. leverage missing or out of range for a perp order)

### 500

Internal server error

### 503

Service unavailable
