Skip to content

Trade Quotes

OmniBit API provides two trade quote endpoints Basic and Advanced each offering different levels of fee calculation and exchange routing logic. Both endpoints draw on live order-book and AMM liquidity data to deliver real-time, precision quotes for the requested size.

Requires Market Pair Subscription

Before accessing orderbook data or trade quotes, you must subscribe to the market pair.
OmniBit uses real-time subscriptions to deliver fast, accurate quotation data.

See Subscriptions. Or if you just want to do a basic conversion See Convert.

Specifying Quote Amounts

You can request a quote by specifying either baseAmount or targetAmount.
The baseAmount refers to the first symbol in the trading pair.
The targetAmount refers to the second symbol in the trading pair.

For example, to sell BTC/USDT:
Specify targetAmount: 5 if you want to receive exactly 5 USDT
Specify baseAmount: 0.1 if you want to sell exactly 0.1 BTC


Endpoint Overview

Method Endpoint Description
POST /v1/trade/requestquote Real-time quote based on live order-book and AMM liquidity.
POST /v1/trade/requestadvancedquote Real-time advanced quote factoring in exchange withdrawal fees and blockchain deposit routes.

Request Quote

Try itPlayground

/v1/trade/requestquote

Purpose: Calculates a quote in real time for a specified base or target amount using a single exchange or aggregated sources, analyzing each order book and exchange parameter to ensure maximum accuracy.

Request Body:

Name Type Mandatory Description
side string Yes "BUY" or "SELL".
orderType string No "MARKET", "LIMIT", or "STOP". Default: "MARKET".
baseAmount number Yes* Amount in base currency (provide either baseAmount or targetAmount).
targetAmount number Yes* Amount in target currency (provide either baseAmount or targetAmount).
baseSymbol string Yes* Symbol of base currency (e.g., "BTC"). Provide either symbols or token IDs.
targetSymbol string Yes* Symbol of target currency (e.g., "USDT"). Provide either symbols or token IDs.
baseTokenId number Yes* Token ID of base currency.
targetTokenId number Yes* Token ID of target currency.
sources string[] No List of exchanges (e.g., ["BINANCE"]). Default: ["ALL"].

Note: You must provide either symbols or token IDs, not both. Similarly, provide either baseAmount or targetAmount.

Example Request

{
  "side": "BUY",
  "orderType": "MARKET",
  "baseAmount": 10,
  "baseSymbol": "TRX",
  "targetSymbol": "USDT"
}

Example Response

{
  "data": {
    "side": "BUY",                    // "BUY" or "SELL"
    "orderType": "MARKET",            // "MARKET", "LIMIT", or "STOP"
    "status": "QUOTED",               // Quote status
    "baseAmount": 10,                 // Final base amount quoted
    "targetAmount": 2.41649,          // Final target amount calculated
    "rate": 0.241649,                 // Implied exchange rate
    "baseTokenSymbol": "TRX",         // Base currency symbol
    "targetTokenSymbol": "USDT",      // Target currency symbol
    "baseTokenId": 13829,             // Base currency ID
    "targetTokenId": 5898,            // Target currency ID
    "exchange": "OKX"                 // Exchange providing best price or "ALL"
  },
  "success": true,
  "timestamp": 1741499453037,
  "requestId": "daf671d5-265a-4184-bd48-cd28691614bd",
  "message": "",
  "error": null
}

Response Fields

Field Description
side "BUY" or "SELL".
orderType Order execution type ("MARKET", "LIMIT", or "STOP").
status Current status of the quote (e.g., "QUOTED", "EXPIRED").
baseAmount Final quoted amount in base currency.
targetAmount Final calculated amount in target currency.
rate Exchange rate (targetAmount / baseAmount).
baseTokenSymbol Symbol for base currency.
targetTokenSymbol Symbol for target currency.
baseTokenId ID for base currency.
targetTokenId ID for target currency.
exchange Exchange source or "ALL" if aggregated.

Note: Basic quotes do not include depositFee, withdrawalFee, or totalFee


Advanced Quote

Try itPlayground

/v1/trade/requestadvancedquote

Purpose: Provides a detailed quote, including comprehensive deposit, withdrawal, and trading fee calculations across multiple exchanges and blockchain networks.

Request Body:

Name Type Mandatory Description
side string Yes "BUY" or "SELL".
orderType string No "MARKET", "LIMIT", or "STOP". Default: "MARKET".
baseAmount number Yes* Amount in base currency (provide either baseAmount or targetAmount).
targetAmount number Yes* Amount in target currency (provide either baseAmount or targetAmount).
baseSymbol string Yes* Symbol of base currency (e.g., "BTC"). Provide either symbols or token IDs.
targetSymbol string Yes* Symbol of target currency (e.g., "USDT"). Provide either symbols or token IDs.
baseTokenId number Yes* Token ID of base currency.
targetTokenId number Yes* Token ID of target currency.
limitPrice number No Limit price for "LIMIT" orders (optional).
stopPrice number No Stop price for stop orders.
sources array No List of exchanges to use (default: ["ALL"]).

Note: Provide either symbols or IDs, and either baseAmount or targetAmount.

Example Request

{
  "side": "BUY",
  "orderType": "MARKET",
  "baseAmount": 10,
  "baseSymbol": "SOL",
  "targetSymbol": "USDT"
}

Example Response

{
  "data": {
    "side": "BUY",                     // "BUY" or "SELL"
    "orderType": "MARKET",             // "MARKET", "LIMIT", or "STOP"
    "baseAmount": 10,                  // Amount requested in base currency
    "targetAmount": 1426.487378,       // Calculated target currency amount
    "rate": 142.62,                    // Effective exchange rate
    "baseTokenSymbol": "SOL",          // Base currency symbol
    "targetTokenSymbol": "USDT",       // Target currency symbol
    "totalFee": 0.004138,              // Sum of depositFee and withdrawalFee
    "depositFee": 0.002138,            // Fee to deposit assets
    "withdrawalFee": 0.002,            // Fee for asset withdrawal
    "chain": "SPL-SPL",                // Blockchain used for routing
    "sources": ["BINANCE", "OKX"],     // Exchanges involved in quote
    "status": "QUOTED"                 // Current quote status
  },
  "success": true,
  "timestamp": 1741499453037,
  "requestId": "daf671d5-265a-4184-bd48-f223982fdeea",
  "message": "",
  "error": null
}

Advanced Quote Response Fields

Name Description
side "BUY" or "SELL".
orderType "MARKET", "LIMIT", or "STOP".
status "QUOTED", "EXPIRED", etc.
baseAmount Final base currency amount quoted.
targetAmount Final target currency amount calculated.
rate Effective exchange rate.
baseTokenSymbol Base currency symbol.
targetTokenSymbol Target currency symbol.
baseTokenId ID of the base currency.
targetTokenId ID of the target currency.
totalFee Total of deposit, withdrawal, and trading fees.
depositFee Fee charged for depositing assets.
withdrawalFee Withdrawal fee charged by exchanges.
chain Blockchain network utilized (e.g., "ERC20", "SPL-SPL").
sources Exchanges utilized for optimal pricing.