Arkham Exchange API

Change Log #

  • 2024-11-04 - Added rate limits

Introduction #

The Arkham Exchange provides a RESTful HTTP API and a Websocket API that enables access to the Arkham Exchange trading platform. It allows you to interact with the exchange programmatically, including trading, order management and market data.

The Rest API endpoint is available at the following base URL:

https://arkm.com/api

Authentication #

API Keys

The Arkham Exchange API uses API keys for authentication. You can create an API key and API Secret in the API Settings section of the Arkham Exchange website.

To authenticate with the API, include the API key in the +""+Arkham-API-Key+""+ header of your HTTP requests.

Signing Requests

To better protect your account, endpoints will require the request to be signed with your API Secret. The signature is a HMAC-SHA256 signed with your API Secret of the following data:

  • Your API key
  • The Expiry timestamp
  • The HTTP method of the request
  • The path of the request
  • The body of the request

The expiry timestamp is the time at which the request will expire formatted as a Unix timestamp in microseconds i.e. The number of non-leap seconds which have passed since 00:00:00 UTC on Thursday, 1 January 1970 multiplied by 1000000 as an integer.

The request will be rejected if the request is received by the server after the expiry timestamp or if the timestamp represents a time more than 15 minutes in the future.

The expiry timestamp is passed in the +""+Arkham-Expires+""+ header of the request.

The signature is passed in the +""+Arkham-Signature+""+ header of the request as a base64 encoded string.

Bash Example:

Set the BASE_URL, API_KEY, API_SECRET, METHOD, REQUEST_PATH and BODY variables to the required values:

API_KEY=<your-api-key>
API_SECRET=<your-api-secret>
BASE_URL=https://arkm.com/api
METHOD="POST"
REQUEST_PATH="/orders/cancel/all"
BODY="{}"

Note: For GET requests, the BODY should be an empty string.

Set the expiry timestamp - in this case 5 minutes from now:

EXPIRES=$(($(/bin/date +%s) + 300))000000

Calculate the signature

HMAC_KEY=$(/bin/echo -n "$API_SECRET" | base64 -D | xxd -p -c 64)
SIGNATURE=$(/bin/echo -n "$API_KEY$EXPIRES$METHOD$REQUEST_PATH$BODY" | openssl dgst -sha256 -mac HMAC -macopt hexkey:$HMAC_KEY -binary | base64)

Make the signed request

curl -X $METHOD \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Arkham-Api-Key: $API_KEY" \
	-H "Arkham-Expires: $EXPIRES" \
	-H "Arkham-Signature: $SIGNATURE" \
	-d "$BODY" \
	$BASE_URL$REQUEST_PATH

Rate Limits #

Arkham Exchange API rate limits are based on two factors as outlined below:

  • 30 Day Trading Volume
  • ARKM Balance
Requirement (30D Spot Volume / 30D Perps Volume / ARKM Balance)REST Spot Order Limit / Sec (Per User)REST Perps Order Limit / Sec (Per User)REST Perps Order Limit / Sec (Per IP)REST Message Request Limit / Sec (Per User)REST Message Request Limit / Sec (Per IP)WebSocket Message Request Limit / Sec (Per User)
< 500,000 USDT Spot and < 5,000,000 USDT Perps and < 5000 ARKM204015040510
≥ 500,000 USDT Spot or ≥ 5,000,000 USDT Perps or ≥ 5000 ARKM30400150400510
≥ 1,000,000 USDT Spot or ≥ 10,000,000 USDT Perps or ≥ 20,000 ARKM40550150550510
≥ 2,500,000 USDT Spot or ≥ 25,000,000 USDT Perps or ≥ 50,000 ARKM60750150750510
≥ 5,000,000 USDT Spot or ≥ 50,000,000 USDT Perps or ≥ 100,000 ARKM801,5001501,500510
≥ 10,000,000 USDT Spot or ≥ 100,000,000 USDT Perps or ≥ 200,000 ARKM1502,5001502,500510
≥ 25,000,000 USDT Spot or ≥ 250,000,000 USDT Perps or ≥ 300,000 ARKM2003,5001503,500510
≥ 50,000,000 USDT Spot or ≥ 500,000,000 USDT Perps or ≥ 500,000 ARKM3005,0001505,000510

Note:

Timing: 30 day snapshots of trading volume and ARKM holdings are taken at 5:00 PM UTC every Saturday and updated API rate limits are calculated between 8:00 PM and 10:00 PM UTC. The updated limits apply to the following week starting at 12:00 AM UTC Sunday. A user's ARKM balance is defined by their lowest ARKM balance over the last 30 days. For the first 30 days of trading, Trading Volume and ARKM Holdings discounts will be based on all previous trading days (i.e., 15 trading days on day 16 of trading being live).

Perpetuals and Margin #

Leverage and Margin Schedule in USDT Perpetuals

On Arkham Exchange, users cannot directly specify the maximum leverage they wish to use. Instead, the leverage is dynamic and determined by Margin Schedule, which adjusts margin requirements based on position size. As the position size increases, the required margin also increases, reducing the effective leverage.

The margin schedule applies progressively higher initial margin rates for larger positions to ensure that risk is managed as position sizes grow.

How Margin Schedule Works

Margin Schedule defines position bands with corresponding initial margin rates and maintenance margin rates. The maintenance margin rate is set at half of the initial margin rate, and the effective leverage is determined based on the initial margin rate.

Here is the margin schedule for USDT perpetuals:

Margin Schedule A - Initial & Maintenance Margin Rates

Position Size (USDT)Initial Margin (%)Maintenance Margin (%)Effective Leverage
0 - 1,000,0002.00%1.00%50x
1,000,001 - 2,000,0004.00%2.00%25x
2,000,001 - 5,000,0005.00%2.50%20x
5,000,001 - 10,000,00010.00%5.00%10x
10,000,001 - 20,000,00020.00%10.00%5x
20,000,001 - 60,000,00030.00%15.00%3.33x
60,000,001+50.00%25.00%2x
  • The initial margin rate is the percentage of your position size that must be held as collateral to open a position.
  • The maintenance margin rate is half the initial margin, representing the collateral required to maintain the position and avoid liquidation.

Example of Dynamic Leverage Based on Margin Schedule A

Let’s walk through an example using Margin Schedule A:

  1. Position 1: 800,000 USDT long on BTC/USDT.

    • Initial Margin Rate: 2% (since the position size is below 1,000,000 USDT).
    • Initial Margin: 2% of 800,000 USDT = 16,000 USDT.
    • Maintenance Margin: 1% of 800,000 USDT = 8,000 USDT.
    • Effective Leverage: 50x.
  2. Position 2: 3,000,000 USDT short on ETH/USDT.

    • Initial Margin Rate: 5% (for positions between 2,000,001 and 5,000,000 USDT).
    • Initial Margin: 5% of 3,000,000 USDT = 150,000 USDT.
    • Maintenance Margin: 2.5% of 3,000,000 USDT = 75,000 USDT.
    • Effective Leverage: 20x.

In this example, Position 1 uses higher leverage because it's in a smaller band with a lower margin requirement (2%). Position 2 has a larger size and thus requires more collateral (5%), leading to lower leverage.

How Margin Netting and Unrealized PnL Work Under This Model

When a subaccount holds multiple positions, margin netting combines the margin requirements of all open positions and offsets them using the net unrealized profit and loss (PnL) across positions.

Example of Multiple Positions with Margin Netting

Assume the trader holds two positions:

  1. Position 1:

    • Long BTC/USDT.
    • Position size: 1,500,000 USDT.
    • Initial Margin Rate: 4%.
    • Initial Margin: 4% of 1,500,000 = 60,000 USDT.
    • Maintenance Margin: 2% of 1,500,000 = 30,000 USDT.
    • Unrealized PnL: +50,000 USDT (the position is in profit).
  2. Position 2:

    • Short ETH/USDT.
    • Position size: 3,500,000 USDT.
    • Initial Margin Rate: 5%.
    • Initial Margin: 5% of 3,500,000 = 175,000 USDT.
    • Maintenance Margin: 2.5% of 3,500,000 = 87,500 USDT.
    • Unrealized PnL: -30,000 USDT (the position is in a loss).

Netting the Margin Requirements:

  • Total Initial Margin: 60,000 USDT (Position 1) + 175,000 USDT (Position 2) = 235,000 USDT.
  • Unrealized PnL offset: The net unrealized PnL is +20,000 USDT (50,000 USDT from Position 1 minus 30,000 USDT from Position 2).
  • Effective margin requirement: After netting the unrealized PnL, the effective margin requirement becomes:
    • 235,000 USDT - 20,000 USDT = 215,000 USDT.

This means the trader only needs 215,000 USDT in margin to support both positions, as the profit from the BTC/USDT position offsets the losses from the ETH/USDT position, reducing the overall margin requirement and the risk of liquidation.

Impact of Margin Schedules on Risk Management

  1. Larger positions require more margin: As your position size increases, the margin requirement also increases, reducing the effective leverage.

  2. Smaller positions offer higher leverage: Traders with smaller positions can use higher leverage because the margin requirements are lower. However, higher leverage also increases the potential risk.

  3. Unrealized PnL reduces risk: The unrealized profit from one position can offset the losses of another, reducing the overall margin requirement and helping to avoid liquidation.

Key Takeaways

  • Dynamic leverage is applied automatically based on the size of your position, with smaller positions allowing higher leverage and larger positions requiring more margin.
  • Margin netting allows unrealized PnL from one position to offset the margin requirement for another, reducing the risk of liquidation.
  • Monitoring positions is important because while unrealized profit can lower margin requirements, market volatility can quickly shift your net PnL, increasing the risk of liquidation.

Funding Rates #

Overview

  • Sampling Interval: Every second
  • Funding Interval: Every hour
  • Calculation: Funding rate is calculated based on the difference between the perpetual futures price and the index (spot) price, sampled every second
  • Min/Max Values: Funding rate is capped between -0.25% and 0.25%.
  • Transfer of Funding: Funding payments are transferred between traders once every hour

Funding Rate Calculation

The funding rate is derived from the price difference between the perpetual futures contract price and the index price. This difference is sampled every second over the course of an hour.

The formula for the funding rate at any given second is as follows:

Funding Rate Samplet=perpPricet−indexPricetindexPricet\text{Funding Rate Sample}_t = \frac{\text{perpPrice}_t - \text{indexPrice}_t}{\text{indexPrice}_t}

Where:

  • perpPrice_t: The price of the perpetual futures contract at time t.
  • indexPrice_t: The index price (or spot price) of the underlying asset at time t.

The difference is divided by the index price to express it as a percentage.

Hourly Funding Rate

The hourly funding rate is computed as the average of the second-by-second funding rates over the entire hour.

Hourly Funding Rate=124∗n∑t=1nperpPricet−indexPricetindexPricet\text{Hourly Funding Rate} = \frac{1}{24*n} \sum_{t=1}^{n} \frac{\text{perpPrice}_t - \text{indexPrice}_t}{\text{indexPrice}_t}

Where:

  • ( n ) is the total number of seconds in an hour (3600 seconds).

This average captures the typical difference between the perpetual futures price and the index price over the funding interval.

Funding Payment

The funding payment is the actual amount exchanged between long and short position holders, based on the trader’s notional position size.

Funding Payment=Position Size×Mark Price×Hourly Funding Rate\text{Funding Payment} = \text{Position Size} \times \text{Mark Price} \times \text{Hourly Funding Rate}

  • Long Position Holders: If the hourly funding rate is positive, long position holders will pay short position holders.
  • Short Position Holders: If the hourly funding rate is negative, short position holders will pay long position holders.

Example

  1. Suppose that the perpetual futures price for Bitcoin over an hour is consistently higher than the index price.

    • Average perpetual futures price (perpPrice) = $30,500
    • Average index price (indexPrice) = $30,000

    Using the formula for the hourly funding rate:

Hourly Funding Rate=30,500−30,00030,000∗24=0.00069583\text{Hourly Funding Rate} = \frac{30,500 - 30,000}{30,000*24} = 0.00069583

  1. A trader with a long position of $100,000 notional value would then calculate their funding payment as follows:

    Funding Payment=100,000×0.00069583=69.58 USD\text{Funding Payment} = 100,000 \times 0.00069583 = 69.58 \, \text{USD}

    Since the funding rate is positive, the long position holder pays $69.58 to the short position holder.

Liquidations #

Below Maintenance Margin and Liquidation Process

When trading USDT perpetuals, it’s crucial to maintain sufficient margin to avoid liquidation. If your portfolio falls below required margin thresholds, the exchange has a structured liquidation process involving Liquidity Support Providers (LSPs), the insurance fund, and automatic deleveraging (ADL) to manage risk effectively.

What Happens When a Subaccount Falls Below Maintenance Margin?

If the margin in your subaccount drops below the maintenance margin (half of the initial margin), liquidation is triggered. The exchange will attempt to close your positions through the Liquidity Support Provider (LSP) program. If there isn’t sufficient liquidity, the exchange will draw on its insurance fund to cover any shortfall. As a last resort, automatic deleveraging (ADL) is used to close out positions against opposing traders.

The Liquidation Process

1. Liquidity Support Provider (LSP) Program

When a subaccount falls below the maintenance margin, the exchange first attempts to liquidate the position by passing it to participants in the Liquidity Support Provider (LSP) program. LSPs are professional market participants (such as liquidity providers, hedge funds, or proprietary traders) who agree to absorb liquidated positions in exchange for favorable pricing and liquidity incentives.

  • Role of LSPs: LSPs provide liquidity by taking over liquidated positions at a negotiated price, helping to minimize market impact.
  • LSP Participation: Positions are transferred to LSPs in chunks, and they take over the risk, thus preventing a forced sale at unfavorable market prices. This step helps ensure that large liquidations do not directly impact the market price or cause significant slippage.
  • Liquidation at Mark Price + 1% Spread: When a liquidation occurs, LSP participants are allowed to purchase the liquidated position at the Mark Price plus a 1% spread. This ensures that liquidity providers are fairly compensated for taking on liquidated positions, which may carry higher risk in turbulent market conditions.

2. Exchange Insurance Fund

Arkham maintains an Insurance Fund to safeguard traders and the overall ecosystem from extreme market events, particularly during liquidations. Here's how the Insurance Fund ensures the protection of both traders and LSP participants:

  • Covering Losses: In the event that a liquidation results in a negative balance or insufficient funds to cover the full position, the Insurance Fund is used to make up the difference, ensuring that LSP participants receive the liquidated positions at Mark Price + 1%, even if the liquidated trader's account balance is inadequate.

  • Fair Pricing for LSP: The 1% spread above the Mark Price acts as a buffer, offering an incentive to LSP participants and reducing their risk. The Insurance Fund guarantees that the exchange is able to honor this spread, maintaining fairness in the liquidation process.

By ensuring that LSP participants are compensated with a mark price plus 1% spread and using the Insurance Fund to cover potential shortfalls, Arkham promotes a healthy liquidity environment while protecting traders from excessive loss exposure.

3. Automatic Deleveraging (ADL)

If LSP program participants can't fully cover the liquidated position, the exchange resorts to automatic deleveraging (ADL). In ADL, the system automatically closes out positions by matching them with opposing open positions held by other traders on the platform.

  • How ADL Works: The exchange looks for opposing positions (e.g., a long position matched against a short position) held by other participants. The positions are closed out against each other to bring the account back into compliance with the margin requirements.
  • Impact on Other Traders: Traders with high leverage and profits are prioritized for ADL matching, meaning their positions might be automatically reduced or closed to balance the risk on the exchange.

Example

  1. Trader’s Initial Position:

    • Trader A holds a long position of 10 BTCP in a perpetual contract with an entry price of $30,000.
    • Maintenance Margin Requirement: 5% of the total position value, that requires a collateral of $15,000.
  2. Market Movement:

    • The price of BTC perpetual drops to $28,000.
    • Trader A’s equity is now: Equity=Current Position Value−Amount Invested+CollateralCurrent Position Value=10 BTC×28,000=280,000Amount Invested=30,000×10=300,000Equity=280,000−300,000+15,000=−5,000\text{Equity} = \text{Current Position Value} - \text{Amount Invested} + \text{Collateral}\\ \text{Current Position Value} = 10 \, \text{BTC} \times 28,000 = 280,000\\ \text{Amount Invested} = 30,000 \times {10} = 300,000\\ \text{Equity} = 280,000 - 300,000 + 15,000 = -5,000\\
    • Maintenance margin required: 5% of 270,000=13,5005\% \text{ of } 270,000 = 13,500
    • Since Trader A’s equity is below the required maintenance margin, their subaccount is passed on to liquidation engine.

Liquidation Process

Step 1: Attempt to Liquidate via LSPs

  1. Liquidation Trigger:

    • Since Trader A’s equity is below the required maintenance margin, their subaccount gets liquidated.
    • The exchange attempts to pass Trader A’s position to LSP participants. The BTC price is $28,000, and they take it on at Mark Price - 1% Spread: LSP Purchase Price=28,000−(28,000×0.01)=27,720\text{LSP Purchase Price} = 28,000 - (28,000 \times 0.01) = 27,720
  2. LSP Involvement:

    • The exchange sells 5 BTC to LSPs at $27,720 per BTC: Value of Liquidated Position to LSP=5 BTC×27,720=138,600\text{Value of Liquidated Position to LSP} = 5 \, \text{BTC} \times 27,720 = 138,600
  3. Insurance Fund Usage:

    Shortfall=138,600+5BTC×28,000+15,000−300,000=−6,400\text{Shortfall} = 138,600 + 5 \text{BTC} \times 28,000 + 15,000 - 300,000 = -6,400
    • The Insurance Fund covers this shortfall so that LSPs receive the liquidated positions at the agreed price, ensuring no losses occur for them despite Trader A's account deficiency.

Step 2: Remaining Position and ADL

  1. Remaining Position:

    • Trader A now has 5 BTC remaining which will be deleveraged
  2. Automatic Deleveraging (ADL):

    • Suppose another trader, Trader B, has a short position of 10 BTC at $28,000.
    • The exchange identifies Trader B’s short position to match it against Trader A’s liquidated position.
    • Since Trader B has a profitable short position, the exchange will deleverage 5 BTC of their short position at mark price of $28,000 realising a PnL of 5 * $2000 = $10,000.
  3. Closing Positions:

    • Trader B’s position is closed out for 5 BTC, while Trader A’s long position is effectively liquidated.
    • The remaining short position for Trader B becomes 5 BTC.

Summary of Outcomes

  • Trader A:

    • Had their 10 BTC long position liquidated.
    • Resulting shortfall of $6,400 was covered by the Insurance Fund.
  • Liquidity Support Providers:

    • Acquired 5 BTC at $27,720, absorbing some risk but benefiting from the premium.
  • Trader B:

    • Partially closed their 5 BTC short position, gaining $10,000 profit from the market movement and helping to balance risk across the exchange.

Key Takeaways

  1. LSPs facilitate smoother liquidations by absorbing positions and maintaining market stability, which helps prevent a rapid decline in price due to forced sales.
  2. The Insurance Fund acts as a safety net, ensuring LSPs and the exchange can operate without incurring losses due to trader defaults.
  3. Automatic Deleveraging (ADL) provides a mechanism to manage risk and maintain balance by matching positions across different traders.

This example illustrates how a perpetual contract liquidation works in a practical scenario, showing how different mechanisms come together to manage risk and maintain a stable trading environment.

