Introduction

API Key Setup

  • Some endpoints will require an API Key. Please register here to obtain an API key.
  • The API key is viewable in the Profile -> API section.
  • Never share your API key/secret key to ANYONE.
  • The API is designed to be compatible with the Binance API. If you have client code to use the Binance API, then most features will work on this API without modification other than the base endpoint and API keys.

API Key Restrictions

  • After creating the API key, the default restrictions is Enable Reading.
  • To enable withdrawals via API, the KYC process has to be completed, and the API key restriction needs to be modified by the admin.

Contact Us

  • Customer Support
    • For any questions in sudden drop in performance with the API and/or Websockets.
    • For any questions on your code implementation with the API and/or Websockets.
    • For any general questions about the API not covered in the documentation.
    • For cases such as missing funds, help with 2FA, etc.

General Info

General API Information

  • The base endpoint is: https://quote.trade/api
  • All http POST and PUT endpoints expects a minified JSON. ({} if there is no data to send.)
  • For GET endpoints, parameters must be sent in the query string.
  • For POST and PUT endpoints, the parameters must be sent as the request body with content type application/json.
  • All http endpoints return either a minified JSON object or a minified JSON array.

HTTP Return Codes

  • HTTP 200 return code is used for success or business reject responses.
  • HTTP 4XX return codes are used for malformed requests; the issue is on the sender's side.
  • HTTP 403 return code is used when the WAF Limit (Web Application Firewall) has been violated.
  • HTTP 409 return code is used when a cancelReplace order partially succeeds. (e.g. if the cancellation of the order fails but the new order placement succeeds.)
  • HTTP 429 return code is used when breaking a request rate limit.
  • HTTP 418 return code is used when an IP has been auto-banned for continuing to send requests after receiving 429 codes.
  • HTTP 5XX return codes are used for internal errors; the issue is on quote.trade's side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.

Error Codes and Messages

  • If there is an error, the API will return an error with a message of the reason.

The error payload on API is as follows:

{
  "error":"Invalid symbol."
}

LIMITS

IP Limits

  • Each route has a weight which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavier weight.
  • When a 429 is received, it's your obligation as an API to back off and not spam the API.
  • Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).
  • IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
  • A Retry-After header is sent with a 418 or 429 responses and will give the number of seconds required to wait, in the case of a 429, to prevent a ban, or, in the case of a 418, until the ban is over.
  • The limits on the API are based on the IPs, not the API keys.

Websocket Limits

  • WebSocket connections have a limit of 5 incoming messages per second. A message is considered:
    • A PING frame
    • A PONG frame
    • A JSON controlled message (e.g. subscribe, unsubscribe)
  • A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.
  • A single connection can listen to a maximum of 1024 streams.

API Limit Introduction

The /api/* endpoints adopt either of two access limiting rules, IP limits or UID (account) limits.

  • Endpoints related to /api/*:

    • According to the two modes of IP and UID (account) limit, each are independent.
    • Endpoints share the 1200 per minute limit based on IP.

Data Sources

  • The API system is asynchronous, so some delay in the response is normal and expected.
  • Each endpoint has a data source indicating where the data is being retrieved, and thus which endpoints have the most up-to-date response.

These are the three sources, ordered by which is has the most up-to-date response to the one with potential delays in updates.

  • Matching Engine - the data is from the matching Engine
  • Memory - the data is from a server's local or external memory
  • Database - the data is taken directly from a database

Endpoint security type

  • Each endpoint has a security type that determines how you will interact with it. This is stated next to the NAME of the endpoint.
    • If no security type is stated, assume the security type is NONE.
  • API-keys are passed into the Rest API via the X-MBX-APIKEY header.
  • API-keys and secret-keys are case sensitive.
  • By default, API-keys can access all secure routes.
Security Type Description
NONE Endpoint can be accessed freely.
TRADE Endpoint requires sending a valid API-Key and signature.
USER_DATA Endpoint requires sending a valid API-Key and signature.
USER_STREAM Endpoint requires sending a valid API-Key.
MARKET_DATA Endpoint requires sending a valid API-Key.
  • TRADE, and USER_DATA endpoints are SIGNED endpoints.

SIGNED (TRADE, AND USER_DATA ) Endpoint security

  • SIGNED endpoints require an additional parameter, signature, to be sent in the http headers.
  • Endpoints use HMAC SHA256 signatures. The HMAC SHA256 signature is a keyed HMAC SHA256 operation. Use your secretKey as the key and request body as the value for the HMAC operation.
  • The signature is not case sensitive.

SIGNED Endpoint Examples for POST /api/v2/order

Here is a step-by-step example of how to send a valid signed payload from the Linux command line using echo, openssl, and curl.

Key Value
apiKey vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
Parameter Value
symbol LTC/BTC
side BUY
type LIMIT
timeInForce GTC
quantity 1
price 0.1
timestamp 1499827319559

Example : As a request body

Example

HMAC SHA256 signature:

    $ echo -n "{"symbol":"LTC/BTC","side":"BUY","type":"LIMIT","timeInForce":"GTC","quantity":1,"price":0.1,"timestamp":1499827319559}" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
    (stdin)= 57e52eb7945cdfa8938e607fa3e3c498dc531b0639e62c276d6f92e31f3095a1

curl command:

    (HMAC SHA256)
    $ curl -H 'X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A' -H 'signature: 57e52eb7945cdfa8938e607fa3e3c498dc531b0639e62c276d6f92e31f3095a1' -H 'Content-Type: application/json' -X POST 'https://quote.trade/api/v2/order' -d '{"symbol":"LTC/BTC","side":"BUY","type":"LIMIT","timeInForce":"GTC","quantity":1,"price":0.1,"timestamp":1499827319559}'

  • requestBody:

{ "symbol":"LTC/BTC", "side":"BUY", "type":"LIMIT", "timeInForce":"GTC", "quantity":1, "price":0.1, "timestamp":1499827319559 }


Public API Definitions

Terminology

These terms will be used throughout the documentation, so it is recommended especially for new users to read to help their understanding of the API.

  • base asset refers to the asset that is the quantity of a symbol. For the symbol BTC/USDC, BTC would be the base asset.
  • quote asset refers to the asset that is the price of a symbol. For the symbol BTC/USDC, USDC would be the quote asset.

ENUM definitions

Symbol status (status):

  • PRE_TRADING
  • TRADING
  • POST_TRADING
  • END_OF_DAY
  • HALT
  • AUCTION_MATCH
  • BREAK

Account and Symbol Permissions (permissions):

  • SPOT
  • MARGIN
  • LEVERAGED
  • TRD_GRP_002
  • TRD_GRP_003
  • TRD_GRP_004
  • TRD_GRP_005

Order status (status):

Status Description
NEW The order has been accepted by the engine.
PARTIALLY_FILLED A part of the order has been filled.
FILLED The order has been completed.
CANCELED The order has been canceled by the user.
PENDING_CANCEL Currently unused
REJECTED The order was not accepted by the engine and not processed.
EXPIRED The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance)

OCO Status (listStatusType):

Status Description
RESPONSE This is used when the ListStatus is responding to a failed action. (E.g. Orderlist placement or cancellation)
EXEC_STARTED The order list has been placed or there is an update to the order list status.
ALL_DONE The order list has finished executing and thus no longer active.

OCO Order Status (listOrderStatus):

Status Description
EXECUTING Either an order list has been placed or there is an update to the status of the list.
ALL_DONE An order list has completed execution and thus no longer active.
REJECT The List Status is responding to a failed action either during order placement or order canceled.)

Order types (orderTypes, type):

  • LIMIT
  • MARKET
  • STOP_LOSS
  • STOP_LOSS_LIMIT
  • TAKE_PROFIT
  • TAKE_PROFIT_LIMIT
  • LIMIT_MAKER

Order Response Type (newOrderRespType):

  • ACK
  • RESULT
  • FULL

Order side (side):

  • BUY
  • SELL

Time in force (timeInForce):

This sets how long an order will be active before expiration.

Status Description
GTC Good Til Canceled
An order will be on the book unless the order is canceled.
IOC Immediate Or Cancel
An order will try to fill the order as much as it can before the order expires.
FOK Fill or Kill
An order will expire if the full order cannot be filled upon execution.

Kline/Candlestick chart intervals:

s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

  • 1s
  • 1m
  • 3m
  • 5m
  • 15m
  • 30m
  • 1h
  • 2h
  • 4h
  • 6h
  • 8h
  • 12h
  • 1d
  • 3d
  • 1w
  • 1M

User Registration

Code:

const { Wallet, verifyMessage } = require("ethers"); // ethers.js version 6.13.5

const privateKey = "0x"; // Replace with your actual private key
const wallet = new Wallet(privateKey);

/**
  * Signs a message with the given private key.
  * @param {string} challenge - The challenge text received from the server.
  * @returns {Promise} - The signed message.
  */
