Trading
Private

Calculates margin requirements for a hypothetical order on a given instrument. Returns initial margin and maintenance margin for the specified instrument, quantity, and price.

This method is useful for estimating margin requirements before placing an order, helping to ensure sufficient funds are available and understanding the margin impact of potential trades.

For spot instruments, amount_type selects whether amount is a base currency quantity (fees charged on top) or a total quote currency spend (fees included).

Scope: trade:read

Try in API console

get/private/get_margins

Query parameters

instrument_namestring required

Unique instrument identifier

Example:BTC-PERPETUAL

Instrument name

amountnumber required

It represents the requested order size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin. For spot instruments the unit is controlled by amount_type.

amount_type'base' | 'quote'

How the amount parameter is interpreted. Spot instruments only.

base (the default) reads amount as a quantity of the base currency, with fees charged on top of it. quote reads amount as a total spend in the quote currency, with fees included in it. For every spot order the matching base amounts are returned in taker_base_amount and maker_base_amount.

Because the taker and maker fee rates differ, a fee-inclusive spend buys a slightly different quantity in each role. Both quantities are floored to a whole multiple of the instrument's min_trade_amount, so the cost plus the fee never exceeds the requested spend. Where the fee rate is negative (a maker rebate) the cost alone exceeds the spend and the rebate brings the total back within it.

In quote mode the buy field reports the taker notional. The maker notional differs, and the fee-inclusive maker total is in maker_margin_required.

On the sell side the spend is the gross proceeds: the base amount sold is worth exactly that, and the fee is deducted from what is received. The sell quantity does not depend on the fee role, so it is the same in taker_base_amount and maker_base_amount.

pricenumber required
Example:3725

Price

Response

Success response

jsonrpc'2.0' required

The JSON-RPC version (2.0)

idinteger

The id that was sent in the request

Example response

{
  "result": {
    "buy": 0.01681367,
    "sell": 0.01680479,
    "buy_taker_fee": 0.000017,
    "buy_maker_fee": 0.000017,
    "sell_taker_fee": 0.000017,
    "sell_maker_fee": 0.000017,
    "taker_base_amount": {
      "buy": 0.0009,
      "sell": 0.001
    },
    "maker_base_amount": {
      "buy": 0.0009,
      "sell": 0.001
    }
  }
}

Changes