Impact on Traders from Liquidation and ADL

  1. LSP Program and Insurance Fund: These mechanisms are designed to minimize the impact of liquidation on the market and ensure traders’ positions are closed without significant losses beyond the maintenance margin.

  2. Automatic Deleveraging (ADL): Traders with high leverage and high profits may see their positions automatically reduced or closed as part of the ADL process. This ensures that the exchange maintains risk management, but it can affect traders’ open positions unexpectedly.

  3. Monitoring Margin Levels: To avoid liquidation, traders should closely monitor their positions and maintain sufficient collateral. If your position falls below the initial or maintenance margin, the liquidation process will start, and you may lose your position partially or entirely.

The liquidation process ensures that the exchange maintains stability and protects traders and the market from sudden, large-scale liquidations.

#Margin Schedules

Margin schedules are used to determine the margin requirements for a given position size. Each trading pair has one of the below margin schedules associated with it.

Each margin schedule defines a series of bands, where each band has a position size range, a maximum leverage, an initial margin rate and a rebate. The initial margin requirement is calculated as the position size multiplied by the initial margin rate minus the rebate. The rebate is provided so that there is no discontinuity in the margin requirement when moving between bands.

#Margin Schedule A

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 1,000,000
50x
2%
0
1,000,000 - 2,000,000
25x
4%
20,000
2,000,000 - 5,000,000
20x
5%
40,000
5,000,000 - 10,000,000
10x
10%
290,000
10,000,000 - 20,000,000
5x
20%
1,290,000
20,000,000 - 60,000,000
3.33x
30%
3,290,000
60,000,000 - 200,000,000
2x
50%
15,290,000

#Margin Schedule B

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 250,000
50x
2%
0
250,000 - 750,000
25x
4%
5,000
750,000 - 1,000,000
20x
5%
12,500
1,000,000 - 5,000,000
10x
10%
62,500
5,000,000 - 10,000,000
5x
20%
562,500
10,000,000 - 30,000,000
3.33x
30%
1,562,500
30,000,000 - 100,000,000
2x
50%
7,562,500

#Margin Schedule C

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 250,000
25x
4%
0
250,000 - 500,000
20x
5%
2,500
500,000 - 1,000,000
10x
10%
27,500
1,000,000 - 2,500,000
5x
20%
127,500
2,500,000 - 50,000,000
3.33x
30%
377,500
50,000,000 - 100,000,000
2x
50%
10,377,500

#Margin Schedule D

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 10,000
20x
5%
0
10,000 - 250,000
10x
10%
500
250,000 - 500,000
5x
20%
25,500
500,000 - 2,000,000
3.33x
30%
75,500
2,000,000 - 5,000,000
2x
50%
475,500

#Margin Schedule E

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 10,000
10x
10%
0
10,000 - 100,000
5x
20%
1,000
100,000 - 1,000,000
3.33x
30%
11,000
1,000,000 - 5,000,000
2x
50%
211,000

#Margin Schedule F

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 10,000
5x
20%
0
10,000 - 100,000
3.33x
30%
1,000
100,000 - 500,000
2x
50%
21,000

#Margin Schedule G

Position Size (USDT)
Maximum Leverage
Initial Margin Rate
Rebate (USDT)
0 - 10,000
3.33x
30%
0
10,000 - 50,000
2x
50%
2,000

#Error Responses

There is a fixed set of errors returned by the API and Websocket when a failure occurs, each has a unique name which maps to a specific HTTP status code and (deprecated) websocket error code.

#1XXXX General Errors

These errors can occur for a variety of reasons and may be returned by the API or Websocket on any endpoint.

IDNameStatus CodeWS Code
10000InternalError5000
10001BadRequest4001
10002Unauthorized4012
10003InvalidSymbol4003
10004SymbolRequired4004
10005RateLimitExceeded42911
10006Forbidden40313
10007InvalidIP4001
10008Throttled5031
10009KeyNotPermitted4011
10010ParsingKey4011
10011VerifyingKey4011
10012RequiresRead4031
10013RequiresWrite4031
10014SignatureMissing4001
10015ExpiresMissing4001
10016ParsingExpires4001
10017ExpiresTooFar4031
10018ExpiredSignature4031
10019SignatureMismatch4011
10020IPNotAllowed4031
10021MFA4011
10022ParsingRequest4001
10023SubaccountNotFound4041
10024Conflict4091
10025NotFound4041

#2XXXX General Websocket Errors

These errors only occur in the context of Websocket connections.

IDNameStatus CodeWS Code
20001InvalidMethod4005
20002MethodRequired4006
20003InvalidChannel4007
20004ChannelRequired4008
20005InvalidGroup40010

#3XXXX Trading Errors

These errors occur in the context of trading operations such as creating or cancelling orders.

IDNameStatus CodeWS Code
30001InvalidSize4001
30002InvalidPrice4001
30003InvalidPostOnly4001
30004InvalidReduceOnly4001
30005InvalidNotional4001
30006UnknownOrderType4001
30007PairNotEnabled4001
30008TradingFreeze4001
30009PostOnly4001
30010InsufficientBalance4001
30011InvalidPair4001
30012NoMarkPrice4001
30013InsufficientLiquidity4001
30014ClientOrderIdAlreadyExists4001
30015ClientOrderIdNotFound4001
30016ReduceOnlyInvalid4001
30017UnsupportedOrderSide4001
30018UnsupportedAssetType4001
30019PositionLimit4001
30020InvalidClientOrderID4001
30021InvalidTriggerType4001
30022InvalidTriggerPriceType4001
30023InvalidOrderSide4001
30024InvalidOrderType4001
30025InvalidBrokerId4001
30026UserFrozen4001
30027UserDeleted4291
30028OrderIdNotFound4001

#4XXXX Funding Errors

These errors occur in the context of funding operations such as deposits, withdrawals, and transfers.

IDNameStatus CodeWS Code
40001FailedRiskCheck4001
40002MemoNotSupported4001
40003InvalidWithdrawalAddress4001
40004PositionNotFound4041
40005InvalidChain4001
40006FuturesNotEnabled4001
40007SubaccountHasOpenFuturePositions4001
40008LspAssignmentGreaterThanMaxNotional4001
40009LspMaxNotionalGreaterThanMarginLimit4001
40010LspMaxNotionalMustNotBeNegative4001
40011PortfolioLiquidation4001
40012NegativeAmount4001
40013ZeroAmount4001

#9XXXX Other Errors

These errors occur in the context of other API requests.

IDNameStatus CodeWS Code
90001InvalidAlertType4001
90002InvalidAlertPriceType4001
90003InvalidVoucherStatus4001
90004InvalidCandleDuration4001
90005InvalidNotificationType4001
90006TooManyMFAAttempts4291
90007InvalidMFA4011
90008TooManyAttempts4291
90009InvalidRole4001

#Api Errors

Response Body

// Example Response Body
{
  "id": 10000,
  "message": "internal error",
  "name": "InternalError"
}
NameTypeRequiredDescription
objectYes
.idnumberYesThe unique identifier for the error
.messagestringYesAdditional details about the error
.namestringYesThe name of the error Enum: "InternalError", "BadRequest", "Unauthorized", "InvalidSymbol", "SymbolRequired", "RateLimitExceeded", "Forbidden", "InvalidIP", "Throttled", "KeyNotPermitted", "ParsingKey", "VerifyingKey", "RequiresRead", "RequiresWrite", "SignatureMissing", "ExpiresMissing", "ParsingExpires", "ExpiresTooFar", "ExpiredSignature", "SignatureMismatch", "IPNotAllowed", "MFA", "ParsingRequest", "SubaccountNotFound", "Conflict", "NotFound", "InvalidMethod", "MethodRequired", "InvalidChannel", "ChannelRequired", "InvalidGroup", "InvalidSize", "InvalidPrice", "InvalidPostOnly", "InvalidReduceOnly", "InvalidNotional", "UnknownOrderType", "PairNotEnabled", "TradingFreeze", "PostOnly", "InsufficientBalance", "InvalidPair", "NoMarkPrice", "InsufficientLiquidity", "ClientOrderIdAlreadyExists", "ClientOrderIdNotFound", "ReduceOnlyInvalid", "UnsupportedOrderSide", "UnsupportedAssetType", "PositionLimit", "InvalidClientOrderID", "InvalidTriggerType", "InvalidTriggerPriceType", "InvalidOrderSide", "InvalidOrderType", "InvalidBrokerId", "UserFrozen", "UserDeleted", "OrderIdNotFound", "FailedRiskCheck", "MemoNotSupported", "InvalidWithdrawalAddress", "PositionNotFound", "InvalidChain", "FuturesNotEnabled", "SubaccountHasOpenFuturePositions", "LspAssignmentGreaterThanMaxNotional", "LspMaxNotionalGreaterThanMarginLimit", "LspMaxNotionalMustNotBeNegative", "PortfolioLiquidation", "NegativeAmount", "ZeroAmount", "InvalidAlertType", "InvalidAlertPriceType", "InvalidVoucherStatus", "InvalidCandleDuration", "InvalidNotificationType", "TooManyMFAAttempts", "InvalidMFA", "TooManyAttempts", "InvalidRole"

#API Routes

User#

#Get User

GET /user

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "airdropKycAt": 1704067200000000,
  "becameVipAt": 1704067200000000,
  "country": "abc123",
  "dmm": true,
  "email": "[email protected]",
  "featureFlags": [
    "feature1",
    "feature2"
  ],
  "id": 1,
  "kycVerifiedAt": 1704067200000000,
  "pmm": true,
  "requireMFA": true,
  "settings": {
    "allowSequenceEmails": true,
    "autogenDepositAddresses": true,
    "confirmBeforePlaceOrder": true,
    "hideBalances": true,
    "language": "en",
    "marginUsageThreshold": 1.23,
    "notifyAnnouncements": true,
    "notifyCommissions": true,
    "notifyDeposits": true,
    "notifyMarginUsage": true,
    "notifyOrderFills": true,
    "notifyRebates": true,
    "notifySendEmail": true,
    "notifyWithdrawals": true,
    "tickerTapeScroll": true,
    "updatesFlash": true
  },
  "subaccounts": [
    {
      "createdAt": 1704067200000000,
      "futuresEnabled": true,
      "id": 1,
      "isLsp": true,
      "lspSettings": [
        {
          "maxAssignmentNotional": "200.1",
          "maxExposureNotional": "200.1",
          "symbol": "BTC_USDT"
        }
      ],
      "name": "abc123",
      "payFeesInArkm": true,
      "pinned": true
    }
  ],
  "username": "username",
  "withdrawOnly": true
}
NameTypeRequiredDescription
objectYes
.airdropKycAtnumberYesTime in microseconds since unix epoch
.becameVipAtnumberYesTime in microseconds since unix epoch
.countrystringNo
.dmmbooleanYes
.emailstringYes Format: email
.featureFlagsarrayYesList of feature flags enabled for the user
.featureFlags[*]string-
.idintegerYes
.kycVerifiedAtnumberYesTime in microseconds since unix epoch
.pmmbooleanYes
.requireMFAbooleanYes
.settingsobjectYes
.settings.allowSequenceEmailsbooleanYes
.settings.autogenDepositAddressesbooleanYes
.settings.confirmBeforePlaceOrderbooleanYes
.settings.hideBalancesbooleanYes
.settings.languagestringNo Enum: "en", "zh", "vi", "uk", "es"
.settings.marginUsageThresholdnumberYes
.settings.notifyAnnouncementsbooleanYes
.settings.notifyCommissionsbooleanYes
.settings.notifyDepositsbooleanYes
.settings.notifyMarginUsagebooleanYes
.settings.notifyOrderFillsbooleanYes
.settings.notifyRebatesbooleanYes
.settings.notifySendEmailbooleanYes
.settings.notifyWithdrawalsbooleanYes
.settings.tickerTapeScrollbooleanYes
.settings.updatesFlashbooleanYes
.subaccountsarrayYes
.subaccounts[*]object-
.subaccounts[*].createdAtnumberYesTime in microseconds since unix epoch
.subaccounts[*].futuresEnabledbooleanYesif true futures trading is enabled for the subaccount
.subaccounts[*].idintegerYes
.subaccounts[*].isLspbooleanYesif true the subaccount is a liquidity provider
.subaccounts[*].lspSettingsarrayYes
.subaccounts[*].lspSettings[*]object-
.subaccounts[*].lspSettings[*].maxAssignmentNotionalstringYes
.subaccounts[*].lspSettings[*].maxExposureNotionalstringYes
.subaccounts[*].lspSettings[*].symbolstringYes
.subaccounts[*].namestringYes
.subaccounts[*].payFeesInArkmbooleanYesif true and ARKM balance is sufficient fees are paid in ARKM with a discount. This is only available for USDT pairs
.subaccounts[*].pinnedbooleanYes
.usernamestringYes
.withdrawOnlybooleanYes

Public#

#Get Alerts

GET /public/alerts

Response Body