async function signMessage(challenge) {
  const signature = await wallet.signMessage(challenge);
  return signature;
}
              

Request Data:

{
    "signature": "{ecrecover signature generated in step 2}",
    "challenge": "{CHALLENGE TEXT received in step 1}"
}
        

Response Data:

{
    "requestToken": "{REQUEST_TOKEN}",
    "requestSecret": "{REQUEST_SECRET}"
}
        

To register a user, follow these steps:

Pre-requisites

  • A valid Ethereum wallet address.
  • Access to the wallet's private key.

Steps

  1. Get the challenge text

    Send a HTTP POST request to the following API with the Ethereum wallet address:

    API URL: https://quote.trade/liquidityApi/getChallenge?channel=LIQUIDITY

    Request Data:

    { "login": "{ETHEREUM_WALLET_ADDRESS}" }

    Response: Extract the challenge text from the response:

    { "challenge": "{CHALLENGE_TEXT}" }
  2. Generate a ecrecover signature for the challenge text.

    Use the Ethereum wallet's private key to sign the challenge text received in step 1. The resulting signature will be used for the registration request.

    The following code demonstrates how to generate the ecrecover signature using the ethers.js library.

  3. Call the Register User API

    Send a HTTP POST request to the following API with the necessary data:

    API URL: https://quote.trade/liquidityApi/registerUser?channel=LIQUIDITY
    { "signature": "{ecrecover signature generated in step 2}", "challenge": "{CHALLENGE TEXT received in step 1}" }

    Response: Extract the requestToken and requestSecret from the API response:

    { "requestToken": "{REQUEST_TOKEN}", "requestSecret": "{REQUEST_SECRET}" }

Authentication

Code to generate signature:

const { Wallet, verifyMessage } = require("ethers"); // ethers.js version 6.13.5

const privateKey = "0x"; // Replace with your actual private key
const wallet = new Wallet(privateKey);

/**
  * Signs a message with the given private key.
  * @param {string} challenge - The challenge text received from the server.
  * @returns {Promise} - The signed message.
  */
async function signMessage(challenge) {
  const signature = await wallet.signMessage(challenge);
  return signature;
}
              

To authenticate a user, follow these steps:

Pre-requisites

  • Already registered Ethereum wallet address.
  • Access to the wallet's private key.

Steps

  1. Get the challenge text

    Send a HTTP POST request to the following API with the Ethereum wallet address:

    API URL: https://quote.trade/liquidityApi/getChallenge?channel=LIQUIDITY

    Request Data:

    { "login": "{ETHEREUM_WALLET_ADDRESS}" }

    Response: Extract the challenge text from the response:

    { "challenge": "{CHALLENGE_TEXT}" }
  2. Generate a ecrecover signature for the challenge text.

    Use the Ethereum wallet's private key to sign the challenge text received in step 1. The resulting signature will be used for the registration request.

    The following code demonstrates how to generate the ecrecover signature using the ethers.js library.

  3. Call the Register User API

    Send a HTTP POST request to the following API with the necessary data:

    API URL: https://quote.trade/liquidityApi/logon?channel=LIQUIDITY

    Request Data:

    { "signature": "{ecrecover signature generated in step 2}", "challenge": "{CHALLENGE TEXT received in step 1}" }

    Response: Extract the requestToken and requestSecret from the API response:

    { "requestToken": "{REQUEST_TOKEN}", "requestSecret": "{REQUEST_SECRET}" }

Market Data Endpoints

Exchange Information

