Create Orders
POST request with body parameters for Spot, Margin, CFD/Infinity, Perpetuals.
Create an Order
POST
https://api.liquid.com/orders
This section explains shareable body parameter for trading_type
of Spot
, Margin
, CFD/Infinity
, Perpetuals
.
For body parameters specific to a trading_type
, navigate further below.
Request Body
Name | Type | Description |
---|---|---|
order_type | string | Supported values: |
product_id | number | For BTCUSD product ID is |
side | string | Supported values: |
quantity | string | The quantity to buy or sell. |
price | string | Price per unit of crypto. Only required if order_type is |
price_range | string | Only available if |
trailing_stop_type | string | Only available if |
trailing_stop_value | string | Only available if |
client_order_id | string | Create a self-identified Order ID, a custom unique identifying JSON string up to 36 bytes with any content (as long as it is unique). User must avoid special characters besides "-". client_order_id must always be unique and not be reused. |
Nonce is not required in authentication’s payload if client_order_id is provided.
limit_post_only orders are limit orders that are only accepted if they do not immediately execute. limit_post _only orders never take liquidity.
limit_post_only order will not match with pre-existing orders. If your order would cause a match with a pre-existing order, your limit_post_only order will be cancelled.
limit_post_only order ensures that you pay the maker and not the taker fee.
Available leverage may be limited based on position and/or jurisdiction.
For spot trading (leverage_level=1), the funding_currency, if specified, has to equal to the product's quoted currency, for example to create an order in product BTCJPY, the funding currency has to be JPY.
For market_with_range:
price:
if order is buy: this order swipes out sell price ladders that has price lower than its price. If this action (partial order execution) bumps market ask price higher than its price, remaining unfulfilled quantity cancelled.
if order is sell: this order swipes out buy price ladders that has price higher than its price. If this action (partial order execution) bumps market ask price lower than its price, remaining unfulfilled quantity cancelled.
price_range:
if order is buy: get the current market ask, + the price_range, then we have price and apply above logic.
if order is sell: get the current market bid, - the price_range.
Spot Order Type Examples
Limit Order
Market Order
Stop Order
Trailing-Stop Order
Margin Orders Additional Body Parameters
Parameters | Optional | Description |
leverage_level | No | Valid levels: |
trading_type | No | Supported value: |
margin_type | Yes | Supported value: When |
funding_currency | Conditional | Supported values are: |
order_direction | Yes | Supported values: Use |
take_profit | Yes | Only available if leverage_level is greater than 1.
If order side is |
stop_loss | Yes | Only available if leverage_level is greater than 1.
If order side is |
Limit Order
Market Order
Stop Order
Trailing-Stop Order
CFD/Infinity Orders Additional Body Parameters
Parameters | Optional | Description |
leverage_level | No | Valid levels: |
trading_type | No | Supported values: |
margin_type | Yes | Supported value: When |
funding_currency | Conditional | Supported values are: |
order_direction | Yes | Supported values: Use |
take_profit | Yes | Only available if leverage_level is greater than 1.
If order side is |
stop_loss | Yes | Only available if leverage_level is greater than 1.
If order side is |
Limit Order
Market Order
Stop Order
Trailing-Stop Order
Perpetual Orders Additional Body Parameters
Parameters | Optional | Description |
leverage_level | No | Valid levels: |
trading_type | No | Supported values: |
margin_type | Yes | Supported value: |
funding_currency | Conditional | Currency used to fund the trade with. Default is quoted currency (e.g a trade in BTCUSD product will use USD as the funding currency as default) |
order_direction | Yes | Supported values: |
take_profit | Yes | Only available if leverage_level is greater than 1.
If order side is |
stop_loss | Yes | Only available if leverage_level is greater than 1.
If order side is |
Limit Order
Market Order
Stop Order
Trailing-Stop Order
Last updated