// Example Response Body
[
  {
    "id": 1,
    "lastUpdated": 1704067200000000,
    "message": "abc123",
    "type": "abc123"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].idintegerYes
[*].lastUpdatednumberYesTime in microseconds since unix epoch
[*].messagestringYes
[*].typestringYes

#Get Announcements

GET /public/announcements

Get announcements for a specific locale

Parameters

NameInTypeRequiredDescription
localequerystringYes Enum: "en", "zh", "vi", "uk", "es"

Response Body

// Example Response Body
[
  {
    "content": "abc123",
    "createdAt": 1704067200000000,
    "id": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].contentstringYes
[*].createdAtnumberYesTime in microseconds since unix epoch
[*].idintegerYes

#Get Assets

GET /public/assets

Response Body

// Example Response Body
[
  {
    "chains": [
      {
        "assetSymbol": "BTC",
        "blockTime": 1,
        "confirmations": 1,
        "name": "abc123",
        "symbol": "abc123",
        "type": 1
      }
    ],
    "featuredPair": "BTC_USDT",
    "imageUrl": "https://example.com/image.png",
    "minDeposit": "10",
    "minWithdrawal": "10",
    "moonPayChain": "BTC",
    "moonPayCode": "btc",
    "name": "abc123",
    "stablecoin": true,
    "status": "staged",
    "symbol": "BTC",
    "withdrawalFee": "0.01"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].chainsarrayYes
[*].chains[*]object-
[*].chains[*].assetSymbolstringYes
[*].chains[*].blockTimeintegerYes
[*].chains[*].confirmationsintegerYes
[*].chains[*].namestringYes
[*].chains[*].symbolstringYes
[*].chains[*].typeintegerYes
[*].featuredPairstringYes
[*].imageUrlstringYes Format: url
[*].minDepositstringYes
[*].minWithdrawalstringYes
[*].moonPayChainstringNo
[*].moonPayCodestringNo
[*].namestringYes
[*].stablecoinbooleanYes
[*].statusstringYes Enum: "staged", "listed", "delisted"
[*].symbolstringYes
[*].withdrawalFeestringYes

#Get Book

GET /public/book

Parameters

NameInTypeRequiredDescription
symbolquerystringYes
limitqueryintegerNo

Response Body

// Example Response Body
{
  "asks": [
    {
      "price": "1.23",
      "size": "20.1"
    }
  ],
  "bids": [
    {
      "price": "1.23",
      "size": "20.1"
    }
  ],
  "group": "0.01",
  "lastTime": 1731686400000000,
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.asksarrayYes
.asks[*]object-
.asks[*].pricestringYes
.asks[*].sizestringYes
.bidsarrayYes
.bids[*]object-
.bids[*].pricestringYes
.bids[*].sizestringYes
.groupstringYes
.lastTimenumberYesTime in microseconds since unix epoch
.symbolstringYes

#Get Candles

GET /public/candles

Parameters

NameInTypeRequiredDescription
symbolquerystringYes
durationquerystringYes Enum: "1m", "5m", "15m", "30m", "1h", "6h", "24h"
startquerynumberYesTime in microseconds since unix epoch
endquerynumberYesTime in microseconds since unix epoch

Response Body

// Example Response Body
[
  {
    "close": "1.23",
    "duration": 60000000,
    "high": "1.23",
    "low": "1.23",
    "open": "1.23",
    "quoteVolume": "200.1",
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "volume": "20.1"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].closestringYes
[*].durationintegerYes Enum: 60000000, 300000000, 900000000, 1800000000, 3600000000, 21600000000, 86400000000
[*].highstringYes
[*].lowstringYes
[*].openstringYes
[*].quoteVolumestringYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].volumestringYes

#Get Chains

GET /public/chains

Response Body

// Example Response Body
[
  {
    "assetSymbol": "BTC",
    "blockTime": 1,
    "confirmations": 1,
    "name": "abc123",
    "symbol": "abc123",
    "type": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].assetSymbolstringYes
[*].blockTimeintegerYes
[*].confirmationsintegerYes
[*].namestringYes
[*].symbolstringYes
[*].typeintegerYes

#Get Contracts

GET /public/contracts

Response Body

// Example Response Body
[
  {
    "baseSymbol": "BTC",
    "fundingRate": "0.000733",
    "high24h": "100000.1",
    "indexCurrency": "USDT",
    "indexPrice": "100000.1",
    "low24h": "90000.1",
    "markPrice": "100000.1",
    "nextFundingRate": "0.000733",
    "nextFundingTime": 1731686400000000,
    "openInterest": "1.1",
    "openInterestUSD": "100000.1",
    "price": "100000.1",
    "price24hAgo": "90000.1",
    "productType": "spot",
    "quoteSymbol": "USDT",
    "quoteVolume24h": "100000.1",
    "symbol": "BTC_USDT",
    "usdVolume24h": "100000.1",
    "volume24h": "1.1"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].baseSymbolstringYes
[*].fundingRatestringYes
[*].high24hstringYes
[*].indexCurrencystringYes
[*].indexPricestringYes
[*].low24hstringYes
[*].markPricestringYes
[*].nextFundingRatestringYes
[*].nextFundingTimenumberYesTime in microseconds since unix epoch
[*].openIntereststringYes
[*].openInterestUSDstringYes
[*].pricestringYes
[*].price24hAgostringYes
[*].productTypestringYes Enum: "spot", "perpetual"
[*].quoteSymbolstringYes
[*].quoteVolume24hstringYes
[*].symbolstringYes
[*].usdVolume24hstringYes
[*].volume24hstringYes

#Get Index Price

GET /public/index-price

Parameters

NameInTypeRequiredDescription
symbolquerystringYes

Response Body

// Example Response Body
{
  "constituents": [
    {
      "exchange": "binance",
      "price": "1.23",
      "time": 1704067200000000,
      "weight": "1.23"
    }
  ],
  "price": "1.23",
  "symbol": ".BTC_USDT",
  "time": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.constituentsarrayYes
.constituents[*]object-
.constituents[*].exchangestringYes Enum: "binance", "bybit", "okx", "coinbase", "kraken", "kucoin", "gateio", "bitmart", "htx", "mexc", "bitget", "crypto.com", "gemini", "binance_us"
.constituents[*].pricestringYes
.constituents[*].timenumberYesTime of the last update according to the exchange
.constituents[*].weightstringYes
.pricestringYes
.symbolstringYes
.timenumberYesTime in microseconds since unix epoch

#Get Index Prices

GET /public/index-prices

Response Body

// Example Response Body
[
  {
    "constituents": [
      {
        "exchange": "binance",
        "price": "1.23",
        "time": 1704067200000000,
        "weight": "1.23"
      }
    ],
    "price": "1.23",
    "symbol": ".BTC_USDT",
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].constituentsarrayYes
[*].constituents[*]object-
[*].constituents[*].exchangestringYes Enum: "binance", "bybit", "okx", "coinbase", "kraken", "kucoin", "gateio", "bitmart", "htx", "mexc", "bitget", "crypto.com", "gemini", "binance_us"
[*].constituents[*].pricestringYes
[*].constituents[*].timenumberYesTime of the last update according to the exchange
[*].constituents[*].weightstringYes
[*].pricestringYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch

#Get L1 Book

GET /public/level-one-book

Parameters

NameInTypeRequiredDescription
symbolquerystringYes
limitqueryintegerNo

Response Body

// Example Response Body
{
  "askPrice": "1.23",
  "askSize": "20.1",
  "bidPrice": "1.23",
  "bidSize": "20.1",
  "revisionId": 1,
  "symbol": "BTC_USDT",
  "time": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.askPricestringNo
.askSizestringNo
.bidPricestringNo
.bidSizestringNo
.revisionIdintegerYes
.symbolstringYes
.timenumberYesTime in microseconds since unix epoch

#Get Margin Schedules

GET /public/margin-schedules

Response Body

// Example Response Body
[
  {
    "bands": [
      {
        "leverageRate": "2",
        "marginRate": "0.5",
        "positionLimit": "5000000",
        "rebate": "211000"
      }
    ],
    "name": "E"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].bandsarrayYes
[*].bands[*]object-
[*].bands[*].leverageRatestringYesleverage rate applied in this band
[*].bands[*].marginRatestringYesInitial margin rate applied in this band
[*].bands[*].positionLimitstringYesMaximum position size for this band
[*].bands[*].rebatestringYesInitial margin rebate applied in this band
[*].namestringYesMargin schedule name Enum: "A", "B", "C", "D", "E", "F", "G"

#Get MarketCap Chart

GET /public/marketcapchart

Response Body

// Example Response Body
{
  "market_cap_chart": {
    "market_cap": [
      [
        1.23
      ]
    ],
    "volume": [
      [
        1.23
      ]
    ]
  }
}
NameTypeRequiredDescription
objectYes
.market_cap_chartobjectYes
.market_cap_chart.market_caparrayYes
.market_cap_chart.market_cap[*]array-
.market_cap_chart.market_cap[*][*]number-
.market_cap_chart.volumearrayYes
.market_cap_chart.volume[*]array-
.market_cap_chart.volume[*][*]number-

#Get Market Caps

GET /public/marketcaps

Response Body

// Example Response Body
{
  "market_cap_change_percentage_24h_usd": 1.23,
  "market_cap_percentage_btc": 1.23,
  "total_market_cap": 1.23
}
NameTypeRequiredDescription
objectYes
.market_cap_change_percentage_24h_usdnumberYes
.market_cap_percentage_btcnumberYes
.total_market_capnumberYes

#Get Pair

GET /public/pair

Parameters

NameInTypeRequiredDescription
symbolquerystringYes

Response Body

// Example Response Body
{
  "baseImageUrl": "https://example.com/image.png",
  "baseIsStablecoin": true,
  "baseName": "Bitcoin",
  "baseSymbol": "BTC",
  "marginSchedule": "A",
  "maxLeverage": "10",
  "maxPrice": "1000000",
  "maxPriceScalarDown": "0.5",
  "maxPriceScalarUp": "1.5",
  "maxSize": "1000000",
  "minLotSize": "0.01",
  "minNotional": "5",
  "minPrice": "0.001",
  "minSize": "0.01",
  "minTickPrice": "0.001",
  "pairType": "spot",
  "quoteImageUrl": "https://example.com/image.png",
  "quoteIsStablecoin": true,
  "quoteName": "Tether",
  "quoteSymbol": "USDT",
  "status": "staged",
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.baseImageUrlstringYes Format: url
.baseIsStablecoinbooleanYes
.baseNamestringYes
.baseSymbolstringYes
.marginSchedulestringNo Enum: "A", "B", "C", "D", "E", "F", "G"
.maxLeveragestringNo
.maxPricestringYes
.maxPriceScalarDownstringYesOrders rejected if price is less than this scalar times the index price
.maxPriceScalarUpstringYesOrders rejected if price is greater than this scalar times the index price
.maxSizestringYes
.minLotSizestringYes
.minNotionalstringYesMinimum notional (price * size) for orders
.minPricestringYes
.minSizestringYes
.minTickPricestringYes
.pairTypestringYes Enum: "spot", "perpetual"
.quoteImageUrlstringYes Format: url
.quoteIsStablecoinbooleanYes
.quoteNamestringYes
.quoteSymbolstringYes
.statusstringYes Enum: "staged", "listed", "delisted"
.symbolstringYes

#Get Pairs

GET /public/pairs

Response Body

// Example Response Body
[
  {
    "baseImageUrl": "https://example.com/image.png",
    "baseIsStablecoin": true,
    "baseName": "Bitcoin",
    "baseSymbol": "BTC",
    "marginSchedule": "A",
    "maxLeverage": "10",
    "maxPrice": "1000000",
    "maxPriceScalarDown": "0.5",
    "maxPriceScalarUp": "1.5",
    "maxSize": "1000000",
    "minLotSize": "0.01",
    "minNotional": "5",
    "minPrice": "0.001",
    "minSize": "0.01",
    "minTickPrice": "0.001",
    "pairType": "spot",
    "quoteImageUrl": "https://example.com/image.png",
    "quoteIsStablecoin": true,
    "quoteName": "Tether",
    "quoteSymbol": "USDT",
    "status": "staged",
    "symbol": "BTC_USDT"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].baseImageUrlstringYes Format: url
[*].baseIsStablecoinbooleanYes
[*].baseNamestringYes
[*].baseSymbolstringYes
[*].marginSchedulestringNo Enum: "A", "B", "C", "D", "E", "F", "G"
[*].maxLeveragestringNo
[*].maxPricestringYes
[*].maxPriceScalarDownstringYesOrders rejected if price is less than this scalar times the index price
[*].maxPriceScalarUpstringYesOrders rejected if price is greater than this scalar times the index price
[*].maxSizestringYes
[*].minLotSizestringYes
[*].minNotionalstringYesMinimum notional (price * size) for orders
[*].minPricestringYes
[*].minSizestringYes
[*].minTickPricestringYes
[*].pairTypestringYes Enum: "spot", "perpetual"
[*].quoteImageUrlstringYes Format: url
[*].quoteIsStablecoinbooleanYes
[*].quoteNamestringYes
[*].quoteSymbolstringYes
[*].statusstringYes Enum: "staged", "listed", "delisted"
[*].symbolstringYes

#Get Server Time

GET /public/server-time

Response Body

// Example Response Body
{
  "serverTime": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.serverTimenumberYesTime in microseconds since unix epoch

#Get Ticker

GET /public/ticker

Parameters

NameInTypeRequiredDescription
symbolquerystringYes

Response Body

// Example Response Body
{
  "baseSymbol": "BTC",
  "fundingRate": "0.000733",
  "high24h": "100000.1",
  "indexCurrency": "USDT",
  "indexPrice": "100000.1",
  "low24h": "90000.1",
  "markPrice": "100000.1",
  "nextFundingRate": "0.000733",
  "nextFundingTime": 1731686400000000,
  "openInterest": "1.1",
  "openInterestUSD": "100000.1",
  "price": "100000.1",
  "price24hAgo": "90000.1",
  "productType": "spot",
  "quoteSymbol": "USDT",
  "quoteVolume24h": "100000.1",
  "symbol": "BTC_USDT",
  "usdVolume24h": "100000.1",
  "volume24h": "1.1"
}
NameTypeRequiredDescription
objectYes
.baseSymbolstringYes
.fundingRatestringYes
.high24hstringYes
.indexCurrencystringYes
.indexPricestringYes
.low24hstringYes
.markPricestringYes
.nextFundingRatestringYes
.nextFundingTimenumberYesTime in microseconds since unix epoch
.openIntereststringYes
.openInterestUSDstringYes
.pricestringYes
.price24hAgostringYes
.productTypestringYes Enum: "spot", "perpetual"
.quoteSymbolstringYes
.quoteVolume24hstringYes
.symbolstringYes
.usdVolume24hstringYes
.volume24hstringYes

#Get Tickers

GET /public/tickers

Response Body

// Example Response Body
[
  {
    "baseSymbol": "BTC",
    "fundingRate": "0.000733",
    "high24h": "100000.1",
    "indexCurrency": "USDT",
    "indexPrice": "100000.1",
    "low24h": "90000.1",
    "markPrice": "100000.1",
    "nextFundingRate": "0.000733",
    "nextFundingTime": 1731686400000000,
    "openInterest": "1.1",
    "openInterestUSD": "100000.1",
    "price": "100000.1",
    "price24hAgo": "90000.1",
    "productType": "spot",
    "quoteSymbol": "USDT",
    "quoteVolume24h": "100000.1",
    "symbol": "BTC_USDT",
    "usdVolume24h": "100000.1",
    "volume24h": "1.1"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].baseSymbolstringYes
[*].fundingRatestringYes
[*].high24hstringYes
[*].indexCurrencystringYes
[*].indexPricestringYes
[*].low24hstringYes
[*].markPricestringYes
[*].nextFundingRatestringYes
[*].nextFundingTimenumberYesTime in microseconds since unix epoch
[*].openIntereststringYes
[*].openInterestUSDstringYes
[*].pricestringYes
[*].price24hAgostringYes
[*].productTypestringYes Enum: "spot", "perpetual"
[*].quoteSymbolstringYes
[*].quoteVolume24hstringYes
[*].symbolstringYes
[*].usdVolume24hstringYes
[*].volume24hstringYes

#Get Public Trades

GET /public/trades

Parameters

NameInTypeRequiredDescription
symbolquerystringYes
beforequeryintegerNo
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "price": "1.23",
    "revisionId": 1,
    "size": "20.1",
    "symbol": "BTC_USDT",
    "takerSide": "buy",
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].pricestringYes
[*].revisionIdintegerYes
[*].sizestringYes
[*].symbolstringYes
[*].takerSidestringYes Enum: "buy", "sell"
[*].timenumberYesTime in microseconds since unix epoch

Orders#

#Get Orders

GET /orders

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0

Response Body

// Example Response Body
[
  {
    "arkmFeePaid": "20.1",
    "avgPrice": "1.23",
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "creditFeePaid": "200.1",
    "executedNotional": "200.1",
    "executedSize": "20.1",
    "lastArkmFee": "0.01",
    "lastCreditFee": "0.01",
    "lastMarginBonusFee": "0.01",
    "lastPrice": "1.5",
    "lastQuoteFee": "0.01",
    "lastSize": "1000",
    "lastTime": 1704067200000000,
    "marginBonusFeePaid": "200.1",
    "orderId": 1,
    "postOnly": true,
    "price": "1.23",
    "quoteFeePaid": "200.1",
    "reduceOnly": true,
    "revisionId": 1,
    "side": "buy",
    "size": "20.1",
    "status": "new",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "triggerOrderId": 1,
    "type": "limitGtc",
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].arkmFeePaidstringYesTotal ARKM fee paid so far in the order
[*].avgPricestringYesAverage price filled so far in the order
[*].clientOrderIdstringNo
[*].creditFeePaidstringYesTotal fee paid via credits so far in the order
[*].executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
[*].executedSizestringYesTotal quantity filled so far in the order
[*].lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
[*].lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
[*].lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
[*].lastPricestringYesPrice of the last trade, only present on taker and maker statuses
[*].lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
[*].lastSizestringYesSize of the last trade, only present on taker and maker statuses
[*].lastTimenumberYesTime of the last status update on the order
[*].marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
[*].orderIdintegerYes
[*].postOnlybooleanYesIf true the order is post-only
[*].pricestringYesThe original price of the order
[*].quoteFeePaidstringYesTotal quote fee paid so far in the order
[*].reduceOnlybooleanYesIf true the order is reduce-only
[*].revisionIdintegerYesAn identifier for the order's current state, unique to the pair
[*].sidestringYes Enum: "buy", "sell"
[*].sizestringYesThe original size of the order
[*].statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
[*].userIdintegerYes

#Get Open Order By Client Order Id

GET /orders/by-client-order-id

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
clientOrderIdquerystringNo

Response Body

// Example Response Body
{
  "arkmFeePaid": "20.1",
  "avgPrice": "1.23",
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "creditFeePaid": "200.1",
  "executedNotional": "200.1",
  "executedSize": "20.1",
  "lastArkmFee": "0.01",
  "lastCreditFee": "0.01",
  "lastMarginBonusFee": "0.01",
  "lastPrice": "1.5",
  "lastQuoteFee": "0.01",
  "lastSize": "1000",
  "lastTime": 1704067200000000,
  "marginBonusFeePaid": "200.1",
  "orderId": 1,
  "postOnly": true,
  "price": "1.23",
  "quoteFeePaid": "200.1",
  "reduceOnly": true,
  "revisionId": 1,
  "side": "buy",
  "size": "20.1",
  "status": "new",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "time": 1704067200000000,
  "triggerOrderId": 1,
  "type": "limitGtc",
  "userId": 1
}
NameTypeRequiredDescription
objectYes
.arkmFeePaidstringYesTotal ARKM fee paid so far in the order
.avgPricestringYesAverage price filled so far in the order
.clientOrderIdstringNo
.creditFeePaidstringYesTotal fee paid via credits so far in the order
.executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
.executedSizestringYesTotal quantity filled so far in the order
.lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
.lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
.lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
.lastPricestringYesPrice of the last trade, only present on taker and maker statuses
.lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
.lastSizestringYesSize of the last trade, only present on taker and maker statuses
.lastTimenumberYesTime of the last status update on the order
.marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
.orderIdintegerYes
.postOnlybooleanYesIf true the order is post-only
.pricestringYesThe original price of the order
.quoteFeePaidstringYesTotal quote fee paid so far in the order
.reduceOnlybooleanYesIf true the order is reduce-only
.revisionIdintegerYesAn identifier for the order's current state, unique to the pair
.sidestringYes Enum: "buy", "sell"
.sizestringYesThe original size of the order
.statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
.subaccountIdintegerYes
.symbolstringYes
.timenumberYesTime in microseconds since unix epoch
.triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.userIdintegerYes

#Cancel Order

POST /orders/cancel

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "orderId": 1,
  "subaccountId": 1,
  "timeToCancel": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringNoclient order ID to cancel, required if orderId is not provided
.orderIdintegerNoorder ID to cancel, required if clientOrderId is not provided
.subaccountIdintegerNo Default: 0
.timeToCancelnumberNoTime to cancel the order, 0 for immediate. Granularity is 1 second. Default: 0

Response Body

// Example Response Body
{
  "orderId": 1
}
NameTypeRequiredDescription
objectYes
.orderIdintegerYes

#Cancel and Replace Order

POST /orders/cancel-replace

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "cancelClientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "cancelOrderId": 1,
  "cancelSubaccountId": 1,
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "postOnly": false,
  "price": "1.23",
  "reduceOnly": false,
  "side": "buy",
  "size": "20.1",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "type": "limitGtc"
}
NameTypeRequiredDescription
objectYes
.cancelClientOrderIdstringNoClient Order ID of the order to cancel and replace with the new order
.cancelOrderIdintegerNoID of the order to cancel and replace with the new order
.cancelSubaccountIdintegerNoSubaccount ID of the order to cancel and replace with the new order Default: 0
.clientOrderIdstringYes
.postOnlybooleanYesif true, the order will be closed if it can be matched immediately. Only supported on limit gtc orders. Default: false
.pricestringYeslimit price, 0 for market orders
.reduceOnlybooleanYesif true, the order will only reduce the position size. Default: false
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.subaccountIdintegerYes Default: 0
.symbolstringYes
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

Response Body

// Example Response Body
{
  "cancelResponse": {
    "orderId": 1
  },
  "createResponse": {
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "orderId": 1,
    "price": "1.23",
    "side": "buy",
    "size": "20.1",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "type": "limitGtc"
  }
}
NameTypeRequiredDescription
objectYes
.cancelResponseobjectNo
.cancelResponse.orderIdintegerYes
.createResponseobjectNo
.createResponse.clientOrderIdstringNo
.createResponse.orderIdintegerYes
.createResponse.pricestringYes
.createResponse.sidestringYes Enum: "buy", "sell"
.createResponse.sizestringYes
.createResponse.subaccountIdintegerYes
.createResponse.symbolstringYes
.createResponse.timenumberYesTime in microseconds since unix epoch
.createResponse.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Cancel All

POST /orders/cancel/all

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "subaccountId": 1,
  "timeToCancel": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.subaccountIdintegerYes Default: 0
.timeToCancelnumberYesTime to cancel all orders, 0 for immediate. Granularity is 1 second. Use this to set a dead man's switch. Default: 0

#Get Order History

GET /orders/history

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
symbolquerystringNo
subaccountIdqueryintegerNo Default: 0
limitqueryintegerNo Default: 50
offsetqueryintegerNo Default: 0

Response Body

// Example Response Body
[
  {
    "arkmFeePaid": "20.1",
    "avgPrice": "1.23",
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "creditFeePaid": "200.1",
    "executedNotional": "200.1",
    "executedSize": "20.1",
    "lastArkmFee": "0.01",
    "lastCreditFee": "0.01",
    "lastMarginBonusFee": "0.01",
    "lastPrice": "1.5",
    "lastQuoteFee": "0.01",
    "lastSize": "1000",
    "lastTime": 1704067200000000,
    "marginBonusFeePaid": "200.1",
    "orderId": 1,
    "postOnly": true,
    "price": "1.23",
    "quoteFeePaid": "200.1",
    "reduceOnly": true,
    "revisionId": 1,
    "side": "buy",
    "size": "20.1",
    "status": "new",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "triggerOrderId": 1,
    "type": "limitGtc",
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].arkmFeePaidstringYesTotal ARKM fee paid so far in the order
[*].avgPricestringYesAverage price filled so far in the order
[*].clientOrderIdstringNo
[*].creditFeePaidstringYesTotal fee paid via credits so far in the order
[*].executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
[*].executedSizestringYesTotal quantity filled so far in the order
[*].lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
[*].lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
[*].lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
[*].lastPricestringYesPrice of the last trade, only present on taker and maker statuses
[*].lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
[*].lastSizestringYesSize of the last trade, only present on taker and maker statuses
[*].lastTimenumberYesTime of the last status update on the order
[*].marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
[*].orderIdintegerYes
[*].postOnlybooleanYesIf true the order is post-only
[*].pricestringYesThe original price of the order
[*].quoteFeePaidstringYesTotal quote fee paid so far in the order
[*].reduceOnlybooleanYesIf true the order is reduce-only
[*].revisionIdintegerYesAn identifier for the order's current state, unique to the pair
[*].sidestringYes Enum: "buy", "sell"
[*].sizestringYesThe original size of the order
[*].statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
[*].userIdintegerYes

#Get all order for Client Order Id

GET /orders/history/by-client-order-id

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
clientOrderIdquerystringNo

Response Body

// Example Response Body
[
  {
    "arkmFeePaid": "20.1",
    "avgPrice": "1.23",
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "creditFeePaid": "200.1",
    "executedNotional": "200.1",
    "executedSize": "20.1",
    "lastArkmFee": "0.01",
    "lastCreditFee": "0.01",
    "lastMarginBonusFee": "0.01",
    "lastPrice": "1.5",
    "lastQuoteFee": "0.01",
    "lastSize": "1000",
    "lastTime": 1704067200000000,
    "marginBonusFeePaid": "200.1",
    "orderId": 1,
    "postOnly": true,
    "price": "1.23",
    "quoteFeePaid": "200.1",
    "reduceOnly": true,
    "revisionId": 1,
    "side": "buy",
    "size": "20.1",
    "status": "new",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "triggerOrderId": 1,
    "type": "limitGtc",
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].arkmFeePaidstringYesTotal ARKM fee paid so far in the order
[*].avgPricestringYesAverage price filled so far in the order
[*].clientOrderIdstringNo
[*].creditFeePaidstringYesTotal fee paid via credits so far in the order
[*].executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
[*].executedSizestringYesTotal quantity filled so far in the order
[*].lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
[*].lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
[*].lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
[*].lastPricestringYesPrice of the last trade, only present on taker and maker statuses
[*].lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
[*].lastSizestringYesSize of the last trade, only present on taker and maker statuses
[*].lastTimenumberYesTime of the last status update on the order
[*].marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
[*].orderIdintegerYes
[*].postOnlybooleanYesIf true the order is post-only
[*].pricestringYesThe original price of the order
[*].quoteFeePaidstringYesTotal quote fee paid so far in the order
[*].reduceOnlybooleanYesIf true the order is reduce-only
[*].revisionIdintegerYesAn identifier for the order's current state, unique to the pair
[*].sidestringYes Enum: "buy", "sell"
[*].sizestringYesThe original size of the order
[*].statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
[*].userIdintegerYes

#Get Total Orders

GET /orders/history_offset

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
symbolquerystringNo
subaccountIdqueryintegerNo Default: 0
limitqueryintegerNo Default: 50
offsetqueryintegerNo Default: 0

Response Body

// Example Response Body
{
  "orders": [
    {
      "arkmFeePaid": "20.1",
      "avgPrice": "1.23",
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "creditFeePaid": "200.1",
      "executedNotional": "200.1",
      "executedSize": "20.1",
      "lastArkmFee": "0.01",
      "lastCreditFee": "0.01",
      "lastMarginBonusFee": "0.01",
      "lastPrice": "1.5",
      "lastQuoteFee": "0.01",
      "lastSize": "1000",
      "lastTime": 1704067200000000,
      "marginBonusFeePaid": "200.1",
      "orderId": 1,
      "postOnly": true,
      "price": "1.23",
      "quoteFeePaid": "200.1",
      "reduceOnly": true,
      "revisionId": 1,
      "side": "buy",
      "size": "20.1",
      "status": "new",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "time": 1704067200000000,
      "triggerOrderId": 1,
      "type": "limitGtc",
      "userId": 1
    }
  ],
  "total": 1
}
NameTypeRequiredDescription
objectYes
.ordersarrayYes
.orders[*]object-
.orders[*].arkmFeePaidstringYesTotal ARKM fee paid so far in the order
.orders[*].avgPricestringYesAverage price filled so far in the order
.orders[*].clientOrderIdstringNo
.orders[*].creditFeePaidstringYesTotal fee paid via credits so far in the order
.orders[*].executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
.orders[*].executedSizestringYesTotal quantity filled so far in the order
.orders[*].lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
.orders[*].lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
.orders[*].lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
.orders[*].lastPricestringYesPrice of the last trade, only present on taker and maker statuses
.orders[*].lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
.orders[*].lastSizestringYesSize of the last trade, only present on taker and maker statuses
.orders[*].lastTimenumberYesTime of the last status update on the order
.orders[*].marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
.orders[*].orderIdintegerYes
.orders[*].postOnlybooleanYesIf true the order is post-only
.orders[*].pricestringYesThe original price of the order
.orders[*].quoteFeePaidstringYesTotal quote fee paid so far in the order
.orders[*].reduceOnlybooleanYesIf true the order is reduce-only
.orders[*].revisionIdintegerYesAn identifier for the order's current state, unique to the pair
.orders[*].sidestringYes Enum: "buy", "sell"
.orders[*].sizestringYesThe original size of the order
.orders[*].statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
.orders[*].subaccountIdintegerYes
.orders[*].symbolstringYes
.orders[*].timenumberYesTime in microseconds since unix epoch
.orders[*].triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
.orders[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.orders[*].userIdintegerYes
.totalintegerYes

#Create Order

POST /orders/new

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "postOnly": false,
  "price": "1.23",
  "reduceOnly": false,
  "side": "buy",
  "size": "20.1",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "type": "limitGtc"
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringYes
.postOnlybooleanYesif true, the order will be closed if it can be matched immediately. Only supported on limit gtc orders. Default: false
.pricestringYeslimit price, 0 for market orders
.reduceOnlybooleanYesif true, the order will only reduce the position size. Default: false
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.subaccountIdintegerYes Default: 0
.symbolstringYes
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

Response Body

// Example Response Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "orderId": 1,
  "price": "1.23",
  "side": "buy",
  "size": "20.1",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "time": 1704067200000000,
  "type": "limitGtc"
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringNo
.orderIdintegerYes
.pricestringYes
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.subaccountIdintegerYes
.symbolstringYes
.timenumberYesTime in microseconds since unix epoch
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Create Multiple Orders

POST /orders/new/batch

Orders are processed sequentially and returned in the same order as the input requests.

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "orders": [
    {
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "postOnly": false,
      "price": "1.23",
      "reduceOnly": false,
      "side": "buy",
      "size": "20.1",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "type": "limitGtc"
    }
  ]
}
NameTypeRequiredDescription
objectYes
.ordersarrayYes
.orders[*]object-
.orders[*].clientOrderIdstringYes
.orders[*].postOnlybooleanYesif true, the order will be closed if it can be matched immediately. Only supported on limit gtc orders. Default: false
.orders[*].pricestringYeslimit price, 0 for market orders
.orders[*].reduceOnlybooleanYesif true, the order will only reduce the position size. Default: false
.orders[*].sidestringYes Enum: "buy", "sell"
.orders[*].sizestringYes
.orders[*].subaccountIdintegerYes Default: 0
.orders[*].symbolstringYes
.orders[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

Response Body

// Example Response Body
{
  "orders": [
    {
      "orderId": 1,
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "symbol": "BTC_USDT",
      "subaccountId": 0,
      "side": "buy",
      "type": "limitGtc",
      "size": "20.1",
      "price": "1.23"
    },
    {
      "clientOrderId": "123e4567-e89b-12d3-a456-426614174001",
      "symbol": "BTC_USDT",
      "subaccountId": 0,
      "side": "buy",
      "type": "limitGtc",
      "size": "20.1",
      "price": "0",
      "error": {
        "id": 30002,
        "name": "InvalidPrice",
        "message": "price must be greater than 0"
      }
    }
  ]
}
NameTypeRequiredDescription
objectYes
.ordersarrayYes
.orders[*]object-
.orders[*].clientOrderIdstringNo
.orders[*].errorobjectNo
.orders[*].error.idnumberYesThe unique identifier for the error
.orders[*].error.messagestringYesAdditional details about the error
.orders[*].error.namestringYesThe name of the error Enum: "InternalError", "BadRequest", "Unauthorized", "InvalidSymbol", "SymbolRequired", "RateLimitExceeded", "Forbidden", "InvalidIP", "Throttled", "KeyNotPermitted", "ParsingKey", "VerifyingKey", "RequiresRead", "RequiresWrite", "SignatureMissing", "ExpiresMissing", "ParsingExpires", "ExpiresTooFar", "ExpiredSignature", "SignatureMismatch", "IPNotAllowed", "MFA", "ParsingRequest", "SubaccountNotFound", "Conflict", "NotFound", "InvalidMethod", "MethodRequired", "InvalidChannel", "ChannelRequired", "InvalidGroup", "InvalidSize", "InvalidPrice", "InvalidPostOnly", "InvalidReduceOnly", "InvalidNotional", "UnknownOrderType", "PairNotEnabled", "TradingFreeze", "PostOnly", "InsufficientBalance", "InvalidPair", "NoMarkPrice", "InsufficientLiquidity", "ClientOrderIdAlreadyExists", "ClientOrderIdNotFound", "ReduceOnlyInvalid", "UnsupportedOrderSide", "UnsupportedAssetType", "PositionLimit", "InvalidClientOrderID", "InvalidTriggerType", "InvalidTriggerPriceType", "InvalidOrderSide", "InvalidOrderType", "InvalidBrokerId", "UserFrozen", "UserDeleted", "OrderIdNotFound", "FailedRiskCheck", "MemoNotSupported", "InvalidWithdrawalAddress", "PositionNotFound", "InvalidChain", "FuturesNotEnabled", "SubaccountHasOpenFuturePositions", "LspAssignmentGreaterThanMaxNotional", "LspMaxNotionalGreaterThanMarginLimit", "LspMaxNotionalMustNotBeNegative", "PortfolioLiquidation", "NegativeAmount", "ZeroAmount", "InvalidAlertType", "InvalidAlertPriceType", "InvalidVoucherStatus", "InvalidCandleDuration", "InvalidNotificationType", "TooManyMFAAttempts", "InvalidMFA", "TooManyAttempts", "InvalidRole"
.orders[*].orderIdintegerNo
.orders[*].pricestringYes
.orders[*].sidestringYes Enum: "buy", "sell"
.orders[*].sizestringYes
.orders[*].subaccountIdintegerYes
.orders[*].symbolstringYes
.orders[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Create Simple Order

POST /orders/new/simple

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "side": "buy",
  "size": "20.1",
  "subaccountId": 1,
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.subaccountIdintegerYes Default: 0
.symbolstringYes

Response Body

// Example Response Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "orderId": 1,
  "price": "1.23",
  "side": "buy",
  "size": "20.1",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "time": 1704067200000000,
  "type": "limitGtc"
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringNo
.orderIdintegerYes
.pricestringYes
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.subaccountIdintegerYes
.symbolstringYes
.timenumberYesTime in microseconds since unix epoch
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Get Order By Id

GET /orders/{id}

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
idpathintegerYes

Response Body

// Example Response Body
{
  "arkmFeePaid": "20.1",
  "avgPrice": "1.23",
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "creditFeePaid": "200.1",
  "executedNotional": "200.1",
  "executedSize": "20.1",
  "lastArkmFee": "0.01",
  "lastCreditFee": "0.01",
  "lastMarginBonusFee": "0.01",
  "lastPrice": "1.5",
  "lastQuoteFee": "0.01",
  "lastSize": "1000",
  "lastTime": 1704067200000000,
  "marginBonusFeePaid": "200.1",
  "orderId": 1,
  "postOnly": true,
  "price": "1.23",
  "quoteFeePaid": "200.1",
  "reduceOnly": true,
  "revisionId": 1,
  "side": "buy",
  "size": "20.1",
  "status": "new",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "time": 1704067200000000,
  "triggerOrderId": 1,
  "type": "limitGtc",
  "userId": 1
}
NameTypeRequiredDescription
objectYes
.arkmFeePaidstringYesTotal ARKM fee paid so far in the order
.avgPricestringYesAverage price filled so far in the order
.clientOrderIdstringNo
.creditFeePaidstringYesTotal fee paid via credits so far in the order
.executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
.executedSizestringYesTotal quantity filled so far in the order
.lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
.lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
.lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
.lastPricestringYesPrice of the last trade, only present on taker and maker statuses
.lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
.lastSizestringYesSize of the last trade, only present on taker and maker statuses
.lastTimenumberYesTime of the last status update on the order
.marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
.orderIdintegerYes
.postOnlybooleanYesIf true the order is post-only
.pricestringYesThe original price of the order
.quoteFeePaidstringYesTotal quote fee paid so far in the order
.reduceOnlybooleanYesIf true the order is reduce-only
.revisionIdintegerYesAn identifier for the order's current state, unique to the pair
.sidestringYes Enum: "buy", "sell"
.sizestringYesThe original size of the order
.statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
.subaccountIdintegerYes
.symbolstringYes
.timenumberYesTime in microseconds since unix epoch
.triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.userIdintegerYes

Trades#

#Get User Trades

GET /trades

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
symbolquerystringNo
subaccountIdqueryintegerNo Default: 0
beforequeryintegerNo
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "arkmFee": "20.1",
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "orderId": 1,
    "price": "1.23",
    "quoteFee": "200.1",
    "revisionId": 1,
    "size": "20.1",
    "symbol": "BTC_USDT",
    "takerSide": "buy",
    "time": 1704067200000000,
    "userSide": "buy"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].arkmFeestringYes
[*].clientOrderIdstringYes
[*].orderIdintegerYes
[*].pricestringYes
[*].quoteFeestringYes
[*].revisionIdintegerYes
[*].sizestringYes
[*].symbolstringYes
[*].takerSidestringYes Enum: "buy", "sell"
[*].timenumberYesTime in microseconds since unix epoch
[*].userSidestringYes Enum: "buy", "sell"

#Get User Trades History

GET /trades/history

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
symbolquerystringNo
subaccountIdqueryintegerNo Default: 0
limitqueryintegerNo Default: 50
offsetqueryintegerNo Default: 0

Response Body

// Example Response Body
{
  "total": 1,
  "trades": [
    {
      "arkmFee": "20.1",
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "orderId": 1,
      "price": "1.23",
      "quoteFee": "200.1",
      "revisionId": 1,
      "size": "20.1",
      "symbol": "BTC_USDT",
      "takerSide": "buy",
      "time": 1704067200000000,
      "userSide": "buy"
    }
  ]
}
NameTypeRequiredDescription
objectYes
.totalintegerYes
.tradesarrayYes
.trades[*]object-
.trades[*].arkmFeestringYes
.trades[*].clientOrderIdstringYes
.trades[*].orderIdintegerYes
.trades[*].pricestringYes
.trades[*].quoteFeestringYes
.trades[*].revisionIdintegerYes
.trades[*].sizestringYes
.trades[*].symbolstringYes
.trades[*].takerSidestringYes Enum: "buy", "sell"
.trades[*].timenumberYesTime in microseconds since unix epoch
.trades[*].userSidestringYes Enum: "buy", "sell"

#Get User Trades By Time

GET /trades/time

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
fromquerynumberNotime from, inclusive
toquerynumberNotime to, inclusive
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "arkmFee": "20.1",
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "orderId": 1,
    "price": "1.23",
    "quoteFee": "200.1",
    "revisionId": 1,
    "size": "20.1",
    "symbol": "BTC_USDT",
    "takerSide": "buy",
    "time": 1704067200000000,
    "userSide": "buy"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].arkmFeestringYes
[*].clientOrderIdstringYes
[*].orderIdintegerYes
[*].pricestringYes
[*].quoteFeestringYes
[*].revisionIdintegerYes
[*].sizestringYes
[*].symbolstringYes
[*].takerSidestringYes Enum: "buy", "sell"
[*].timenumberYesTime in microseconds since unix epoch
[*].userSidestringYes Enum: "buy", "sell"

Trigger Orders#

#Get Trigger Orders

GET /trigger-orders

Get all trigger orders for the authenticated user.

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0

Response Body

// Example Response Body
[
  {
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "postOnly": true,
    "price": "1.23",
    "reduceOnly": true,
    "side": "buy",
    "size": "20.1",
    "status": "staged",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "triggerOrderId": 1,
    "triggerPrice": "1.23",
    "triggerPriceType": "last",
    "triggerType": "takeProfit",
    "type": "limitGtc"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].clientOrderIdstringYes
[*].postOnlybooleanYes
[*].pricestringYes
[*].reduceOnlybooleanYes
[*].sidestringYes Enum: "buy", "sell"
[*].sizestringYes
[*].statusstringYes Enum: "staged", "triggered", "cancelled"
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].triggerOrderIdintegerYes
[*].triggerPricestringYes
[*].triggerPriceTypestringYes Enum: "last", "mark", "index"
[*].triggerTypestringYes Enum: "takeProfit", "stopLoss"
[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Cancel Trigger Order

POST /trigger-orders/cancel

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "triggerOrderId": 1
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringNo
.subaccountIdintegerNo Default: 0
.symbolstringYes
.triggerOrderIdintegerNo
.triggerPriceTypeNo

Response Body

// Example Response Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "triggerOrderId": 1
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringNo
.subaccountIdintegerNo Default: 0
.symbolstringYes
.triggerOrderIdintegerNo
.triggerPriceTypeNo

#Cancel AllTrigger Orders

POST /trigger-orders/cancel/all

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "subaccountId": 1,
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.subaccountIdintegerYes
.symbolstringYes
.triggerPriceTypeYes

Response Body

// Example Response Body
{
  "subaccountId": 1,
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.subaccountIdintegerYes
.symbolstringYes
.triggerPriceTypeYes

#Create Trigger Order

POST /trigger-orders/new

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
  "postOnly": false,
  "price": "1.23",
  "reduceOnly": false,
  "side": "buy",
  "size": "20.1",
  "subaccountId": 1,
  "symbol": "BTC_USDT",
  "triggerPrice": "1.23",
  "triggerPriceType": "last",
  "triggerType": "takeProfit",
  "type": "limitGtc"
}
NameTypeRequiredDescription
objectYes
.clientOrderIdstringYes
.postOnlybooleanYesif true, the order will be closed if it can be matched immediately. Only supported on limit gtc orders. Default: false
.pricestringYeslimit price, 0 for market orders
.reduceOnlybooleanYesif true, the order will only reduce the position size. Default: false
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.subaccountIdintegerYes Default: 0
.symbolstringYes
.triggerPricestringYes
.triggerPriceTypestringYes Enum: "last", "mark", "index"
.triggerTypestringYes Enum: "takeProfit", "stopLoss"
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

Response Body

// Example Response Body
{
  "price": "1.23",
  "side": "buy",
  "size": "20.1",
  "symbol": "BTC_USDT",
  "triggerOrderId": 1,
  "type": "limitGtc"
}
NameTypeRequiredDescription
objectYes
.pricestringYes
.sidestringYes Enum: "buy", "sell"
.sizestringYes
.symbolstringYes
.triggerOrderIdintegerYes
.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

Account#

#Get Airdrops

GET /account/airdrops

Get the user's airdrops

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "assetSymbol": "BTC",
    "id": 1,
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].assetSymbolstringYes
[*].idintegerYes
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch
[*].userIdintegerYes

#Get Balance Updates

GET /account/balance-updates

Get the user's balance updates

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
reasonquerystringNo Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "assetSymbol": "BTC",
    "balance": "20.1",
    "id": 1,
    "reason": "orderFill",
    "subaccountId": 1,
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].assetSymbolstringYes
[*].balancestringYes
[*].idintegerYes
[*].reasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch

#Get Balances

GET /account/balances

Get the user's current balances

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0

Response Body

// Example Response Body
[
  {
    "balance": "20.1",
    "balanceUSDT": "200.1",
    "free": "20.1",
    "freeUSDT": "200.1",
    "lastUpdateAmount": "20.1",
    "lastUpdateId": 1,
    "lastUpdateReason": "orderFill",
    "lastUpdateTime": 1704067200000000,
    "priceUSDT": "1.23",
    "subaccountId": 1,
    "symbol": "BTC"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].balancestringYes
[*].balanceUSDTstringYes
[*].freestringYes
[*].freeUSDTstringYes
[*].lastUpdateAmountstringYes
[*].lastUpdateIdintegerYes
[*].lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
[*].lastUpdateTimenumberYesTime in microseconds since unix epoch
[*].priceUSDTstringYes
[*].subaccountIdintegerYes
[*].symbolstringYes

#Get Balances across all subaccounts

GET /account/balances/all

Get the user's current balances across all subaccounts

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "balance": "20.1",
    "balanceUSDT": "200.1",
    "free": "20.1",
    "freeUSDT": "200.1",
    "lastUpdateAmount": "20.1",
    "lastUpdateId": 1,
    "lastUpdateReason": "orderFill",
    "lastUpdateTime": 1704067200000000,
    "priceUSDT": "1.23",
    "subaccountId": 1,
    "symbol": "BTC"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].balancestringYes
[*].balanceUSDTstringYes
[*].freestringYes
[*].freeUSDTstringYes
[*].lastUpdateAmountstringYes
[*].lastUpdateIdintegerYes
[*].lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
[*].lastUpdateTimenumberYesTime in microseconds since unix epoch
[*].priceUSDTstringYes
[*].subaccountIdintegerYes
[*].symbolstringYes

#Get User Subaccount Balance History

GET /account/balances/history

Get the balance history for a subaccount

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
startquerynumberNoTime in microseconds since unix epoch
endquerynumberNoTime in microseconds since unix epoch

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].timenumberYesTime in microseconds since unix epoch

#Get Commissions

GET /account/commissions

Get the user's commissions

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
limitqueryintegerNo Default: 100

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "assetSymbol": "BTC",
    "id": 1,
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].assetSymbolstringYes
[*].idintegerYes
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch
[*].userIdintegerYes

#Get Deposit Addresses

GET /account/deposit/addresses

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
chainquerystringYes

Response Body

// Example Response Body
{
  "addresses": [
    "abc123"
  ]
}
NameTypeRequiredDescription
objectYes
.addressesarrayYes
.addresses[*]string-

#Create Deposit Address

POST /account/deposit/addresses/new

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "chain": "abc123",
  "subaccountId": 1
}
NameTypeRequiredDescription
objectYes
.chainstringYes
.subaccountIdintegerYes Default: 0

Response Body

// Example Response Body
{
  "address": "abc123"
}
NameTypeRequiredDescription
objectYes
.addressstringYes

#Get Deposits

GET /account/deposits

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
beforequeryintegerNo
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "chain": "abc123",
    "confirmed": true,
    "depositAddress": "abc123",
    "id": 1,
    "price": "1.23",
    "symbol": "BTC",
    "time": 1704067200000000,
    "transactionHash": "abc123"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].chainstringYes
[*].confirmedbooleanYes
[*].depositAddressstringYes
[*].idintegerYes
[*].pricestringYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].transactionHashstringYes

#Get User Fees

GET /account/fees

Get the user's current trading fees

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "perpMakerFee": "1.23",
  "perpTakerFee": "1.23",
  "spotMakerFee": "1.23",
  "spotTakerFee": "1.23"
}
NameTypeRequiredDescription
objectYes
.perpMakerFeestringYes
.perpTakerFeestringYes
.spotMakerFeestringYes
.spotTakerFeestringYes

#Get Funding Rate Payments

GET /account/funding-rate-payments

Get the user's funding rate payments

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
limitqueryintegerNo Default: 100

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "assetSymbol": "BTC",
    "id": 1,
    "indexPrice": "1.23",
    "pairSymbol": "BTC_USDT",
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].assetSymbolstringYes
[*].idintegerYes
[*].indexPricestringYes
[*].pairSymbolstringYes
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch
[*].userIdintegerYes

#Get Position Limits

GET /account/leverage

Gets the user specified position leverage

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo

Response Body

// Example Response Body
[
  {
    "leverage": "1.23",
    "symbol": "BTC_USDT"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].leveragestringYes
[*].symbolstringYes

#Get Position Limits

POST /account/leverage

Sets the user specified position leverage for a given pair

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "leverage": "1.23",
  "subaccountId": 1,
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.leveragestringYes
.subaccountIdintegerNo
.symbolstringYes

#Get Liquidation Price

GET /account/liquidation-price

Get liquidation price for a perpetual position

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
symbolquerystringNo

Response Body

// Example Response Body
{
  "price": "1.23",
  "subaccountId": 1,
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.pricestringNo
.subaccountIdintegerYes
.symbolstringYes

#Get LSP Assignments

GET /account/lsp-assignments

Get the user's lsp assignments

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
limitqueryintegerNo Default: 100

Response Body

// Example Response Body
[
  {
    "base": "20.1",
    "id": 1,
    "pairSymbol": "BTC_USDT",
    "price": "1.23",
    "quote": "200.1",
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].basestringYes
[*].idintegerYes
[*].pairSymbolstringYes
[*].pricestringYes
[*].quotestringYes
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch
[*].userIdintegerYes

#Get Account Margin

GET /account/margin

Get the user's current margin usage details

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0

Response Body

// Example Response Body
{
  "available": "5000",
  "bonus": "100",
  "initial": "1000",
  "liquidation": "400",
  "locked": "1000",
  "maintenance": "600",
  "pnl": "100",
  "subaccountId": 1,
  "total": "6000",
  "totalAssetValue": "1.0"
}
NameTypeRequiredDescription
objectYes
.availablestringYesTotal margin available for opening new positions
.bonusstringYesTotal margin bonus
.initialstringYesInitial margin required to open a position
.liquidationstringYesAmount of Margin required to prevent portfolio liquidations
.lockedstringYesTotal margin locked due to open positions and open orders
.maintenancestringYesAmount of Margin required to prevent partial liquidations
.pnlstringYesTotal unrealized PnL
.subaccountIdintegerYes
.totalstringYesTotal margin in the account, includes unrealized PnL
.totalAssetValuestringYesTotal value of all assets in the account in USDT

#Get Account Margin across all subaccounts

GET /account/margin/all

Get the user's current margin usage details

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "available": "5000",
    "bonus": "100",
    "initial": "1000",
    "liquidation": "400",
    "locked": "1000",
    "maintenance": "600",
    "pnl": "100",
    "subaccountId": 1,
    "total": "6000",
    "totalAssetValue": "1.0"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].availablestringYesTotal margin available for opening new positions
[*].bonusstringYesTotal margin bonus
[*].initialstringYesInitial margin required to open a position
[*].liquidationstringYesAmount of Margin required to prevent portfolio liquidations
[*].lockedstringYesTotal margin locked due to open positions and open orders
[*].maintenancestringYesAmount of Margin required to prevent partial liquidations
[*].pnlstringYesTotal unrealized PnL
[*].subaccountIdintegerYes
[*].totalstringYesTotal margin in the account, includes unrealized PnL
[*].totalAssetValuestringYesTotal value of all assets in the account in USDT

#Get Notifications

GET /account/notifications

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
typequerystringNo Enum: "announcement", "order", "price", "margin", "deposit", "withdrawal", "deleverage", "rebate", "commission", "adjustment", "airdrop", "reward", "expiration"
limitqueryintegerNo Default: 50
offsetqueryintegerNo Default: 0

Response Body

// Example Response Body
[
  {
    "id": 1,
    "isRead": true,
    "message": "abc123",
    "orderId": 1,
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "title": "abc123",
    "type": "announcement"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].idintegerYes
[*].isReadbooleanYes
[*].messagestringYes
[*].orderIdintegerNo
[*].subaccountIdintegerYes
[*].symbolstringNo
[*].timenumberYesTime in microseconds since unix epoch
[*].titlestringYes
[*].typestringYes Enum: "announcement", "order", "price", "margin", "deposit", "withdrawal", "deleverage", "rebate", "commission", "adjustment", "airdrop", "reward", "expiration"

#Mark Notifications Read

POST /account/notifications/read

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "lastReadTime": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.lastReadTimenumberYesTime in microseconds since unix epoch

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Get Position Updates

GET /account/position-updates

Get the user's position updates

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
reasonquerystringNo Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "avgEntryPrice": "1.23",
    "base": "20.1",
    "baseDelta": "20.1",
    "id": 1,
    "pairSymbol": "BTC_USDT",
    "quote": "200.1",
    "quoteDelta": "200.1",
    "reason": "orderFill",
    "subaccountId": 1,
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].avgEntryPricestringYes
[*].basestringYes
[*].baseDeltastringYes
[*].idintegerYes
[*].pairSymbolstringYes
[*].quotestringYes
[*].quoteDeltastringYes
[*].reasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch

#Get Positions

GET /account/positions

Get list of the current positions

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0

Response Body

// Example Response Body
[
  {
    "averageEntryPrice": "67992.60",
    "base": "1",
    "breakEvenPrice": "1.23",
    "initialMargin": "200.1",
    "lastUpdateBaseDelta": "20.1",
    "lastUpdateId": 1,
    "lastUpdateQuoteDelta": "200.1",
    "lastUpdateReason": "orderFill",
    "lastUpdateTime": 1704067200000000,
    "maintenanceMargin": "200.1",
    "markPrice": "1.23",
    "openBuyNotional": "200.1",
    "openBuySize": "20.1",
    "openSellNotional": "200.1",
    "openSellSize": "20.1",
    "pnl": "200.1",
    "quote": "-67992.60",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "value": "200.1"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].averageEntryPricestringYes
[*].basestringYes
[*].breakEvenPricestringNo
[*].initialMarginstringYes
[*].lastUpdateBaseDeltastringYes
[*].lastUpdateIdintegerYes
[*].lastUpdateQuoteDeltastringYes
[*].lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
[*].lastUpdateTimenumberYesTime in microseconds since unix epoch
[*].maintenanceMarginstringYes
[*].markPricestringYes
[*].openBuyNotionalstringYes
[*].openBuySizestringYes
[*].openSellNotionalstringYes
[*].openSellSizestringYes
[*].pnlstringYes
[*].quotestringYes
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].valuestringYes

#Get Realized PnL

GET /account/realized-pnl

Get the user's realized pnl

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
limitqueryintegerNo Default: 100

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "assetSymbol": "BTC",
    "id": 1,
    "pairSymbol": "BTC_USDT",
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].assetSymbolstringYes
[*].idintegerYes
[*].pairSymbolstringYes
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch
[*].userIdintegerYes

#Get Rebates

GET /account/rebates

Get the user's rebates

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo
beforequeryintegerNo
limitqueryintegerNo Default: 100

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "assetSymbol": "BTC",
    "id": 1,
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].assetSymbolstringYes
[*].idintegerYes
[*].subaccountIdintegerYes
[*].timenumberYesTime in microseconds since unix epoch
[*].userIdintegerYes

#Get Referral Links

GET /account/referral-links

Get the user's referral links

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "createdAt": 1704067200000000,
    "deletedAt": 1704067200000000,
    "id": "abc123",
    "lastUsedAt": 1704067200000000,
    "slug": "abc123",
    "uses": 1
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].createdAtnumberYesTime in microseconds since unix epoch
[*].deletedAtnumberNoTime in microseconds since unix epoch
[*].idstringYes
[*].lastUsedAtnumberNoTime in microseconds since unix epoch
[*].slugstringNo
[*].usesintegerYes

#Create Referral Link

POST /account/referral-links

Create a referral link for the user

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "linkId": [
    1
  ]
}
NameTypeRequiredDescription
objectYes
.linkIdarrayYes
.linkId[*]integer-

#Update Referral Link Slug

PUT /account/referral-links/{id}/slug

Update the slug for a referral link

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request Body

// Example Request Body
{
  "slug": "abc123"
}
NameTypeRequiredDescription
objectYes
.slugstringYes

#Get Active Sessions

GET /account/sessions

Get the user's active sessions

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "currentSession": 1,
  "sessions": [
    {
      "createdAt": "abc123",
      "deletedAt": "abc123",
      "expiresAt": "abc123",
      "id": 1,
      "ipAddress": "abc123",
      "ipApproved": true,
      "ipInfo": {
        "location": {
          "city": "abc123",
          "country": "abc123",
          "latitude": 1.23,
          "longitude": 1.23,
          "postalCode": "abc123",
          "region": "abc123",
          "timezone": "abc123"
        },
        "privacy": {
          "hosting": true,
          "proxy": true,
          "relay": true,
          "service": "abc123",
          "tor": true,
          "vpn": true
        }
      },
      "lastMfaAt": "abc123",
      "lastUsedAt": "abc123",
      "maxExpiration": "abc123",
      "updatedAt": "abc123",
      "userAgent": "abc123",
      "userId": 1
    }
  ]
}
NameTypeRequiredDescription
objectYes
.currentSessionintegerYes
.sessionsarrayYes
.sessions[*]object-
.sessions[*].createdAtstringYes Format: date-time
.sessions[*].deletedAtstringNo Format: date-time
.sessions[*].expiresAtstringYes Format: date-time
.sessions[*].idintegerYes
.sessions[*].ipAddressstringYes
.sessions[*].ipApprovedbooleanYes
.sessions[*].ipInfoobjectYes
.sessions[*].ipInfo.locationobjectYes
.sessions[*].ipInfo.location.citystringNo
.sessions[*].ipInfo.location.countrystringNo
.sessions[*].ipInfo.location.latitudenumberNo
.sessions[*].ipInfo.location.longitudenumberNo
.sessions[*].ipInfo.location.postalCodestringNo
.sessions[*].ipInfo.location.regionstringNo
.sessions[*].ipInfo.location.timezonestringNo
.sessions[*].ipInfo.privacyobjectYes
.sessions[*].ipInfo.privacy.hostingbooleanYes
.sessions[*].ipInfo.privacy.proxybooleanYes
.sessions[*].ipInfo.privacy.relaybooleanYes
.sessions[*].ipInfo.privacy.servicestringNo
.sessions[*].ipInfo.privacy.torbooleanYes
.sessions[*].ipInfo.privacy.vpnbooleanYes
.sessions[*].lastMfaAtstringNo Format: date-time
.sessions[*].lastUsedAtstringYes Format: date-time
.sessions[*].maxExpirationstringNo Format: date-time
.sessions[*].updatedAtstringYes Format: date-time
.sessions[*].userAgentstringYes
.sessions[*].userIdintegerYes

#Delete Session

POST /account/sessions/delete

Delete a session for the user

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "sessionId": 1
}
NameTypeRequiredDescription
objectYes
.sessionIdintegerYes

#Terminate All Sessions

POST /account/sessions/terminate-all

Terminate all sessions for the user

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

#Get User Settings

GET /account/settings

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "allowSequenceEmails": true,
  "autogenDepositAddresses": true,
  "confirmBeforePlaceOrder": true,
  "hideBalances": true,
  "language": "en",
  "marginUsageThreshold": 1.23,
  "notifyAnnouncements": true,
  "notifyCommissions": true,
  "notifyDeposits": true,
  "notifyMarginUsage": true,
  "notifyOrderFills": true,
  "notifyRebates": true,
  "notifySendEmail": true,
  "notifyWithdrawals": true,
  "tickerTapeScroll": true,
  "updatesFlash": true
}
NameTypeRequiredDescription
objectYes
.allowSequenceEmailsbooleanYes
.autogenDepositAddressesbooleanYes
.confirmBeforePlaceOrderbooleanYes
.hideBalancesbooleanYes
.languagestringNo Enum: "en", "zh", "vi", "uk", "es"
.marginUsageThresholdnumberYes
.notifyAnnouncementsbooleanYes
.notifyCommissionsbooleanYes
.notifyDepositsbooleanYes
.notifyMarginUsagebooleanYes
.notifyOrderFillsbooleanYes
.notifyRebatesbooleanYes
.notifySendEmailbooleanYes
.notifyWithdrawalsbooleanYes
.tickerTapeScrollbooleanYes
.updatesFlashbooleanYes

#Get Price Alerts

GET /account/settings/price-alert

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
symbolquerystringNo

Response Body

// Example Response Body
{
  "alertPrice": "1.23",
  "alertPriceType": "last",
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.alertPricestringYes
.alertPriceTypestringYes Enum: "last", "mark", "index"
.symbolstringYes

#Set Price Alert

PUT /account/settings/price-alert

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
symbolquerystringNo

Request Body

// Example Request Body
{
  "alertPrice": "1.23",
  "alertPriceType": "last",
  "alertType": "above"
}
NameTypeRequiredDescription
objectYes
.alertPricestringYes
.alertPriceTypestringYes Enum: "last", "mark", "index"
.alertTypestringYes Enum: "above", "below"

#Delete Price Alert

DELETE /account/settings/price-alert

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
symbolquerystringNo

#Update User Settings

POST /account/settings/update

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "allowSequenceEmails": true,
  "autogenDepositAddresses": true,
  "confirmBeforePlaceOrder": true,
  "hideBalances": true,
  "language": "en",
  "marginUsageThreshold": 1.23,
  "notifyAnnouncements": true,
  "notifyCommissions": true,
  "notifyDeposits": true,
  "notifyMarginUsage": true,
  "notifyOrderFills": true,
  "notifyRebates": true,
  "notifySendEmail": true,
  "notifyWithdrawals": true,
  "tickerTapeScroll": true,
  "updatesFlash": true
}
NameTypeRequiredDescription
objectYes
.allowSequenceEmailsbooleanNo
.autogenDepositAddressesbooleanNo
.confirmBeforePlaceOrderbooleanNo
.hideBalancesbooleanNo
.languagestringNo Enum: "en", "zh", "vi", "uk", "es"
.marginUsageThresholdnumberNo
.notifyAnnouncementsbooleanNo
.notifyCommissionsbooleanNo
.notifyDepositsbooleanNo
.notifyMarginUsagebooleanNo
.notifyOrderFillsbooleanNo
.notifyRebatesbooleanNo
.notifySendEmailbooleanNo
.notifyWithdrawalsbooleanNo
.tickerTapeScrollbooleanNo
.updatesFlashbooleanNo

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Get Transfers

GET /account/transfers

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
beforequeryintegerNo
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "counterparty": 1,
    "id": 1,
    "subaccountId": 1,
    "symbol": "BTC",
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYesAmount of asset transferred, negative if sent, positive if received.
[*].counterpartyintegerYes
[*].idintegerYes
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch

#Unsubscribe from Reminder Emails

GET /account/unsubscribe

Unsubscribe from reminder emails using the link from an email

Parameters

NameInTypeRequiredDescription
linkIdquerystringYes

#Get Watchlist

GET /account/watchlist

Get a list of the pairs in your watchlist

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  "BTC_USDT"
]
NameTypeRequiredDescription
arrayYes
[*]string-

#Add to Watchlist

POST /account/watchlist/add

Add a pair to the watchlist

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.symbolstringYes

#Remove from Watchlist

POST /account/watchlist/remove

Remove a pair from your watchlise

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "symbol": "BTC_USDT"
}
NameTypeRequiredDescription
objectYes
.symbolstringYes