Response:

      
        [
          {
            "exchangeFilters": [],
            "rateLimits": [
              {
                "interval": "MINUTE",
                "intervalNum": 1,
                "limit": 900,
                "rateLimitType": "ORDERS"
              }
            ],
            "serverTime": 1686824188823,
            "instruments": [],
            "instrumentPairs": [
              [
                53,
                "ETH/USD",
                1,
                2,
                2,
                6,
                1,
                "null",
                "PAIR",
                "ETH",
                "USDC",
                "USDC",
                "USDC",
                "null",
                "null",
                2,
                0.009999999776482582,
                0.009999999776482582,
                0,
                0.01,
                0,
                -1,
                0,
                "",
                0,
                "M",
                "",
                0,
                "",
                "",
                "",
                -1,
                0,
                "",
                "SECONDARY"
              ]
            ]
          }
        ]
      
    

GET /api/v2/exchangeInfo

Current exchange trading rules and symbol information

Parameters:

There are 3 possible options:

Options Example
No parameter curl -X GET "https://quote.trade/api/v2/exchangeInfo"
verbose curl -X GET "https://quote.trade/api/v2/exchangeInfo?verbose=true"
symbol curl -X GET "https://quote.trade/api/v2/exchangeInfo?symbol=CCC-USD"

Notes:

  • If the value provided to symbol or symbols do not exist, the endpoint will return an empty response.
  • Verbose option verbose=true returns a JSON with keys and values.
  • Verbose option verbose=false returns a JSON with only values (same order as in verbose=true response) in a array.
  • All parameters are optional.

Data Source: Memory

Order Book

Response:

{
  "lastUpdateId": 1027024,
  "bids": [
    [
      "4.00000000",     // PRICE
      "431.00000000"    // QTY
    ]
  ],
  "asks": [
    [
      "4.00000200",
      "12.00000000"
    ]
  ]
}

GET /api/v2/depth

Parameters:

Name Type Mandatory Description
symbol STRING YES e.g. ETH-USD
limit INT NO Default 100; max 5000.
If limit > 5000, then the response will truncate to 5000.

Data Source: Memory

Recent Trades List

Response:

