Trading
Get Trades
GET
https://api.liquid.com/trades?product_id={product_id}&funding_currency={funding_currency}
Get trades by applying optional filters.
Query Parameters
product_id
string
Product ID 1
for BTCUSD.
funding_currency
string
Filter by example: USD
.
status
string
Filter by open
or closed
.
side
string
Filter by long
or short
.
trading_type
string
Filter by spot
, margin
, cfd
, perpetual
.
Available Leverage
GET
https://api.liquid.com/users/leverage_limitation
Get an account's available choices in leverage.
Close a Trade
PUT
https://api.liquid.com/trades/{trade_id}/close
Close a live position (live trade) by specifying the trade ID and quantity.
Path Parameters
trade_id
string
Example Trade ID:60223738
.
Request Body
closed_quantity
string
Partially close 0.00056 quantities with{"closed_quantity": "0.00056"}
. If you do not specify this then the full position will be closed.
Claim a Trade
PUT
https://api.liquid.com/trades/{trade_id}/claim
Claim a trade by specifying its ID. This works only for Margin pairs where the funding currency is similar to the quote currency i.e. trade BTCUSD with USD.
Path Parameters
trade_id
string
Example of trade ID: 57896
Close all trades
PUT
https://api.liquid.com/trades/close_all
Closes live positions (live trades).
Request Body
side
string
{"side": "long}
to close all long positions {"side": "short"}
to close all short positions.
If this is not specified then all positions, both on the long side and the short side will be closed.
Update a Trade
PUT
https://api.liquid.com/trades/{trade_id}
Provide either only the stop loss price, only the take profit price, or both.
Path Parameters
trade_id
string
Example trade ID:60223740
.
Request Body
stop_loss
string
Update stop loss with{"stop_loss": "7000"}
take_profit
string
Update take profit with{"take_profit": "8000"}
Adjust Allocated Margin
PUT
https://api.liquid.com/trades/{trade_id}/adjust_margin
For isolated margin trades only. Adjust a trade's allocated margin a.k.a. margin used.
Path Parameters
trade_id
string
Example trade ID:60223741
Request Body
amount
string
{"amount": "100"}
to increase the allocated margin by 100 i.e. current 250 allocated margin becomes 250+100=350
Last updated