#Account Withdraw

POST /account/withdraw

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "addressId": 1,
  "amount": "20.1",
  "beneficiary": {
    "firstName": "abc123",
    "isSelf": true,
    "isVasp": true,
    "lastName": "abc123"
  },
  "subaccountId": 1,
  "symbol": "BTC"
}
NameTypeRequiredDescription
objectYes
.addressIdintegerYes
.amountstringYes
.beneficiaryobjectNo
.beneficiary.firstNamestringNo
.beneficiary.isSelfbooleanYes
.beneficiary.isVaspbooleanNo
.beneficiary.lastNamestringNo
.subaccountIdintegerYes Default: 0
.symbolstringYes

Response Body

// Example Response Body
1
NameTypeRequiredDescription
integerYes

#List Withdrawal Addresses

GET /account/withdrawal/addresses

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "address": "abc123",
    "chain": "abc123",
    "confirmed": true,
    "createdAt": 1704067200000000,
    "hasBeneficiary": true,
    "id": 1,
    "label": "abc123",
    "updatedAt": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].addressstringYes
[*].chainstringYes
[*].confirmedbooleanYes
[*].createdAtnumberYesTime in microseconds since unix epoch
[*].hasBeneficiarybooleanYes
[*].idintegerYes
[*].labelstringYes
[*].updatedAtnumberYesTime in microseconds since unix epoch