[
  {
    "id": 28457,
    "price": "4.00000100",
    "qty": "12.00000000",
    "quoteQty": "48.000012",
    "time": 1499865549590,
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

GET /api/v2/trades

Get recent trades.

Parameters:

Name Type Mandatory Description
symbol STRING YES e.g. ETH-USD
limit INT NO Default 500; max 1000.

Data Source: Memory

Instrument

Instrument Pairs

GET /api/getInstrumentPairs

Example:

curl -X "GET" "https://quote.trade/api/getInstrumentPairs"

Response:

{
  "instrumentPairs": [
    {
      "id": 1,
      "symbol": "BTC",
      "name": "Bitcoin",
      "quantityScale": 6,
      "address": "",
      "url": "https://coinmarketcap.com/currencies/bitcoin"
    },
    {
      "id": 2,
      "symbol": "ETH",
      "name": "Ethereum",
      "quantityScale": 6,
      "address": "",
      "url": "https://coinmarketcap.com/currencies/ethereum"
    }
  ]
}

Parameters:

Name Type Mandatory Description
limit INT NO Default 100; max 5000.
If limit > 5000, then the response will truncate to 5000.

Data Source: Memory

Deposit / Withdraw

Deposit

GET /api/getDepositAddress

Example:

curl -X "GET" "https://quote.trade/api/getDepositAddress"

Response:

{
  "chain": "polygon_amoy",
  "address": "0x3fC499C3a6F0e75E4D854F3B111f6583fB5Af554"
}

Ethereum Mainnet: 0xdac17f958d2ee523a2206206994597c13d831ec7 (USDT_CONTRACT_ADDRESS)

JavaScript Code:

import { ethers } from "ethers"; // (ethers.js version 6.13.5)

// ✅ Configuration: Replace with your actual values
const PRIVATE_KEY = "your_private_key_here";  // ⚠️ Keep this secret!
const DEPOSIT_ADDRESS = "0xDEPOSIT_ADDRESS"; // Replace with the actual recipient
const USDT_CONTRACT_ADDRESS = "0xdac17f958d2ee523a2206206994597c13d831ec7"; // USDT on Ethereum
const RPC_URL = "https://mainnet.infura.io/v3/YOUR_INFURA_API_KEY"; // Replace with your Infura/Alchemy RPC

// ✅ USDT ERC-20 ABI (Minimal for transfer function)
const USDT_ABI = [
  "function transfer(address to, uint256 amount) public returns (bool)"
];

// ✅ Initialize ethers.js Provider & Wallet
const provider = new ethers.JsonRpcProvider(RPC_URL);
const wallet = new ethers.Wallet(PRIVATE_KEY, provider);

// ✅ Connect to USDT Smart Contract
const usdtContract = new ethers.Contract(USDT_CONTRACT_ADDRESS, USDT_ABI, wallet);

async function sendUSDT() {
    try {
        console.log(`🔹 Sending USDT from ${wallet.address} to ${DEPOSIT_ADDRESS}...`);

        // ✅ Convert USDT amount (5 USDT = 5 * 10^6 because USDT has 6 decimals)
        const amount = ethers.parseUnits("5", 6);

        // ✅ Call transfer function
        const tx = await usdtContract.transfer(DEPOSIT_ADDRESS, amount);

        console.log("📨 Transaction sent! Hash:", tx.hash);

        // ✅ Wait for transaction confirmation
        await tx.wait();
        console.log("✅ Transaction Confirmed:", tx.hash);

    } catch (error) {
        console.error("❌ Error Sending USDT:", error);
    }
}

// ✅ Execute the function
sendUSDT();

               
              

Withdraw

Contract Name: PaymentForwarder

Polygon Mainnet: 0xdac17f958d2ee523a2206206994597c13d831ec7 (CONTRACT_ADDRESS)

Polygonscan

JavaScript Code:

import { ethers } from "ethers";

// ✅ Configuration (Replace with actual values)
const PRIVATE_KEY = "your_private_key_here"; // ⚠️ Keep this secret!
const PAYMENT_CONTRACT_ADDRESS = "0xPAYMENT_CONTRACT_ADDRESS"; // Replace with deployed contract
const POLYGON_RPC_URL = "https://polygon-rpc.com"; // Public RPC for Polygon Mainnet

// ✅ ABI for the withdraw function
const CONTRACT_ABI = [
  {
    "inputs": [
      { "internalType": "string", "name": "assetSymbol", "type": "string" },
      { "internalType": "int64", "name": "amount", "type": "int64" }
    ],
    "name": "withdraw",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  }
];

// ✅ Initialize ethers.js Provider & Wallet
const provider = new ethers.JsonRpcProvider(POLYGON_RPC_URL);
const wallet = new ethers.Wallet(PRIVATE_KEY, provider);

// ✅ Connect to the deployed smart contract
const contract = new ethers.Contract(PAYMENT_CONTRACT_ADDRESS, CONTRACT_ABI, wallet);

async function withdrawAsset(assetSymbol, amount) {
    try {
        console.log(`🔹 Initiating Withdrawal: ${amount} ${assetSymbol}...`);

        // ✅ Convert amount to required format (assuming it's in smallest units)
        const parsedAmount = BigInt(amount); // Polygon supports BigInt for large numbers

        // ✅ Call withdraw function from the contract
        const tx = await contract.withdraw(assetSymbol, parsedAmount);

        console.log("📨 Transaction Sent! Hash:", tx.hash);

        // ✅ Wait for transaction confirmation
        await tx.wait();
        console.log("✅ Transaction Confirmed:", tx.hash);

    } catch (error) {
        console.error("❌ Error Withdrawing Asset:", error);
    }
}

// ✅ Execute withdrawal (Example: Withdraw 50 USDT)
withdrawAsset("USDT", 50000000); // 50 USDT (assuming 6 decimals)
              

Order (BUY/ SELL)

POST /api/order

BUY/ SELL

Parameters:

Name Type Mandatory Description
accountINTYESUser ID
disableLeverageINTNOTo enable 5x leverage and shorting, set the disableLeverage parameter to 0. Otherwise, set it to 1. The default value is 0.
liquidityOrderINTYESSet the default value to 1
paymentCurrencySTRINGYESPayment Currency
priceLONGYESPrice
quantityLONGYESQuantity
sideSTRINGYESIf you want to place a buy order, set side=BUY. If you want to place a sell order, set side=SELL.
symbolSTRINGYESEg: "BTC"
timestampLONGYESTimestamp
typeSTRINGYESSet the value to "LIMIT"

Example:

api_key=<your_api_key>
secret_key=<your_secret_key>
api_url=https://quote.trade/api/v2/order
request_body="{"liquidityOrder":1,"account":222,"symbol":"BTC","side":"BUY","type":"LIMIT","price":89091.5,"quantity":0.001,"disableLeverage":0,"paymentCurrency":"USDT","timestamp":1741765600791,"channel":"LIQUIDITY"}"

signature=`echo -n $request_body | openssl dgst -sha256 -hmac $secret_key`

$ curl -X POST '$api_url' -d '$request_body' \
          -H 'X-MBX-APIKEY: $api_key' \
          -H 'signature: $signature' \
          -H "Content-Type: application/json"

Response:

{
  "accountId": 222,
  "symbol": "LIQUIDITY/USD",
  "clientOrderId": "1741765601003502842",
  "cumQuote": "0",
  "executedQty": "0",
  "orderId": 0,
  "origQty": "10",
  "price": "89091.5",
  "reduceOnly": "false",
  "side": "BUY",
  "status": "NEW",
  "stopPrice": "0",
  "timeInForce": "GOOD_TILL_CANCEL",
  "type": "LIMIT",
  "targetStrategy": "0",
  "updateTime": 1741765601026,
  "assetId": 0,
  "tokenId": 0,
  "groupAssetId": 0,
  "selectId": 0
}

Data Source: Memory

Staking Endpoints

POST /api/order

STAKE/ UN-STAKE

Parameters:

Name Type Mandatory Description
accountINTYESUser ID
liquidityOrderINTYESSet the default value to 1
quantityLONGYESQuantity
sideSTRINGYESIf you want to STAKE, set side=BUY. If you want to UN-STAKE, set side=SELL.
symbolSTRINGYESEg: "USDC"
stakeINTYESSet the value to 1
stakeOptionINTYES If you want to STAKE, set option value. If you want to UN-STAKE, set stakeOption=0.

Stake Options:
1 = 24 Hour Lockup (Current Rate is 5%)
2 = 06 Month Lockup (Up to 20% APR MIN rate is 5% Guaranteed)
3 = 12 Month Lockup (Up to 30% APR MIN rate is 5.5% Guaranteed)
4 = 18 Month Lockup (Up to 40% APR MIN rate is 6% Guaranteed)

timestampLONGYESTimestamp
typeSTRINGYESSet the value to "LIMIT"

Example (STAKE):

api_key=<your_api_key>
secret_key=<your_secret_key>
api_url=https://quote.trade/api/v2/order
request_body="{"liquidityOrder":1,"account":222,"symbol":"USDC","side":"BUY","type":"LIMIT","quantity":1,"timestamp":1741775818854,"stake":1,"stakeOption":"2","channel":"LIQUIDITY"}"

signature=`echo -n $request_body | openssl dgst -sha256 -hmac $secret_key`

$ curl -X POST '$api_url' -d '$request_body' \
          -H 'X-MBX-APIKEY: $api_key' \
          -H 'signature: $signature' \
          -H "Content-Type: application/json"

Response (STAKE):

{
  "accountId": 222,
  "symbol": "LIQUIDITY/USD",
  "clientOrderId": "1741775818978810374",
  "cumQuote": "0",
  "executedQty": "0",
  "orderId": 0,
  "origQty": "10000",
  "price": "1.0",
  "reduceOnly": "false",
  "side": "BUY",
  "status": "NEW",
  "stopPrice": "0",
  "timeInForce": "GOOD_TILL_CANCEL",
  "type": "LIMIT",
  "targetStrategy": "191",
  "updateTime": 1741775818978,
  "assetId": 0,
  "tokenId": 0,
  "groupAssetId": 0,
  "selectId": 0
}

Example (UN-STAKE):

api_key=<your_api_key>
secret_key=<your_secret_key>
api_url=https://quote.trade/api/v2/order
request_body="{"liquidityOrder":1,"account":222,"symbol":"STAKE_USDC_6M","side":"SELL","type":"LIMIT","quantity":1,"timestamp":1741775955271,"stake":1,"stakeOption":0,"channel":"LIQUIDITY"}"

signature=`echo -n $request_body | openssl dgst -sha256 -hmac $secret_key`

$ curl -X POST '$api_url' -d '$request_body' \
          -H 'X-MBX-APIKEY: $api_key' \
          -H 'signature: $signature' \
          -H "Content-Type: application/json"

Response (UN-STAKE):

{
  "accountId": 222,
  "symbol": "LIQUIDITY/USD",
  "clientOrderId": "1741775956452628996",
  "cumQuote": "0",
  "executedQty": "0",
  "orderId": 0,
  "origQty": "10000",
  "price": "1.0",
  "reduceOnly": "false",
  "side": "SELL",
  "status": "NEW",
  "stopPrice": "0",
  "timeInForce": "GOOD_TILL_CANCEL",
  "type": "LIMIT",
  "targetStrategy": "191",
  "updateTime": 1741775956453,
  "assetId": 0,
  "tokenId": 0,
  "groupAssetId": 0,
  "selectId": 0
}

Data Source: Memory

Websocket Market Streams

  • The base endpoint is: wss://quote.trade
  • Streams can be accessed either in a single raw stream or in a combined stream
  • Raw streams are accessed at /ws/stream?/<streamName>
  • Combined streams are accessed at /stream?streams=<streamName1>/<streamName2>/<streamName3>
  • Combined stream events are wrapped as follows: {"stream":"<streamName>","data":<rawPayload>}
  • All symbols for streams are lowercase
  • A single connection to quote.trade is only valid for 24 hours; expect to be disconnected at the 24 hour mark
  • The websocket server will send a ping frame every 3 minutes. If the websocket server does not receive a pong frame back from the connection within a 10 minute period, the connection will be disconnected. Unsolicited pong frames are allowed.

Live Subscribing/Unsubscribing to streams

  • The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below.
  • The id used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth.
  • In the response, if the result received is null this means the request sent was a success.

Subscribe to a stream

Response

  {
    "result": null,
    "id": 1
  }
  • Request

    {
    "method": "SUBSCRIBE",
    "params":
    [
    "BTC-USD@aggTrade",
    "BTC-USD@depth"
    ],
    "id": 1
    }

Unsubscribe to a stream

Response

  {
    "result": null,
    "id": 312
  }
  • Request

{
"method": "UNSUBSCRIBE",
"params":
[
"BTC-USD@depth"
],
"id": 312
}

Listing Subscriptions

Response

  {
    "result": [
      "BTC-USD@aggTrade"
    ],
    "id": 3
  }
  • Request

{
"method": "LIST_SUBSCRIPTIONS",
"id": 3
}

Setting Properties

Currently, the only property can be set is to set whether combined stream payloads are enabled or not. The combined property is set to false when connecting using /ws/ ("raw streams") and true when connecting using /stream/.

Response

{
  "result": null,
  "id": 5
}
  • Request

{
"method": "SET_PROPERTY",
"params":
[
"combined",
true
],
"id": 5
}

Retrieving Properties

Response

  {
    "result": true, // Indicates that combined is set to true.
    "id": 2
  }
  • Request

{
"method": "GET_PROPERTY",
"params":
[
"combined"
],
"id": 2
}

Error Messages

Error Message Description
{"code": 0, "msg": "Unknown property", "id": '%s'} Parameter used in the SET_PROPERTY or GET_PROPERTY was invalid
{"code": 1, "msg": "Invalid value type: expected Boolean", "id": '%s'} Value should only be true or false
{"code": 2, "msg": "Invalid request: property name must be a string"} Property name provided was invalid
{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} Parameter id had to be provided or the value provided in the id parameter is an unsupported type
{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of SUBSCRIBE, UNSUBSCRIBE, LIST_SUBSCRIPTIONS, SET_PROPERTY, GET_PROPERTY at line 1 column 28"} Possible typo in the provided method or provided method was neither of the expected values
{"code": 2, "msg": "Invalid request: too many parameters"} Unnecessary parameters provided in the data
{"code": 2, "msg": "Invalid request: property name must be a string"} Property name was not provided
{"code": 2, "msg": "Invalid request: missing field method at line 1 column 73"} method was not provided in the data
{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} JSON data sent has incorrect syntax.

Aggregate Trade Streams

Payload:

{
  "e": "aggTrade",  // Event type
  "E": 123456789,   // Event time
  "s": "CCC/USD",    // Symbol
  "a": 12345,       // Aggregate trade ID
  "p": "0.001",     // Price
  "q": "100",       // Quantity
  "f": 100,         // First trade ID
  "l": 105,         // Last trade ID
  "T": 123456785,   // Trade time
  "m": true,        // Is the buyer the market maker?
  "M": true         // Ignore
}

The Aggregate Trade Streams push trade information that is aggregated for a single taker order.

Stream Name: <symbol>@aggTrade

Update Speed: Real-time

Trade Streams

Payload:

{
  "e": "trade",     // Event type
  "E": 123456789,   // Event time
  "s": "CCC/USD",    // Symbol
  "t": 12345,       // Trade ID
  "p": "0.001",     // Price
  "q": "100",       // Quantity
  "b": 88,          // Buyer order ID
  "a": 50,          // Seller order ID
  "T": 123456785,   // Trade time
  "m": true,        // Is the buyer the market maker?
  "M": true         // Ignore
}

The Trade Streams push raw trade information; each trade has a unique buyer and seller.

Stream Name: <symbol>@trade

Update Speed: Real-time

Kline/Candlestick Streams

Payload:

{
  "e": "kline",     // Event type
  "E": 123456789,   // Event time
  "s": "CCC/USD",    // Symbol
  "k": {
    "t": 123400000, // Kline start time
    "T": 123460000, // Kline close time
    "s": "CCC/USD",  // Symbol
    "i": "1m",      // Interval
    "f": 100,       // First trade ID
    "L": 200,       // Last trade ID
    "o": "0.0010",  // Open price
    "c": "0.0020",  // Close price
    "h": "0.0025",  // High price
    "l": "0.0015",  // Low price
    "v": "1000",    // Base asset volume
    "n": 100,       // Number of trades
    "x": false,     // Is this kline closed?
    "q": "1.0000",  // Quote asset volume
    "V": "500",     // Taker buy base asset volume
    "Q": "0.500",   // Taker buy quote asset volume
    "B": "123456"   // Ignore
  }
}

The Kline/Candlestick Stream push updates to the current klines/candlestick every second.

Stream Name: <symbol>@kline_<interval>

Update Speed: 2000ms

Kline/Candlestick chart intervals:

s-> seconds; m -> minutes; h -> hours; d -> days; w -> weeks; M -> months

  • 1m
  • 5m
  • 15m
  • 1h
  • 1d
  • 1w

Individual Symbol Mini Ticker Stream

Payload:

  {
    "e": "24hrMiniTicker",  // Event type
    "E": 123456789,         // Event time
    "s": "CCC/USD",          // Symbol
    "c": "0.0025",          // Close price
    "o": "0.0010",          // Open price
    "h": "0.0025",          // High price
    "l": "0.0010",          // Low price
    "v": "10000",           // Total traded base asset volume
    "q": "18"               // Total traded quote asset volume
  }

24hr rolling window mini-ticker statistics. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.

Stream Name: <symbol>@miniTicker

Update Speed: 1000ms

All Market Mini Tickers Stream

Payload:

[
  {
    // Same as <symbol>@miniTicker payload
  }
]

24hr rolling window mini-ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array.

Stream Name: !miniTicker@arr

Update Speed: 1000ms

Individual Symbol Ticker Streams

Payload:

{
  "e": "24hrTicker",  // Event type
  "E": 123456789,     // Event time
  "s": "CCC/USD",      // Symbol
  "p": "0.0015",      // Price change
  "P": "250.00",      // Price change percent
  "w": "0.0018",      // Weighted average price
  "x": "0.0009",      // First trade(F)-1 price (first trade before the 24hr rolling window)
  "c": "0.0025",      // Last price
  "Q": "10",          // Last quantity
  "b": "0.0024",      // Best bid price
  "B": "10",          // Best bid quantity
  "a": "0.0026",      // Best ask price
  "A": "100",         // Best ask quantity
  "o": "0.0010",      // Open price
  "h": "0.0025",      // High price
  "l": "0.0010",      // Low price
  "v": "10000",       // Total traded base asset volume
  "q": "18",          // Total traded quote asset volume
  "O": 0,             // Statistics open time
  "C": 86400000,      // Statistics close time
  "F": 0,             // First trade ID
  "L": 18150,         // Last trade Id
  "n": 18151          // Total number of trades
}

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.

Stream Name: <symbol>@ticker

Update Speed: 1000ms

All Market Tickers Stream

Payload:

[
  {
    // Same as <symbol>@ticker payload
  }
]

24hr rolling window ticker statistics for all symbols that changed in an array. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. Note that only tickers that have changed will be present in the array.

Stream Name: !ticker@arr

Update Speed: 1000ms

Individual Symbol Rolling Window Statistics Streams

Payload:

{
  "e": "1hTicker",    // Event type
  "E": 123456789,     // Event time
  "s": "CCC/USD",      // Symbol
  "p": "0.0015",      // Price change
  "P": "250.00",      // Price change percent
  "o": "0.0010",      // Open price
  "h": "0.0025",      // High price
  "l": "0.0010",      // Low price
  "c": "0.0025",      // Last price
  "w": "0.0018",      // Weighted average price
  "v": "10000",       // Total traded base asset volume
  "q": "18",          // Total traded quote asset volume
  "O": 0,             // Statistics open time
  "C": 86400000,      // Statistics close time
  "F": 0,             // First trade ID
  "L": 18150,         // Last trade Id
  "n": 18151          // Total number of trades
}

Rolling window ticker statistics for a single symbol, computed over multiple windows.

Stream Name: <symbol>@ticker_<window_size>

Window Sizes: 1h,4h,1d

Update Speed: 1000ms

Note: This stream is different from the <symbol>@ticker stream. The open time O always starts on a minute, while the closing time C is the current time of the update.

As such, the effective window might be up to 59999ms wider that <window_size>.

All Market Rolling Window Statistics Streams

Payload:

[
  {
    // Same as <symbol>@ticker_<window-size> payload,
    // one for each symbol updated within the interval.
  }
]

Rolling window ticker statistics for all market symbols, computed over multiple windows. Note that only tickers that have changed will be present in the array.

Stream Name: !ticker_<window-size>@arr

Window Size: 1h,4h,1d

Update Speed: 1000ms

Individual Symbol Book Ticker Streams

Payload:

{
  "u":400900217,     // order book updateId
  "s":"BNBUSDT",     // symbol
  "b":"25.35190000", // best bid price
  "B":"31.21000000", // best bid qty
  "a":"25.36520000", // best ask price
  "A":"40.66000000"  // best ask qty
}

Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol.

Multiple <symbol>@bookTicker streams can be subscribed to over one connection.

Stream Name: <symbol>@bookTicker

Update Speed: Real-time

All Book Tickers Stream

Payload:

{
  // Same as <symbol>@bookTicker payload
}

Pushes any update to the best bid or ask's price or quantity in real-time for all symbols.

Stream Name: !bookTicker

Update Speed: Real-time

Partial Book Depth Streams

Payload:

{
  "lastUpdateId": 160,  // Last update ID
  "bids": [             // Bids to be updated
    [
      "0.0024",         // Price level to be updated
      "10"              // Quantity
    ]
  ],
  "asks": [             // Asks to be updated
    [
      "0.0026",         // Price level to be updated
      "100"             // Quantity
    ]
  ]
}

Top bids and asks, Valid are 5, 10, or 20.

Stream Names: <symbol>@depth<levels> OR <symbol>@depth<levels>@100ms.

Update Speed: 1000ms or 100ms

Diff. Depth Stream

Payload:

{
  "e": "depthUpdate", // Event type
  "E": 123456789,     // Event time
  "s": "CCC/USD",      // Symbol
  "U": 157,           // First update ID in event
  "u": 160,           // Final update ID in event
  "b": [              // Bids to be updated
    [
      "0.0024",       // Price level to be updated
      "10"            // Quantity
    ]
  ],
  "a": [              // Asks to be updated
    [
      "0.0026",       // Price level to be updated
      "100"           // Quantity
    ]
  ]
}

Stream Name: <symbol>@depth OR <symbol>@depth@100ms

Update Speed: 1000ms or 100ms

Order book price and quantity depth updates used to locally manage an order book.

How to manage a local order book correctly

  1. Open a stream to wss://quote.trade/ws/CCC-USD@depth.
  2. Buffer the events you receive from the stream.
  3. Get a depth snapshot from https://quote.trade/api/v2/depth?symbol=CCC-USD&limit=1000 .
  4. Drop any event where u is <= lastUpdateId in the snapshot.
  5. The first processed event should have U <= lastUpdateId+1 AND u >= lastUpdateId+1.
  6. While listening to the stream, each new event's U should be equal to the previous event's u+1.
  7. The data in each event is the absolute quantity for a price level.
  8. If the quantity is 0, remove the price level.
  9. Receiving an event that removes a price level that is not in your local order book can happen and is normal.

Note: Due to depth snapshots having a limit on the number of price levels, a price level outside of the initial snapshot that doesn't have a quantity change won't have an update in the Diff. Depth Stream. Consequently, those price levels will not be visible in the local order book even when applying all updates from the Diff. Depth Stream correctly and cause the local order book to have some slight differences with the real order book. However, for most use cases the depth limit of 5000 is enough to understand the market and trade effectively.

User Data Streams

  • The base API endpoint is: https://quote.trade
  • A User Data Stream listenKey is valid for 60 minutes after creation.
  • Doing a PUT on a listenKey will extend its validity for 60 minutes.
  • Doing a DELETE on a listenKey will close the stream and invalidate the listenKey.
  • Doing a POST on an account with an active listenKey will return the currently active listenKey and extend its validity for 60 minutes.
  • The base websocket endpoint is: wss://quote.trade
  • User Data Streams are accessed at /ws/listenKey/<listenKey> or /ws/stream?streams=<listenKey>
  • A single connection to wss://quote.trade/ws is only valid for 24 hours; expect to be disconnected at the 24 hour mark

LISTEN KEY (SPOT)

Create a ListenKey (USER_STREAM)

Response:


{
    "userId": 1,
    "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}
        
        

POST /api/v2/userDataStream

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.

Parameters:

NONE

Data Source: Memory

Ping/Keep-alive a ListenKey (USER_STREAM)

Response:


{
     "userId": 1,
    "listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}

PUT /api/v2/userDataStream

Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes.

>

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Data Source: Memory

Close a ListenKey (USER_STREAM)

Response:

{}

DELETE /api/v2/userDataStream

Close out a user data stream.

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Data Source: Memory

LISTEN KEY (MARGIN)

Create a ListenKey (USER_STREAM)

Response:

{"listenKey":  "T3ee22BIYuWqmvne0HNq2A2WsFlEtLhvWCtItw6ffhhdmjifQ2tRbuKkTHhr"}

POST /sapi/v1/userDataStream

Parameters:

NONE

Ping/Keep-alive a ListenKey (USER_STREAM)

Response:

{}

PUT /sapi/v1/userDataStream

Parameters:

Name Type Mandatory Description
listenKey STRING YES

Close a ListenKey (USER_STREAM)

Response:

{}

DELETE /sapi/v1/userDataStream

Parameters:

Name Type Mandatory Description
symbol STRING YES

Ping/Keep-alive a Listen Key (USER_STREAM)

Response:

{}

PUT /sapi/v1/userDataStream/isolated

Parameters:

Name Type Mandatory Description
symbol STRING YES
listenKey STRING YES

Close a ListenKey (USER_STREAM)

Response:

{}

DELETE /sapi/v1/userDataStream/isolated

Parameters:

Name Type Mandatory Description
symbol STRING YES
listenKey STRING YES

Payload: Account Update

outboundAccountPosition is sent any time an account balance has changed and contains the assets that were possibly changed by the event that generated the balance change.

Payload:

{
  "e": "outboundAccountPosition", //Event type
  "E": 1564034571105,             //Event Time
  "u": 1564034571073,             //Time of last account update
  "B": [                          //Balances Array
    {
      "a": "ETH",                 //Asset
      "f": "10000.000000",        //Free
      "l": "0.000000"             //Locked
    }
  ]
}

Payload: Balance Update

Balance Update occurs during the following:

  • Deposits or withdrawals from the account
  • Transfer of funds between accounts (e.g. Spot to Margin)

Payload

{
  "e": "balanceUpdate",         //Event Type
  "E": 1573200697110,           //Event Time
  "a": "BTC",                   //Asset
  "d": "100.00000000",          //Balance Delta
  "T": 1573200697068            //Clear Time
}

Payload: Order Update

Orders are updated with the executionReport event.

Check the Public API Definitions and below for relevant enum definitions.

Average price can be found by doing Z divided by z.

Payload:

{
  "e": "executionReport",        // Event type
  "E": 1499405658658,            // Event time
  "s": "ETH/BTC",                 // Symbol
  "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID
  "S": "BUY",                    // Side
  "o": "LIMIT",                  // Order type
  "f": "GTC",                    // Time in force
  "q": "1.00000000",             // Order quantity
  "p": "0.10264410",             // Order price
  "P": "0.00000000",             // Stop price
  "d": 4,                        // Trailing Delta; This is only visible if the order was a trailing stop order.
  "F": "0.00000000",             // Iceberg quantity
  "g": -1,                       // OrderListId
  "C": "",                       // Original client order ID; This is the ID of the order being canceled
  "x": "NEW",                    // Current execution type
  "X": "NEW",                    // Current order status
  "r": "NONE",                   // Order reject reason; will be an error code.
  "i": 4293153,                  // Order ID
  "l": "0.00000000",             // Last executed quantity
  "z": "0.00000000",             // Cumulative filled quantity
  "L": "0.00000000",             // Last executed price
  "n": "0",                      // Commission amount
  "N": null,                     // Commission asset
  "T": 1499405658657,            // Transaction time
  "t": -1,                       // Trade ID
  "I": 8641984,                  // Ignore
  "w": true,                     // Is the order on the book?
  "m": false,                    // Is this trade the maker side?
  "M": false,                    // Ignore
  "O": 1499405658657,            // Order creation time
  "Z": "0.00000000",             // Cumulative quote asset transacted quantity
  "Y": "0.00000000",             // Last quote asset transacted quantity (i.e. lastPrice * lastQty)
  "Q": "0.00000000",             // Quote Order Qty
  "j": 1,                        // Strategy ID; This is only visible if the strategyId parameter was provided upon order placement
  "J": 1000000                   // Strategy Type; This is only visible if the strategyType parameter was provided upon order placement
}

Execution types:

  • NEW - The order has been accepted into the engine.
  • CANCELED - The order has been canceled by the user.
  • REPLACED (currently unused)
  • REJECTED - The order has been rejected and was not processed (This message appears only with Cancel Replace Orders wherein the new order placement is rejected but the request to cancel request succeeds.)
  • TRADE - Part of the order or all of the order's quantity has filled.
  • EXPIRED - The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance)

Payload

{
  "e": "listStatus",                //Event Type
  "E": 1564035303637,               //Event Time
  "s": "ETH/BTC",                    //Symbol
  "g": 2,                           //OrderListId
  "c": "OCO",                       //Contingency Type
  "l": "EXEC_STARTED",              //List Status Type
  "L": "EXECUTING",                 //List Order Status
  "r": "NONE",                      //List Reject Reason
  "C": "F4QN4G8DlFATFlIUQ0cjdD",    //List Client Order ID
  "T": 1564035303625,               //Transaction Time
  "O": [                            //An array of objects
    {
      "s": "ETH/BTC",                //Symbol
      "i": 17,                      // orderId
      "c": "AJYsMjErWJesZvqlJCTUgL" //ClientOrderId
    },
    {
      "s": "ETH/BTC",
      "i": 18,
      "c": "bfYPSQdLoqAJeNrOr9adzq"
    }
  ]
}

Liquidity Price Feed

WebSocket Information

  • The base endpoint is: wss://quote.trade
  • Streams can be accessed either in a single raw stream or in a combined stream
  • Raw streams are accessed at /ws/liquidity
  • All symbols for streams are lowercase

Subscribe to a Stream

Request:

{
  "symbol": "BTC",
  "unsubscribe": 0
}

Response:

{
  "status": "subscribed"
}

Response:

{
  "s": "BTC",          // SYMBOL
  "bids": [
    {
      "p": 88913.4,    // PRICE
      "q": 160.69      // QTY
    },
    {
      "p": 88824.4,    // PRICE
      "q": 388.43      // QTY
    }
  ],
  "asks": [
    {
      "p": 89091.5,    // PRICE
      "q": 170.06      // QTY
    },
    {
      "p": 89180.5,    // PRICE
      "q": 473.8      // QTY
    },
    {
      "p": 89269.5,    // PRICE
      "q": 680.95      // QTY
    }
  ]
}

Unsubscribing to a Stream

Request:

{
  "symbol": "BTC",
  "unsubscribe": 1
}

Response:

{
  "status": "unsubscribed"
}

User Positions Stream

WebSocket Information

  • The base endpoint is: wss://quote.trade
  • Streams can be accessed either in a single raw stream or in a combined stream
  • Raw streams are accessed at /ws/listenKey
  • All symbols for streams are lowercase

Subscribe to a Stream

Request:

{
  "account": "",
  "unsubscribe": 0,
  "requestToken": <your_api_key>,
  "channel": "LIQUIDITY"
}

Response:

{
  "userId": 0,
  "unsubscribe": 0,
  "listenKey": "e1m6iq07fi4cosl3u35lrrtxvubr6qno4l2myet9o8evuzykzxbk8lzo3gwuyk7a"
}

Response:

{
  "e": "ACCOUNT_UPDATE",     // Event type
  "E": 1742279156668,        // Event Time
  "T": 1742279156668,        // Time of last account update
  "a": {
    "m": "ORDER",
    "B": [                   // Balances Array
      {
        "a": "USDC",          // Asset
        "wb": "435367.58",   // Quantity
        "aq": "435367.58",   // Available Quantity
        "u": 222,            // User Id
        "i": 1,              // Instrument Id
        "at": "ASSET",       // Asset Type
        "ucb": "0.0",        // USD Cost Basis
        "uacb": "0.0",       // USD Avg Cost Basis
        "uv": "435367.57",   // USD Value
        "up": "0.0",         // USD Unrealized
        "ur": "0.0",         // USD Realized
        "m": "1.00",         // Base Usd Mark
        "sm": "0.0",         // Settle Coin Usd Mark
        "su": "0.0",         // Settle Coin Unrealized
        "sr": "0.0"          // Settle Coin Realized
      },
    ]
  }
}

Unsubscribing to a Stream

Request:

{
  "account": "",
  "unsubscribe": 1,
  "requestToken": <your_api_key>,
  "channel": "LIQUIDITY"
}

Response:

{
  "status": "unsubscribed"
}

User Orders Stream

WebSocket Information

  • The base endpoint is: wss://quote.trade
  • Streams can be accessed either in a single raw stream or in a combined stream
  • Raw streams are accessed at /ws/listenKey
  • All symbols for streams are lowercase

Subscribe to a Stream

Request:

{
  "account": "",
  "unsubscribe": 0,
  "requestToken": <your_api_key>,
  "channel": "LIQUIDITY"
}

Response:

{
  "userId": 0,
  "unsubscribe": 0,
  "listenKey": "e1m6iq07fi4cosl3u35lrrtxvubr6qno4l2myet9o8evuzykzxbk8lzo3gwuyk7a"
}

Response:

{
  "e": "ORDER_TRADE_UPDATE",     // Event type
  "E": 1742290299907,            // Event Time
  "is": true,
  "T": 1742207668434,            // Time of last account update
  "o": {
    "s": "BTC/USDC",             // Symbol
    "c": "1742207668436941915",  // cl Ord. Id
    "S": "1",                    // Side
    "o": "2",                    // Ord. Type
    "f": "3",                    // Time In Force
    "q": "0.02",                 // Quantity
    "p": "83506.22",             // Price
    "ap": "83506.22",            // 
    "x": "F",                    // execType
    "X": "2",                    // Ord Status
    "i": 8425490864,             // orderId
    "l": "0.02",                 // Last Qty
    "z": "0.02",                 // Cum. Qty
    "L": "83506.22",             // Last Px
    "N": "1",                    // 
    "n": "0.00",                 // 
    "n2": "0.00",                // Fee Total
    "T": 1742207668434,          // Id
    "t": 298568904,              // Exec. Id
    "m": true,                   // 
    "R": false,                  // 
    "si": 289,                   // instrument Id
    "us": 1,                     // Order UpdateSeq
    "u": 222,                    // User Id
    "ts": 0,                     // Target Strategy
    "h": false,                  // Is Hidden
    "liq": false,                // Is Liquidation
    "lv": "0.00",                // Leaves Qty
    "qt": "NULL_VAL"             // Quote Type
  }
}

Unsubscribing to a Stream

Request:

{
  "account": "",
  "unsubscribe": 1,
  "requestToken": <your_api_key>,
  "channel": "LIQUIDITY"
}

Response:

{
  "status": "unsubscribed"
}