Trade Quotes
Endpoint Overview
Method | Endpoint | Description |
---|---|---|
POST | /v1/trade/requestquote |
Submits and processes a trade quote request. |
POST | /v1/trade/requestadvancedquote |
Submits and processes an advanced trade quote request. |
AIO Exchange provides two trade quote endpoints Basic and Advanced each offering different levels of fee calculation and exchange routing logic.
Important: You must be SUBSCRIBED to the market pair before requesting a quote. Check or add subscriptions via:
GET /v1/subscriptions
View active subscriptionsPOST /v1/subscriptions/tracksymbol
Activate symbol tracking
Basic Quote
POST /v1/trade/requestquote
Purpose: Fetches a simple quote from either a single exchange or aggregated sources, without detailed deposit or withdrawal fee calculations.
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
ortargetAmount
.
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
POST /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
ortargetAmount
.
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. |
Usage Notes
- Subscription Check: You must have SUBSCRIBED to the pair (via
/v1/subscriptions
and/v1/subscriptions/tracksymbol
) or you�ll get an error. - Flexible Amount Input: Only one of
baseAmount
ortargetAmount
should be set; the other is derived. - Order Types:
- MARKET: Fills at best market price.
- LIMIT: Includes
limitPrice
. - STOP: Includes
stopPrice
. - Fee Considerations:
- Basic quotes omit deposit/withdraw fees.
- Advanced quotes fully calculate deposit, withdrawal, and trading fees for a more accurate total cost.