#Create Withdrawal Address

POST /account/withdrawal/addresses

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "address": "abc123",
  "chain": "abc123",
  "label": "abc123",
  "memo": 1
}
NameTypeRequiredDescription
objectYes
.addressstringYes
.chainstringYes
.labelstringYes
.memointegerNo

Response Body

// Example Response Body
1
NameTypeRequiredDescription
integerYes

#Confirm Withdrawal Address

POST /account/withdrawal/addresses/confirm

Request Body

// Example Request Body
{
  "code": "248df4b7-aa70-47b8-a036-33ac447e668d"
}
NameTypeRequiredDescription
objectYes
.codestringYes Format: uuid

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Get Withdrawal Address

GET /account/withdrawal/addresses/{id}

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
idpathintegerYes

Response Body

// Example Response Body
{
  "address": "abc123",
  "chain": "abc123",
  "confirmed": true,
  "createdAt": 1704067200000000,
  "hasBeneficiary": true,
  "id": 1,
  "label": "abc123",
  "updatedAt": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.addressstringYes
.chainstringYes
.confirmedbooleanYes
.createdAtnumberYesTime in microseconds since unix epoch
.hasBeneficiarybooleanYes
.idintegerYes
.labelstringYes
.updatedAtnumberYesTime in microseconds since unix epoch

#Update Withdrawal Address Label

PUT /account/withdrawal/addresses/{id}

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
idpathintegerYes

Request Body

// Example Request Body
{
  "label": "abc123"
}
NameTypeRequiredDescription
objectYes
.labelstringYes

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Delete Withdrawal Address

DELETE /account/withdrawal/addresses/{id}

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
idpathintegerYes

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Get Withdrawals

GET /account/withdrawals

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdqueryintegerNo Default: 0
beforequeryintegerNo
limitqueryintegerNo Default: 50

Response Body

// Example Response Body
[
  {
    "amount": "20.1",
    "chain": "abc123",
    "confirmed": true,
    "id": 1,
    "price": "1.23",
    "subaccountId": 1,
    "symbol": "BTC",
    "time": 1704067200000000,
    "transactionHash": "abc123",
    "withdrawalAddress": "abc123"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].amountstringYes
[*].chainstringYes
[*].confirmedbooleanYes
[*].idintegerYes
[*].pricestringYes
[*].subaccountIdintegerYes
[*].symbolstringYes
[*].timenumberYesTime in microseconds since unix epoch
[*].transactionHashstringNo
[*].withdrawalAddressstringYes

Subaccounts#

#Get Subaccounts

GET /subaccounts

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "createdAt": 1704067200000000,
    "futuresEnabled": true,
    "id": 1,
    "isLsp": true,
    "lspSettings": [
      {
        "maxAssignmentNotional": "200.1",
        "maxExposureNotional": "200.1",
        "symbol": "BTC_USDT"
      }
    ],
    "name": "abc123",
    "payFeesInArkm": true,
    "pinned": true
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].createdAtnumberYesTime in microseconds since unix epoch
[*].futuresEnabledbooleanYesif true futures trading is enabled for the subaccount
[*].idintegerYes
[*].isLspbooleanYesif true the subaccount is a liquidity provider
[*].lspSettingsarrayYes
[*].lspSettings[*]object-
[*].lspSettings[*].maxAssignmentNotionalstringYes
[*].lspSettings[*].maxExposureNotionalstringYes
[*].lspSettings[*].symbolstringYes
[*].namestringYes
[*].payFeesInArkmbooleanYesif true and ARKM balance is sufficient fees are paid in ARKM with a discount. This is only available for USDT pairs
[*].pinnedbooleanYes

#Create Subaccount

POST /subaccounts

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "name": "abc123"
}
NameTypeRequiredDescription
objectYes
.namestringYes

