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.

Full open source Telegram Bot project on github

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://app.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/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://app.quote.trade/api/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://app.quote.trade/api/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://app.quote.trade/api/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://app.quote.trade/api/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://app.quote.trade/api/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}" }

Instrument

Instrument Pairs

GET /api/getInstrumentPairs

Example:

curl -X "GET" "https://app.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://app.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://app.quote.trade/api/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://app.quote.trade/api/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://app.quote.trade/api/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

Liquidity Price Feed

WebSocket Information

  • The base endpoint is: wss://app.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://app.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://app.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"
}