Response Body

// Example Response Body
{
  "id": 1
}
NameTypeRequiredDescription
objectYes
.idintegerYes

#Update Subaccount

PUT /subaccounts

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "id": 1,
  "name": "abc123",
  "pinned": true
}
NameTypeRequiredDescription
objectYes
.idintegerYes
.namestringNo
.pinnedbooleanNo

#Create Perpetual Transfer

POST /subaccounts/perp-transfer

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "fromSubaccountId": 1,
  "symbol": "BTC",
  "toSubaccountId": 1
}
NameTypeRequiredDescription
objectYes
.fromSubaccountIdintegerYes
.symbolstringYes
.toSubaccountIdintegerYes

Response Body

// Example Response Body
{
  "transferId": 1
}
NameTypeRequiredDescription
objectYes
.transferIdintegerYes

#Create Transfer

POST /subaccounts/transfer

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "amount": "20.1",
  "fromSubaccountId": 1,
  "symbol": "BTC",
  "toSubaccountId": 1
}
NameTypeRequiredDescription
objectYes
.amountstringYes
.fromSubaccountIdintegerYes
.symbolstringYes
.toSubaccountIdintegerYes

Response Body

// Example Response Body
{
  "transferId": 1
}
NameTypeRequiredDescription
objectYes
.transferIdintegerYes

#Update Portfolio Settings

POST /subaccounts/update-settings

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "futuresEnabled": true,
  "isLsp": true,
  "lspSettingUpdates": [
    {
      "maxAssignmentNotional": "200.1",
      "maxExposureNotional": "200.1",
      "symbol": "BTC_USDT"
    }
  ],
  "payFeesInArkm": true,
  "subaccountId": 1
}
NameTypeRequiredDescription
objectYes
.futuresEnabledbooleanYes
.isLspbooleanYes
.lspSettingUpdatesarrayYes
.lspSettingUpdates[*]object-
.lspSettingUpdates[*].maxAssignmentNotionalstringYes
.lspSettingUpdates[*].maxExposureNotionalstringYes
.lspSettingUpdates[*].symbolstringYes
.payFeesInArkmbooleanYesif true and ARKM balance is sufficient fees are paid in ARKM with a discount. This is only available for USDT pairs
.subaccountIdintegerYes

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Delete Subaccount

DELETE /subaccounts/{subaccountId}

Deletes the specified subaccount by ID

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
subaccountIdpathintegerYes

Airdrop#

#Get Airdrop Address

GET /airdrop

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Create Airdrop Address

POST /airdrop

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "address": "abc123"
}
NameTypeRequiredDescription
objectYes
.addressstringYes

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Get Airdrop Claim

GET /airdrop/claim

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "address": "abc123",
  "amount": "20.1",
  "claimed": true,
  "eligible": true,
  "passedKYC": true,
  "proof": [
    "abc123"
  ],
  "wei": "abc123"
}
NameTypeRequiredDescription
objectYes
.addressstringNo
.amountstringNo
.claimedbooleanNo
.eligiblebooleanYes
.passedKYCbooleanYes
.proofarrayNo
.proof[*]string-
.weistringNo

Other#

#Commission earned for user

GET /affiliate-dashboard/commission-earned

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
"20.1"
NameTypeRequiredDescription
stringYes

#Min ARKM last 30d for user

GET /affiliate-dashboard/min-arkm-last-30d

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
"20.1"
NameTypeRequiredDescription
stringYes

#Points leaderboard for user

GET /affiliate-dashboard/points

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "points": 1,
  "rank": 1
}
NameTypeRequiredDescription
objectYes
.pointsintegerYes
.rankintegerYes

#Points leaderboard season 1 for user

GET /affiliate-dashboard/points-season-1

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "points": 1,
  "rank": 1
}
NameTypeRequiredDescription
objectYes
.pointsintegerYes
.rankintegerYes

#Points leaderboard season 2 for user

GET /affiliate-dashboard/points-season-2

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "points": 1,
  "rank": 1
}
NameTypeRequiredDescription
objectYes
.pointsintegerYes
.rankintegerYes

#Realized PnL for user

GET /affiliate-dashboard/realized-pnl

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "size": "20.1",
    "time": 1704067200000000
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].sizestringYes
[*].timenumberYesTime in microseconds since unix epoch

#Rebate balance for user

GET /affiliate-dashboard/rebate-balance

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
"20.1"
NameTypeRequiredDescription
stringYes

#Referral count for user

GET /affiliate-dashboard/referral-count

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
1
NameTypeRequiredDescription
integerYes

#Referrals leaderboard season 1 for user

GET /affiliate-dashboard/referrals-season-1

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
1
NameTypeRequiredDescription
integerYes

#Referrals leaderboard season 2 for user

GET /affiliate-dashboard/referrals-season-2

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
1
NameTypeRequiredDescription
integerYes

#Trading volume stats for user

GET /affiliate-dashboard/trading-volume-stats

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "perpMakerFees": "20.1",
  "perpMakerVolume": "20.1",
  "perpTakerFees": "20.1",
  "perpTakerVolume": "20.1",
  "perpVolume": [
    {
      "size": "20.1",
      "time": 1704067200000000
    }
  ],
  "spotMakerFees": "20.1",
  "spotMakerVolume": "20.1",
  "spotTakerFees": "20.1",
  "spotTakerVolume": "20.1",
  "spotVolume": [
    {
      "size": "20.1",
      "time": 1704067200000000
    }
  ],
  "totalVolume": [
    {
      "size": "20.1",
      "time": 1704067200000000
    }
  ]
}
NameTypeRequiredDescription
objectYes
.perpMakerFeesstringYes
.perpMakerVolumestringYes
.perpTakerFeesstringYes
.perpTakerVolumestringYes
.perpVolumearrayYes
.perpVolume[*]object-
.perpVolume[*].sizestringYes
.perpVolume[*].timenumberYesTime in microseconds since unix epoch
.spotMakerFeesstringYes
.spotMakerVolumestringYes
.spotTakerFeesstringYes
.spotTakerVolumestringYes
.spotVolumearrayYes
.spotVolume[*]object-
.spotVolume[*].sizestringYes
.spotVolume[*].timenumberYesTime in microseconds since unix epoch
.totalVolumearrayYes
.totalVolume[*]object-
.totalVolume[*].sizestringYes
.totalVolume[*].timenumberYesTime in microseconds since unix epoch

#Volume leaderboard season 1 for user

GET /affiliate-dashboard/volume-season-1

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "perpVolume": "20.1",
  "spotVolume": "20.1"
}
NameTypeRequiredDescription
objectYes
.perpVolumestringYes
.spotVolumestringYes

#Volume leaderboard season 2 for user

GET /affiliate-dashboard/volume-season-2

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "perpVolume": "20.1",
  "spotVolume": "20.1"
}
NameTypeRequiredDescription
objectYes
.perpVolumestringYes
.spotVolumestringYes

#Api Key List

GET /api-key

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
[
  {
    "createdAt": 1704067200000000,
    "id": 1,
    "ipWhitelist": [
      "192.168.1.0/24",
      "10.0.0.0/8"
    ],
    "name": "abc123",
    "read": true,
    "write": true
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].createdAtnumberYesTime in microseconds since unix epoch Format: date-time
[*].idintegerYes
[*].ipWhitelistarrayYes
[*].ipWhitelist[*]string-
[*].namestringYes
[*].readbooleanYes
[*].writebooleanYes

#Api Key Create

POST /api-key/create

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "ipWhitelist": [
    "192.168.1.0/24",
    "10.0.0.0/8"
  ],
  "name": "My API Key",
  "read": true,
  "write": true
}
NameTypeRequiredDescription
objectYes
.ipWhitelistarrayYes
.ipWhitelist[*]string-
.namestringYes
.readbooleanYes
.writebooleanYes

Response Body

// Example Response Body
{
  "createdAt": 1704067200000000,
  "id": 1,
  "ipWhitelist": [
    "192.168.1.0/24",
    "10.0.0.0/8"
  ],
  "key": "248df4b7-aa70-47b8-a036-33ac447e668d",
  "name": "abc123",
  "read": true,
  "secret": "Yr2IKeF2Ayg+gUg44bxYma1gmOrJiKjhahRd0MpoM0o=",
  "write": true
}
NameTypeRequiredDescription
objectYes
.createdAtnumberYesTime in microseconds since unix epoch Format: date-time
.idintegerYes
.ipWhitelistarrayYes
.ipWhitelist[*]string-
.keystringYes Format: uuid
.namestringYes
.readbooleanYes
.secretstringYesBase64 encoded 32 byte secret Format: base64
.writebooleanYes

#Api Key Update

PUT /api-key/update/{id}

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
idpathintegerYes

Request Body

// Example Request Body
{
  "ipWhitelist": [
    "192.168.1.0/24",
    "10.0.0.0/8"
  ],
  "name": "My Updated API Key",
  "read": true,
  "write": false
}
NameTypeRequiredDescription
objectYes
.ipWhitelistarrayYes
.ipWhitelist[*]string-
.namestringYes
.readbooleanYes
.writebooleanYes

Response Body

// Example Response Body
"abc123"
NameTypeRequiredDescription
stringYes

#Api Key Delete

DELETE /api-key/{id}

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
idpathintegerYes

#Authenticate

POST /authenticate

Parameters

NameInTypeRequiredDescription
tradeInTokenquerystringNo
redirectPathquerystringNo

#Opt in to competition

POST /competitions/opt-in

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "competition_id": 1
}
NameTypeRequiredDescription
objectYes
.competition_idintegerYes

#Check competition opt-in status

GET /competitions/opt-in-status

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
competition_idqueryintegerNo

Response Body

// Example Response Body
true
NameTypeRequiredDescription
booleanYes

#Rewards info

GET /rewards/info

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Response Body

// Example Response Body
{
  "feeCredit": "20.1",
  "feeCreditExpires": 1704067200000000,
  "marginBonus": "20.1",
  "marginBonusExpires": 1704067200000000,
  "points": 1,
  "tradingFeeDiscount": "1.23",
  "tradingFeeDiscountExpires": 1704067200000000
}
NameTypeRequiredDescription
objectYes
.feeCreditstringYes
.feeCreditExpiresnumberYesTime in microseconds since unix epoch
.marginBonusstringYes
.marginBonusExpiresnumberYesTime in microseconds since unix epoch
.pointsintegerYes
.tradingFeeDiscountstringYes
.tradingFeeDiscountExpiresnumberYesTime in microseconds since unix epoch

#Vouchers for user

GET /rewards/vouchers

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Parameters

NameInTypeRequiredDescription
claimedquerybooleanNo
localequerystringNo Default: "en"

Response Body

// Example Response Body
[
  {
    "actionDescription": "abc123",
    "bullets": [
      "abc123"
    ],
    "conditions": [
      {
        "action": "Deposit",
        "completed": 0.45,
        "progressSummary": "20%,1/1",
        "progressText": "45/100 USDT,Verified",
        "type": "deposited_usd"
      }
    ],
    "id": 1,
    "name": "abc123",
    "status": "not_started",
    "type": "trading_fee_discount"
  }
]
NameTypeRequiredDescription
arrayYes
[*]object-
[*].actionDescriptionstringYes
[*].bulletsarrayYes
[*].bullets[*]string-
[*].conditionsarrayYes
[*].conditions[*]object-
[*].conditions[*].actionstringYes
[*].conditions[*].completednumberYes
[*].conditions[*].progressSummarystringYes
[*].conditions[*].progressTextstringYes
[*].conditions[*].typestringYes Enum: "deposited_usd", "deposited_token", "traded_usd", "traded_token", "basic_kyc"
[*].idintegerYes
[*].namestringYes
[*].statusstringYes Enum: "not_started", "unavailable", "in_progress", "claimable", "claimed"
[*].typestringYes Enum: "trading_fee_discount", "fee_credit", "margin_bonus", "points", "tokens"

#Claim voucher

POST /rewards/vouchers/claim

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Body

// Example Request Body
{
  "voucherId": 1
}
NameTypeRequiredDescription
objectYes
.voucherIdintegerYes

#Websocket API

The Arkham Exchange WebSocket API is a real-time API that provides access to the Arkham Exchange trading platform. It allows you to subscribe to real-time market data, order book updates, and account information.

It is recommended to use the WebSocket API for real-time data as it is more efficient than polling the REST API due to the lower latency, reduced number of tcp connections and lower bandwidth usage.

Each data type is exposed a stream that can be subscribed to on a connection. The connection is kept open and data is streamed to the client as it becomes available.

Connecting to the WebSocket API #

The WebSocket API is available at the following URL:

wss://arkm.com/ws

Subscribing to a Stream #

To subscribe to a stream, send a JSON formatted subscribe message on the connection. See below for details and examples of the format of the subscribe messages for each stream.

Subscribing to a stream that is already subscribed to will have no effect.

Unsubscribing from a Stream #

If you no longer wish to receive data from a stream, send a JSON message with an unsubscribe message on the connection. See below for details and examples of the format of the unsubscribe messages for each stream.

Snapshot Messages #

Some streams provide a snapshot message when you first subscribe to the stream. This message contains the current state of the data which can be used to initialise the client's state. After the snapshot message, the stream will send the same messages as if you had subscribed to the stream without the snapshot. For example, the L2 Order Book stream can provide a snapshot of the current order book when you first subscribe to the stream which can be used to construct a copy of the order book on the client side.

Execution Messages #

The websocket API provides the ability to create and manage orders on the exchange. This functionality is provided through the execute method on the WebSocket API.

Sending an execute message to the WebSocket API will not subscribe to any stream but will return an error or a response message similar to the REST API.

All execution messages require an authenicated websocket connection to be used, and an API key with sufficent permissions.

Websocket Authentication #

Websocket authentication is done using the same API key and secret as the REST API. The API key should be included in the +""+Arkham-API-Key+""+ header of the initial HTTP request to the websocket endpoint.

The signature is calculated in the same way as for the REST API and should be included in the +""+Arkham-Signature+""+ header of the initial HTTP request to the websocket endpoint. The body of the request should be empty.

For example, to connect to the websocket API using wscat:

# First install wscat if you haven't already
npm install -g wscat

# Set the API_KEY and API_SECRET environment variables
API_KEY=<your-api-key>
API_SECRET=<your-api-secret>

BASE_URL=wss://arkm.com
METHOD="GET"
REQUEST_PATH="/ws"

# Set the expiry timestamp - in this case 5 minutes from now
EXPIRES=$(($(/bin/date +%s) + 300))000000

# Calculate the signature
HMAC_KEY=$(/bin/echo -n "$API_SECRET" | base64 -D | xxd -p -c 64)
SIGNATURE=$(/bin/echo -n "$API_KEY$EXPIRES$METHOD$REQUEST_PATH" | openssl dgst -sha256 -mac HMAC -macopt hexkey:$HMAC_KEY -binary | base64)


# Make the request
wscat \
	-H "Arkham-Api-Key: $API_KEY" \
	-H "Arkham-Expires: $EXPIRES" \
	-H "Arkham-Signature: $SIGNATURE" \
	--connect $BASE_URL$REQUEST_PATH \
	-x '{"args":{"channel":"order_statuses"},"method":"subscribe"}'

Rate Limits #

The WebSocket API has a rate limit of 5 connections per second per IP address and 10 connections per second per account. If you exceed these limits, you will receive a 429 error response on the HTTP request to the WebSocket endpoint.

Heartbeat Messages #

The WebSocket API will regularly send a ping control frame to ensure the connection is still active, if the client does not promptly respond with a pong frame the connection will be dropped. This functionality is generally handled by websocket client implementations, but may need to be manually configure based on the client library.

The client may also send a ping message to the server to check the connection is still active. The server will respond with a pong message on the "pong" channel.

For example, to send a ping message to the server using wscat:

wscat \
	-H "Arkham-Api-Key: $API_KEY" \
	-H "Arkham-Expires: $EXPIRES" \
	-H "Arkham-Signature: $SIGNATURE" \
	--connect $BASE_URL$REQUEST_PATH \
	-x '{"method":"ping"}'
{"channel":"pong"}

Confirmation Messages #

By default the websocket will not send any confirmations on reciept of subscription messages from the client, if you would like these you can attach a (non-empty) confirmationId string to the message and the api will respond with a message on the confirmations channel with the same confirmationId before any other messages. If the message fails validation, the error message in the response will include the confirmationId sent in the request.

#Websocket Streams

#Candlestick data

Channel Name

"candles"

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "candles",
    "params": {
      "duration": "1m",
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "candles"
.args.paramsobjectNo
.args.params.durationstringNo Enum: "1m", "5m", "15m", "30m", "1h", "6h", "24h"
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "candles",
    "params": {
      "duration": "1m",
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "candles"
.args.paramsobjectNo
.args.params.durationstringNo Enum: "1m", "5m", "15m", "30m", "1h", "6h", "24h"
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Update Message

// Example Update Message
{
  "channel": "candles",
  "data": {
    "close": "1.23",
    "duration": 60000000,
    "high": "1.23",
    "low": "1.23",
    "open": "1.23",
    "quoteVolume": "200.1",
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "volume": "20.1"
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "candles"
.dataobjectYes
.data.closestringYes
.data.durationintegerYes Enum: 60000000, 300000000, 900000000, 1800000000, 3600000000, 21600000000, 86400000000
.data.highstringYes
.data.lowstringYes
.data.openstringYes
.data.quoteVolumestringYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.data.volumestringYes
.typestringYes Value: "update"

#Ticker Updates

Channel Name

"ticker"

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "ticker",
    "params": {
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "ticker"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "ticker",
    "params": {
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "ticker"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "ticker",
  "data": {
    "baseSymbol": "BTC",
    "fundingRate": "0.000733",
    "high24h": "100000.1",
    "indexCurrency": "USDT",
    "indexPrice": "100000.1",
    "low24h": "90000.1",
    "markPrice": "100000.1",
    "nextFundingRate": "0.000733",
    "nextFundingTime": 1731686400000000,
    "openInterest": "1.1",
    "openInterestUSD": "100000.1",
    "price": "100000.1",
    "price24hAgo": "90000.1",
    "productType": "spot",
    "quoteSymbol": "USDT",
    "quoteVolume24h": "100000.1",
    "symbol": "BTC_USDT",
    "usdVolume24h": "100000.1",
    "volume24h": "1.1"
  },
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "ticker"
.dataobjectYes
.data.baseSymbolstringYes
.data.fundingRatestringYes
.data.high24hstringYes
.data.indexCurrencystringYes
.data.indexPricestringYes
.data.low24hstringYes
.data.markPricestringYes
.data.nextFundingRatestringYes
.data.nextFundingTimenumberYesTime in microseconds since unix epoch
.data.openIntereststringYes
.data.openInterestUSDstringYes
.data.pricestringYes
.data.price24hAgostringYes
.data.productTypestringYes Enum: "spot", "perpetual"
.data.quoteSymbolstringYes
.data.quoteVolume24hstringYes
.data.symbolstringYes
.data.usdVolume24hstringYes
.data.volume24hstringYes
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "ticker",
  "data": {
    "baseSymbol": "BTC",
    "fundingRate": "0.000733",
    "high24h": "100000.1",
    "indexCurrency": "USDT",
    "indexPrice": "100000.1",
    "low24h": "90000.1",
    "markPrice": "100000.1",
    "nextFundingRate": "0.000733",
    "nextFundingTime": 1731686400000000,
    "openInterest": "1.1",
    "openInterestUSD": "100000.1",
    "price": "100000.1",
    "price24hAgo": "90000.1",
    "productType": "spot",
    "quoteSymbol": "USDT",
    "quoteVolume24h": "100000.1",
    "symbol": "BTC_USDT",
    "usdVolume24h": "100000.1",
    "volume24h": "1.1"
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "ticker"
.dataobjectYes
.data.baseSymbolstringYes
.data.fundingRatestringYes
.data.high24hstringYes
.data.indexCurrencystringYes
.data.indexPricestringYes
.data.low24hstringYes
.data.markPricestringYes
.data.nextFundingRatestringYes
.data.nextFundingTimenumberYesTime in microseconds since unix epoch
.data.openIntereststringYes
.data.openInterestUSDstringYes
.data.pricestringYes
.data.price24hAgostringYes
.data.productTypestringYes Enum: "spot", "perpetual"
.data.quoteSymbolstringYes
.data.quoteVolume24hstringYes
.data.symbolstringYes
.data.usdVolume24hstringYes
.data.volume24hstringYes
.typestringYes Value: "update"

#L2 order book

Channel Name

"l2_updates"

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "l2_updates",
    "params": {
      "group": "0.01",
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "l2_updates"
.args.paramsobjectNo
.args.params.groupstringNoPrice group for aggregation, must be a multiple of 1, 10, 100 or 1000 of the tick size. Default is the tick size.
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "l2_updates",
    "params": {
      "group": "0.01",
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "l2_updates"
.args.paramsobjectNo
.args.params.groupstringNoPrice group for aggregation, must be a multiple of 1, 10, 100 or 1000 of the tick size. Default is the tick size.
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "l2_updates",
  "data": {
    "asks": [
      {
        "price": "1.23",
        "size": "20.1"
      }
    ],
    "bids": [
      {
        "price": "1.23",
        "size": "20.1"
      }
    ],
    "group": "0.01",
    "lastTime": 1731686400000000,
    "symbol": "BTC_USDT"
  },
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "l2_updates"
.dataobjectYes
.data.asksarrayYes
.data.asks[*]object-
.data.asks[*].pricestringYes
.data.asks[*].sizestringYes
.data.bidsarrayYes
.data.bids[*]object-
.data.bids[*].pricestringYes
.data.bids[*].sizestringYes
.data.groupstringYes
.data.lastTimenumberYesTime in microseconds since unix epoch
.data.symbolstringYes
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "l2_updates",
  "data": {
    "group": "1.23",
    "price": "1.23",
    "revisionId": 1,
    "side": "buy",
    "size": "20.1",
    "symbol": "BTC_USDT",
    "time": 1704067200000000
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "l2_updates"
.dataobjectYes
.data.groupstringYes
.data.pricestringYes
.data.revisionIdintegerYes
.data.sidestringYes Enum: "buy", "sell"
.data.sizestringYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.typestringYes Value: "update"

#L1 order book

Channel Name

"l1_updates"

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "l1_updates",
    "params": {
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "l1_updates"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "l1_updates",
    "params": {
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "l1_updates"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "l1_updates",
  "data": {
    "askPrice": "1.23",
    "askSize": "20.1",
    "bidPrice": "1.23",
    "bidSize": "20.1",
    "revisionId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000
  },
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "l1_updates"
.dataobjectYes
.data.askPricestringNo
.data.askSizestringNo
.data.bidPricestringNo
.data.bidSizestringNo
.data.revisionIdintegerYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "l1_updates",
  "data": {
    "askPrice": "1.23",
    "askSize": "20.1",
    "bidPrice": "1.23",
    "bidSize": "20.1",
    "revisionId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "l1_updates"
.dataobjectYes
.data.askPricestringNo
.data.askSizestringNo
.data.bidPricestringNo
.data.bidSizestringNo
.data.revisionIdintegerYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.typestringYes Value: "update"

#Trades

Channel Name

"trades"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "trades",
    "params": {
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trades"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "trades",
    "params": {
      "snapshot": true,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trades"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.symbolstringYes
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "trades",
  "data": [
    {
      "price": "1.23",
      "revisionId": 1,
      "size": "20.1",
      "symbol": "BTC_USDT",
      "takerSide": "buy",
      "time": 1704067200000000
    }
  ],
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trades"
.dataarrayYes
.data[*]object-
.data[*].pricestringYes
.data[*].revisionIdintegerYes
.data[*].sizestringYes
.data[*].symbolstringYes
.data[*].takerSidestringYes Enum: "buy", "sell"
.data[*].timenumberYesTime in microseconds since unix epoch
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "trades",
  "data": {
    "price": "1.23",
    "revisionId": 1,
    "size": "20.1",
    "symbol": "BTC_USDT",
    "takerSide": "buy",
    "time": 1704067200000000
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trades"
.dataobjectYes
.data.pricestringYes
.data.revisionIdintegerYes
.data.sizestringYes
.data.symbolstringYes
.data.takerSidestringYes Enum: "buy", "sell"
.data.timenumberYesTime in microseconds since unix epoch
.typestringYes Value: "update"

#User Balances

Channel Name

"balances"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "balances",
    "params": {
      "snapshot": true,
      "snapshotInterval": 1,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "balances"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.snapshotIntervalnumberNoInterval in seconds for getting snapshot data, set to regularly get refreshed snapshot values
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "balances",
    "params": {
      "snapshot": true,
      "snapshotInterval": 1,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "balances"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.snapshotIntervalnumberNoInterval in seconds for getting snapshot data, set to regularly get refreshed snapshot values
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "balances",
  "data": [
    {
      "balance": "20.1",
      "balanceUSDT": "200.1",
      "free": "20.1",
      "freeUSDT": "200.1",
      "lastUpdateAmount": "20.1",
      "lastUpdateId": 1,
      "lastUpdateReason": "orderFill",
      "lastUpdateTime": 1704067200000000,
      "priceUSDT": "1.23",
      "subaccountId": 1,
      "symbol": "BTC"
    }
  ],
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "balances"
.dataarrayYes
.data[*]object-
.data[*].balancestringYes
.data[*].balanceUSDTstringYes
.data[*].freestringYes
.data[*].freeUSDTstringYes
.data[*].lastUpdateAmountstringYes
.data[*].lastUpdateIdintegerYes
.data[*].lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
.data[*].lastUpdateTimenumberYesTime in microseconds since unix epoch
.data[*].priceUSDTstringYes
.data[*].subaccountIdintegerYes
.data[*].symbolstringYes
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "balances",
  "data": {
    "balance": "20.1",
    "balanceUSDT": "200.1",
    "free": "20.1",
    "freeUSDT": "200.1",
    "lastUpdateAmount": "20.1",
    "lastUpdateId": 1,
    "lastUpdateReason": "orderFill",
    "lastUpdateTime": 1704067200000000,
    "priceUSDT": "1.23",
    "subaccountId": 1,
    "symbol": "BTC"
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "balances"
.dataobjectYes
.data.balancestringYes
.data.balanceUSDTstringYes
.data.freestringYes
.data.freeUSDTstringYes
.data.lastUpdateAmountstringYes
.data.lastUpdateIdintegerYes
.data.lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
.data.lastUpdateTimenumberYesTime in microseconds since unix epoch
.data.priceUSDTstringYes
.data.subaccountIdintegerYes
.data.symbolstringYes
.typestringYes Value: "update"

#User Positions

Channel Name

"positions"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "positions",
    "params": {
      "snapshot": true,
      "snapshotInterval": 1,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "positions"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.snapshotIntervalnumberNoInterval in seconds for getting snapshot data, set to regularly get refreshed snapshot values
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "positions",
    "params": {
      "snapshot": true,
      "snapshotInterval": 1,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "positions"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.snapshotIntervalnumberNoInterval in seconds for getting snapshot data, set to regularly get refreshed snapshot values
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "positions",
  "data": [
    {
      "averageEntryPrice": "67992.60",
      "base": "1",
      "breakEvenPrice": "1.23",
      "initialMargin": "200.1",
      "lastUpdateBaseDelta": "20.1",
      "lastUpdateId": 1,
      "lastUpdateQuoteDelta": "200.1",
      "lastUpdateReason": "orderFill",
      "lastUpdateTime": 1704067200000000,
      "maintenanceMargin": "200.1",
      "markPrice": "1.23",
      "openBuyNotional": "200.1",
      "openBuySize": "20.1",
      "openSellNotional": "200.1",
      "openSellSize": "20.1",
      "pnl": "200.1",
      "quote": "-67992.60",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "value": "200.1"
    }
  ],
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "positions"
.dataarrayYes
.data[*]object-
.data[*].averageEntryPricestringYes
.data[*].basestringYes
.data[*].breakEvenPricestringNo
.data[*].initialMarginstringYes
.data[*].lastUpdateBaseDeltastringYes
.data[*].lastUpdateIdintegerYes
.data[*].lastUpdateQuoteDeltastringYes
.data[*].lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
.data[*].lastUpdateTimenumberYesTime in microseconds since unix epoch
.data[*].maintenanceMarginstringYes
.data[*].markPricestringYes
.data[*].openBuyNotionalstringYes
.data[*].openBuySizestringYes
.data[*].openSellNotionalstringYes
.data[*].openSellSizestringYes
.data[*].pnlstringYes
.data[*].quotestringYes
.data[*].subaccountIdintegerYes
.data[*].symbolstringYes
.data[*].valuestringYes
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "positions",
  "data": {
    "averageEntryPrice": "67992.60",
    "base": "1",
    "breakEvenPrice": "1.23",
    "initialMargin": "200.1",
    "lastUpdateBaseDelta": "20.1",
    "lastUpdateId": 1,
    "lastUpdateQuoteDelta": "200.1",
    "lastUpdateReason": "orderFill",
    "lastUpdateTime": 1704067200000000,
    "maintenanceMargin": "200.1",
    "markPrice": "1.23",
    "openBuyNotional": "200.1",
    "openBuySize": "20.1",
    "openSellNotional": "200.1",
    "openSellSize": "20.1",
    "pnl": "200.1",
    "quote": "-67992.60",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "value": "200.1"
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "positions"
.dataobjectYes
.data.averageEntryPricestringYes
.data.basestringYes
.data.breakEvenPricestringNo
.data.initialMarginstringYes
.data.lastUpdateBaseDeltastringYes
.data.lastUpdateIdintegerYes
.data.lastUpdateQuoteDeltastringYes
.data.lastUpdateReasonstringYes Enum: "deposit", "withdraw", "orderFill", "fundingFee", "assetTransfer", "liquidation", "realizePNL", "lspAssignment", "deleverage", "tradingFee", "rebate", "commission", "adjustment", "reward", "expiration", "withdrawalFee", "perpTransfer", "airdrop"
.data.lastUpdateTimenumberYesTime in microseconds since unix epoch
.data.maintenanceMarginstringYes
.data.markPricestringYes
.data.openBuyNotionalstringYes
.data.openBuySizestringYes
.data.openSellNotionalstringYes
.data.openSellSizestringYes
.data.pnlstringYes
.data.quotestringYes
.data.subaccountIdintegerYes
.data.symbolstringYes
.data.valuestringYes
.typestringYes Value: "update"

#User Order Status

Channel Name

"order_statuses"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "order_statuses",
    "params": {
      "snapshot": true,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "order_statuses"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "order_statuses",
    "params": {
      "snapshot": true,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "order_statuses"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "order_statuses",
  "data": [
    {
      "arkmFeePaid": "20.1",
      "avgPrice": "1.23",
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "creditFeePaid": "200.1",
      "executedNotional": "200.1",
      "executedSize": "20.1",
      "lastArkmFee": "0.01",
      "lastCreditFee": "0.01",
      "lastMarginBonusFee": "0.01",
      "lastPrice": "1.5",
      "lastQuoteFee": "0.01",
      "lastSize": "1000",
      "lastTime": 1704067200000000,
      "marginBonusFeePaid": "200.1",
      "orderId": 1,
      "postOnly": true,
      "price": "1.23",
      "quoteFeePaid": "200.1",
      "reduceOnly": true,
      "revisionId": 1,
      "side": "buy",
      "size": "20.1",
      "status": "new",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "time": 1704067200000000,
      "triggerOrderId": 1,
      "type": "limitGtc",
      "userId": 1
    }
  ],
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "order_statuses"
.dataarrayYes
.data[*]object-
.data[*].arkmFeePaidstringYesTotal ARKM fee paid so far in the order
.data[*].avgPricestringYesAverage price filled so far in the order
.data[*].clientOrderIdstringNo
.data[*].creditFeePaidstringYesTotal fee paid via credits so far in the order
.data[*].executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
.data[*].executedSizestringYesTotal quantity filled so far in the order
.data[*].lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
.data[*].lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
.data[*].lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
.data[*].lastPricestringYesPrice of the last trade, only present on taker and maker statuses
.data[*].lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
.data[*].lastSizestringYesSize of the last trade, only present on taker and maker statuses
.data[*].lastTimenumberYesTime of the last status update on the order
.data[*].marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
.data[*].orderIdintegerYes
.data[*].postOnlybooleanYesIf true the order is post-only
.data[*].pricestringYesThe original price of the order
.data[*].quoteFeePaidstringYesTotal quote fee paid so far in the order
.data[*].reduceOnlybooleanYesIf true the order is reduce-only
.data[*].revisionIdintegerYesAn identifier for the order's current state, unique to the pair
.data[*].sidestringYes Enum: "buy", "sell"
.data[*].sizestringYesThe original size of the order
.data[*].statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
.data[*].subaccountIdintegerYes
.data[*].symbolstringYes
.data[*].timenumberYesTime in microseconds since unix epoch
.data[*].triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
.data[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.data[*].userIdintegerYes
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "order_statuses",
  "data": {
    "arkmFeePaid": "20.1",
    "avgPrice": "1.23",
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "creditFeePaid": "200.1",
    "executedNotional": "200.1",
    "executedSize": "20.1",
    "lastArkmFee": "0.01",
    "lastCreditFee": "0.01",
    "lastMarginBonusFee": "0.01",
    "lastPrice": "1.5",
    "lastQuoteFee": "0.01",
    "lastSize": "1000",
    "lastTime": 1704067200000000,
    "marginBonusFeePaid": "200.1",
    "orderId": 1,
    "postOnly": true,
    "price": "1.23",
    "quoteFeePaid": "200.1",
    "reduceOnly": true,
    "revisionId": 1,
    "side": "buy",
    "size": "20.1",
    "status": "new",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "triggerOrderId": 1,
    "type": "limitGtc",
    "userId": 1
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "order_statuses"
.dataobjectYes
.data.arkmFeePaidstringYesTotal ARKM fee paid so far in the order
.data.avgPricestringYesAverage price filled so far in the order
.data.clientOrderIdstringNo
.data.creditFeePaidstringYesTotal fee paid via credits so far in the order
.data.executedNotionalstringYesTotal notional value filled so far in the order, 0 if no fills
.data.executedSizestringYesTotal quantity filled so far in the order
.data.lastArkmFeestringYesARKM fee paid for the last trade, only present on taker and maker statuses
.data.lastCreditFeestringYesCredit fee paid for the last trade, only present on taker and maker statuses
.data.lastMarginBonusFeestringYesMargin bonus fee paid for the last trade, only present on taker and maker statuses
.data.lastPricestringYesPrice of the last trade, only present on taker and maker statuses
.data.lastQuoteFeestringYesQuote fee paid for the last trade, only present on taker and maker statuses
.data.lastSizestringYesSize of the last trade, only present on taker and maker statuses
.data.lastTimenumberYesTime of the last status update on the order
.data.marginBonusFeePaidstringYesTotal fee paid via margin bonus so far in the order
.data.orderIdintegerYes
.data.postOnlybooleanYesIf true the order is post-only
.data.pricestringYesThe original price of the order
.data.quoteFeePaidstringYesTotal quote fee paid so far in the order
.data.reduceOnlybooleanYesIf true the order is reduce-only
.data.revisionIdintegerYesAn identifier for the order's current state, unique to the pair
.data.sidestringYes Enum: "buy", "sell"
.data.sizestringYesThe original size of the order
.data.statusstringYes Enum: "new", "taker", "booked", "maker", "cancelled", "closed"
.data.subaccountIdintegerYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.data.triggerOrderIdintegerNoThe ID of the trigger order that created this order, if any
.data.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.data.userIdintegerYes
.typestringYes Value: "update"

#User Margin

Channel Name

"margin"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "margin",
    "params": {
      "snapshot": true,
      "snapshotInterval": 1,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "margin"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.snapshotIntervalnumberNoInterval in seconds for getting snapshot data, set to regularly get refreshed snapshot values
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "margin",
    "params": {
      "snapshot": true,
      "snapshotInterval": 1,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "margin"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.snapshotIntervalnumberNoInterval in seconds for getting snapshot data, set to regularly get refreshed snapshot values
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "margin",
  "data": {
    "available": "5000",
    "bonus": "100",
    "initial": "1000",
    "liquidation": "400",
    "locked": "1000",
    "maintenance": "600",
    "pnl": "100",
    "subaccountId": 1,
    "total": "6000",
    "totalAssetValue": "1.0"
  },
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "margin"
.dataobjectYes
.data.availablestringYesTotal margin available for opening new positions
.data.bonusstringYesTotal margin bonus
.data.initialstringYesInitial margin required to open a position
.data.liquidationstringYesAmount of Margin required to prevent portfolio liquidations
.data.lockedstringYesTotal margin locked due to open positions and open orders
.data.maintenancestringYesAmount of Margin required to prevent partial liquidations
.data.pnlstringYesTotal unrealized PnL
.data.subaccountIdintegerYes
.data.totalstringYesTotal margin in the account, includes unrealized PnL
.data.totalAssetValuestringYesTotal value of all assets in the account in USDT
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "margin",
  "data": {
    "available": "5000",
    "bonus": "100",
    "initial": "1000",
    "liquidation": "400",
    "locked": "1000",
    "maintenance": "600",
    "pnl": "100",
    "subaccountId": 1,
    "total": "6000",
    "totalAssetValue": "1.0"
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "margin"
.dataobjectYes
.data.availablestringYesTotal margin available for opening new positions
.data.bonusstringYesTotal margin bonus
.data.initialstringYesInitial margin required to open a position
.data.liquidationstringYesAmount of Margin required to prevent portfolio liquidations
.data.lockedstringYesTotal margin locked due to open positions and open orders
.data.maintenancestringYesAmount of Margin required to prevent partial liquidations
.data.pnlstringYesTotal unrealized PnL
.data.subaccountIdintegerYes
.data.totalstringYesTotal margin in the account, includes unrealized PnL
.data.totalAssetValuestringYesTotal value of all assets in the account in USDT
.typestringYes Value: "update"

#User Trigger Orders

Channel Name

"trigger_orders"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "trigger_orders",
    "params": {
      "snapshot": true,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trigger_orders"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "trigger_orders",
    "params": {
      "snapshot": true,
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trigger_orders"
.args.paramsobjectNo
.args.params.snapshotbooleanNo Default: false
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Snapshot Message

// Example Snapshot Message
{
  "channel": "trigger_orders",
  "data": [
    {
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "postOnly": true,
      "price": "1.23",
      "reduceOnly": true,
      "side": "buy",
      "size": "20.1",
      "status": "staged",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "time": 1704067200000000,
      "triggerOrderId": 1,
      "triggerPrice": "1.23",
      "triggerPriceType": "last",
      "triggerType": "takeProfit",
      "type": "limitGtc"
    }
  ],
  "type": "snapshot"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trigger_orders"
.dataarrayYes
.data[*]object-
.data[*].clientOrderIdstringYes
.data[*].postOnlybooleanYes
.data[*].pricestringYes
.data[*].reduceOnlybooleanYes
.data[*].sidestringYes Enum: "buy", "sell"
.data[*].sizestringYes
.data[*].statusstringYes Enum: "staged", "triggered", "cancelled"
.data[*].subaccountIdintegerYes
.data[*].symbolstringYes
.data[*].timenumberYesTime in microseconds since unix epoch
.data[*].triggerOrderIdintegerYes
.data[*].triggerPricestringYes
.data[*].triggerPriceTypestringYes Enum: "last", "mark", "index"
.data[*].triggerTypestringYes Enum: "takeProfit", "stopLoss"
.data[*].typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.typestringYes Value: "snapshot"

Update Message

// Example Update Message
{
  "channel": "trigger_orders",
  "data": {
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "postOnly": true,
    "price": "1.23",
    "reduceOnly": true,
    "side": "buy",
    "size": "20.1",
    "status": "staged",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "triggerOrderId": 1,
    "triggerPrice": "1.23",
    "triggerPriceType": "last",
    "triggerType": "takeProfit",
    "type": "limitGtc"
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trigger_orders"
.dataobjectYes
.data.clientOrderIdstringYes
.data.postOnlybooleanYes
.data.pricestringYes
.data.reduceOnlybooleanYes
.data.sidestringYes Enum: "buy", "sell"
.data.sizestringYes
.data.statusstringYes Enum: "staged", "triggered", "cancelled"
.data.subaccountIdintegerYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.data.triggerOrderIdintegerYes
.data.triggerPricestringYes
.data.triggerPriceTypestringYes Enum: "last", "mark", "index"
.data.triggerTypestringYes Enum: "takeProfit", "stopLoss"
.data.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.typestringYes Value: "update"

#User LSP Assignments

Channel Name

"lsp_assignments"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Subcribe Message

// Example Subcribe Message
{
  "args": {
    "channel": "lsp_assignments",
    "params": {
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "lsp_assignments"
.args.paramsobjectNo
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Unsubscribe Message

// Example Unsubscribe Message
{
  "args": {
    "channel": "lsp_assignments",
    "params": {
      "subaccountId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "subscribe"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "lsp_assignments"
.args.paramsobjectNo
.args.params.subaccountIdintegerNo Default: 0
.confirmationIdstringNo
.methodstringYes Value: "subscribe"

Update Message

// Example Update Message
{
  "channel": "lsp_assignments",
  "data": {
    "base": "20.1",
    "id": 1,
    "pairSymbol": "BTC_USDT",
    "price": "1.23",
    "quote": "200.1",
    "subaccountId": 1,
    "time": 1704067200000000,
    "userId": 1
  },
  "type": "update"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "lsp_assignments"
.dataobjectYes
.data.basestringYes
.data.idintegerYes
.data.pairSymbolstringYes
.data.pricestringYes
.data.quotestringYes
.data.subaccountIdintegerYes
.data.timenumberYesTime in microseconds since unix epoch
.data.userIdintegerYes
.typestringYes Value: "update"

#Confirmation Messages

Confimation Message

// Example Confimation Message
{
  "channel": "confirmations",
  "confirmationId": "abc123"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "confirmations"
.confirmationIdstringYes

#Websocket Requests

#Place a new order

Channel Name

"orders/new"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Message

// Example Request Message
{
  "args": {
    "channel": "orders/new",
    "params": {
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "postOnly": false,
      "price": "1.23",
      "reduceOnly": false,
      "side": "buy",
      "size": "20.1",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "type": "limitGtc"
    }
  },
  "confirmationId": "abc123",
  "method": "execute"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "orders/new"
.args.paramsobjectYes
.args.params.clientOrderIdstringYes
.args.params.postOnlybooleanYesif true, the order will be closed if it can be matched immediately. Only supported on limit gtc orders. Default: false
.args.params.pricestringYeslimit price, 0 for market orders
.args.params.reduceOnlybooleanYesif true, the order will only reduce the position size. Default: false
.args.params.sidestringYes Enum: "buy", "sell"
.args.params.sizestringYes
.args.params.subaccountIdintegerYes Default: 0
.args.params.symbolstringYes
.args.params.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.confirmationIdstringNo
.methodstringYes Value: "execute"

Response Message

// Example Response Message
{
  "channel": "orders/new",
  "confirmationId": "abc123",
  "data": {
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "orderId": 1,
    "price": "1.23",
    "side": "buy",
    "size": "20.1",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "time": 1704067200000000,
    "type": "limitGtc"
  }
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "orders/new"
.confirmationIdstringNo
.dataobjectYes
.data.clientOrderIdstringNo
.data.orderIdintegerYes
.data.pricestringYes
.data.sidestringYes Enum: "buy", "sell"
.data.sizestringYes
.data.subaccountIdintegerYes
.data.symbolstringYes
.data.timenumberYesTime in microseconds since unix epoch
.data.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Cancel an order

Channel Name

"orders/cancel"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Message

// Example Request Message
{
  "args": {
    "channel": "orders/cancel",
    "params": {
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "orderId": 1,
      "subaccountId": 1,
      "timeToCancel": 1704067200000000
    }
  },
  "confirmationId": "abc123",
  "method": "execute"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "orders/cancel"
.args.paramsobjectYes
.args.params.clientOrderIdstringNoclient order ID to cancel, required if orderId is not provided
.args.params.orderIdintegerNoorder ID to cancel, required if clientOrderId is not provided
.args.params.subaccountIdintegerNo Default: 0
.args.params.timeToCancelnumberNoTime to cancel the order, 0 for immediate. Granularity is 1 second. Default: 0
.confirmationIdstringNo
.methodstringYes Value: "execute"

Response Message

// Example Response Message
{
  "channel": "orders/cancel",
  "confirmationId": "abc123",
  "data": {
    "orderId": 1
  }
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "orders/cancel"
.confirmationIdstringNo
.dataobjectYes
.data.orderIdintegerYes

#Cancel all orders

Channel Name

"orders/cancel/all"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Message

// Example Request Message
{
  "args": {
    "channel": "orders/cancel/all",
    "params": {
      "subaccountId": 1,
      "timeToCancel": 1704067200000000
    }
  },
  "confirmationId": "abc123",
  "method": "execute"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "orders/cancel/all"
.args.paramsobjectYes
.args.params.subaccountIdintegerYes Default: 0
.args.params.timeToCancelnumberYesTime to cancel all orders, 0 for immediate. Granularity is 1 second. Use this to set a dead man's switch. Default: 0
.confirmationIdstringNo
.methodstringYes Value: "execute"

Response Message

// Example Response Message
{
  "channel": "orders/cancel/all",
  "confirmationId": "abc123",
  "data": {}
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "orders/cancel/all"
.confirmationIdstringNo
.dataobjectYes

#Place a new trigger order

Channel Name

"trigger_orders/new"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Message

// Example Request Message
{
  "args": {
    "channel": "trigger_orders/new",
    "params": {
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "postOnly": false,
      "price": "1.23",
      "reduceOnly": false,
      "side": "buy",
      "size": "20.1",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "triggerPrice": "1.23",
      "triggerPriceType": "last",
      "triggerType": "takeProfit",
      "type": "limitGtc"
    }
  },
  "confirmationId": "abc123",
  "method": "execute"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trigger_orders/new"
.args.paramsobjectYes
.args.params.clientOrderIdstringYes
.args.params.postOnlybooleanYesif true, the order will be closed if it can be matched immediately. Only supported on limit gtc orders. Default: false
.args.params.pricestringYeslimit price, 0 for market orders
.args.params.reduceOnlybooleanYesif true, the order will only reduce the position size. Default: false
.args.params.sidestringYes Enum: "buy", "sell"
.args.params.sizestringYes
.args.params.subaccountIdintegerYes Default: 0
.args.params.symbolstringYes
.args.params.triggerPricestringYes
.args.params.triggerPriceTypestringYes Enum: "last", "mark", "index"
.args.params.triggerTypestringYes Enum: "takeProfit", "stopLoss"
.args.params.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"
.confirmationIdstringNo
.methodstringYes Value: "execute"

Response Message

// Example Response Message
{
  "channel": "trigger_orders/new",
  "confirmationId": "abc123",
  "data": {
    "price": "1.23",
    "side": "buy",
    "size": "20.1",
    "symbol": "BTC_USDT",
    "triggerOrderId": 1,
    "type": "limitGtc"
  }
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trigger_orders/new"
.confirmationIdstringNo
.dataobjectYes
.data.pricestringYes
.data.sidestringYes Enum: "buy", "sell"
.data.sizestringYes
.data.symbolstringYes
.data.triggerOrderIdintegerYes
.data.typestringYes Enum: "limitGtc", "limitIoc", "limitFok", "market"

#Cancel a trigger order

Channel Name

"trigger_orders/cancel"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Message

// Example Request Message
{
  "args": {
    "channel": "trigger_orders/cancel",
    "params": {
      "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
      "subaccountId": 1,
      "symbol": "BTC_USDT",
      "triggerOrderId": 1
    }
  },
  "confirmationId": "abc123",
  "method": "execute"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trigger_orders/cancel"
.args.paramsobjectYes
.args.params.clientOrderIdstringNo
.args.params.subaccountIdintegerNo Default: 0
.args.params.symbolstringYes
.args.params.triggerOrderIdintegerNo
.args.params.triggerPriceTypeNo
.confirmationIdstringNo
.methodstringYes Value: "execute"

Response Message

// Example Response Message
{
  "channel": "trigger_orders/cancel",
  "confirmationId": "abc123",
  "data": {
    "clientOrderId": "e895221c-8c3c-41db-a911-6b9f4ec4c2e0",
    "subaccountId": 1,
    "symbol": "BTC_USDT",
    "triggerOrderId": 1
  }
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trigger_orders/cancel"
.confirmationIdstringNo
.dataobjectYes
.data.clientOrderIdstringNo
.data.subaccountIdintegerNo Default: 0
.data.symbolstringYes
.data.triggerOrderIdintegerNo
.data.triggerPriceTypeNo

#Cancel all trigger orders

Channel Name

"trigger_orders/cancel/all"

Security

  • This endpoint requires API Key authentication
  • This enpoint requires a HMAC signed request

Request Message

// Example Request Message
{
  "args": {
    "channel": "trigger_orders/cancel/all",
    "params": {
      "subaccountId": 1,
      "symbol": "BTC_USDT"
    }
  },
  "confirmationId": "abc123",
  "method": "execute"
}
NameTypeRequiredDescription
objectYes
.argsobjectNo
.args.channelstringYes Value: "trigger_orders/cancel/all"
.args.paramsobjectYes
.args.params.subaccountIdintegerYes
.args.params.symbolstringYes
.args.params.triggerPriceTypeYes
.confirmationIdstringNo
.methodstringYes Value: "execute"

Response Message

// Example Response Message
{
  "channel": "trigger_orders/cancel/all",
  "confirmationId": "abc123",
  "data": {
    "subaccountId": 1,
    "symbol": "BTC_USDT"
  }
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "trigger_orders/cancel/all"
.confirmationIdstringNo
.dataobjectYes
.data.subaccountIdintegerYes
.data.symbolstringYes
.data.triggerPriceTypeYes

Errors Responses#

Internal Error

// Example Internal Error
{
  "channel": "errors",
  "code": 0,
  "confirmationId": "abc123",
  "id": 10000,
  "message": "internal error",
  "name": "InternalError"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 0
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10000
.messagestringYesAdditional details about the error Value: "internal error"
.namestringYesThe name of the error Value: "InternalError"

Bad Request

// Example Bad Request
{
  "channel": "errors",
  "code": 1,
  "confirmationId": "abc123",
  "id": 10001,
  "message": "bad request: invalid snapshot interval: -2",
  "name": "BadRequest"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 1
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10001
.messagestringYesAdditional details about the error Value: "bad request: invalid snapshot interval: -2"
.namestringYesThe name of the error Value: "BadRequest"

Unauthorized

// Example Unauthorized
{
  "channel": "errors",
  "code": 2,
  "confirmationId": "abc123",
  "id": 10002,
  "message": "unauthorized",
  "name": "Unauthorized"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 2
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10002
.messagestringYesAdditional details about the error Value: "unauthorized"
.namestringYesThe name of the error Value: "Unauthorized"

Invalid Symbol

// Example Invalid Symbol
{
  "channel": "errors",
  "code": 3,
  "confirmationId": "abc123",
  "id": 10003,
  "message": "invalid symbol: abc123",
  "name": "InvalidSymbol"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 3
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10003
.messagestringYesAdditional details about the error Value: "invalid symbol: abc123"
.namestringYesThe name of the error Value: "InvalidSymbol"

Symbol Required

// Example Symbol Required
{
  "channel": "errors",
  "code": 4,
  "confirmationId": "abc123",
  "id": 10004,
  "message": "symbol is required",
  "name": "SymbolRequired"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 4
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10004
.messagestringYesAdditional details about the error Value: "symbol is required"
.namestringYesThe name of the error Value: "SymbolRequired"

Invalid Method

// Example Invalid Method
{
  "channel": "errors",
  "code": 5,
  "confirmationId": "abc123",
  "id": 20001,
  "message": "invalid method: abc123",
  "name": "InvalidMethod"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 5
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 20001
.messagestringYesAdditional details about the error Value: "invalid method: abc123"
.namestringYesThe name of the error Value: "InvalidMethod"

Method Required

// Example Method Required
{
  "channel": "errors",
  "code": 6,
  "confirmationId": "abc123",
  "id": 20002,
  "message": "method is required",
  "name": "MethodRequired"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 6
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 20002
.messagestringYesAdditional details about the error Value: "method is required"
.namestringYesThe name of the error Value: "MethodRequired"

Invalid Channel

// Example Invalid Channel
{
  "channel": "errors",
  "code": 7,
  "confirmationId": "abc123",
  "id": 20003,
  "message": "invalid channel: abc123",
  "name": "InvalidChannel"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 7
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 20003
.messagestringYesAdditional details about the error Value: "invalid channel: abc123"
.namestringYesThe name of the error Value: "InvalidChannel"

Channel Required

// Example Channel Required
{
  "channel": "errors",
  "code": 8,
  "confirmationId": "abc123",
  "id": 20004,
  "message": "channel is required",
  "name": "ChannelRequired"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 8
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 20004
.messagestringYesAdditional details about the error Value: "channel is required"
.namestringYesThe name of the error Value: "ChannelRequired"

Invalid Group

// Example Invalid Group
{
  "channel": "errors",
  "code": 10,
  "confirmationId": "abc123",
  "id": 20005,
  "message": "group 123 does not exist",
  "name": "InvalidGroup"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 10
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 20005
.messagestringYesAdditional details about the error Value: "group 123 does not exist"
.namestringYesThe name of the error Value: "InvalidGroup"

Rate Limit Exceeded

// Example Rate Limit Exceeded
{
  "channel": "errors",
  "code": 11,
  "confirmationId": "abc123",
  "id": 10005,
  "message": "open order limit exceeded: 100",
  "name": "RateLimitExceeded"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 11
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10005
.messagestringYesAdditional details about the error Value: "open order limit exceeded: 100"
.namestringYesThe name of the error Value: "RateLimitExceeded"

Forbidden

// Example Forbidden
{
  "channel": "errors",
  "code": 13,
  "confirmationId": "abc123",
  "id": 10006,
  "message": "forbidden: write permission required",
  "name": "Forbidden"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "errors"
.codeintegerYes Value: 13
.confirmationIdstringNo
.idintegerYesThe unique identifier of the error Value: 10006
.messagestringYesAdditional details about the error Value: "forbidden: write permission required"
.namestringYesThe name of the error Value: "Forbidden"

#Ping/Pong Messages

Ping Message

// Example Ping Message
{
  "method": "ping"
}
NameTypeRequiredDescription
objectYes
.methodstringYes Value: "ping"

Pong Response

// Example Pong Response
{
  "channel": "pong"
}
NameTypeRequiredDescription
objectYes
.channelstringYes Value: "pong"