Open a first leveraged position on WhiteBIT — Margin Trading (up to 10x) or Futures Trading (up to 100x) — in under 5 minutes.
Open a first leveraged position on WhiteBIT. Margin Trading and Futures Trading share identical API endpoints — only the pair name differs. Select a tab below to follow the steps for the preferred product.
API naming convention: WhiteBIT’s API uses “collateral” endpoints for both
Margin and Futures trading. The market pair determines the product:
spot pairs (e.g., BTC_USDT) for Margin, perpetual pairs (e.g., BTC_PERP)
for Futures. All endpoints under /api/v4/order/collateral/ and
/api/v4/collateral-account/ serve both products.
Funds in the Collateral balance (transfer from Main balance if needed — see Balances & Transfers)
Familiarity with HMAC-SHA512 signing — see Authentication
WhiteBIT has no public testnet or sandbox. All leveraged orders execute against the live orderbook.
Use minimum order amounts, low leverage (2x–5x), and prices far from market to safely test.
Leveraged positions carry liquidation risk — see Margin Trading
or Futures Trading for risk details.
result = send_request("/api/v4/collateral-account/leverage", { "leverage": 5})print(result)
Expected response:
{ "leverage": 5}
Allowed leverage values: 1, 2, 3, 5, 10. Margin Trading supports up to 10x.
3
Place a collateral limit order
Create a limit buy order on BTC_USDT. Set the price well below the current market price — the order remains open without filling, allowing safe testing.
When a collateral limit order fills, a position is created. Open positions include a liquidationPrice field — monitor the liquidation price for risk management. See the open positions endpoint for details.
4
Check open positions
Query open positions. If the limit order from the previous step has not filled, the response is empty. Once an order fills, positions appear with key risk fields.
Key fields: basePrice (entry price), liquidationPrice (price at which the position is force-closed), positionSide (LONG, SHORT, or BOTH), margin (funds allocated to the position).
5
Cancel the order
Cancel the limit order to release the reserved collateral.
To close an open position (after a filled order), use the close position endpoint with positionId and market:
# Close an open position (when one exists)close = send_request("/api/v4/collateral-account/position/close", { "positionId": 87654321, "market": "BTC_USDT"})
Futures Trading uses perpetual pairs (e.g., BTC_PERP) with up to 100x leverage and optional Hedge Mode.
1
Check collateral balance
Verify available collateral funds. The same Collateral balance serves both Margin and Futures.
Create a limit buy order on BTC_PERP. Set the price well below the current market price — the order remains open without filling, allowing safe testing.
The only difference from the Margin tab: BTC_PERP (perpetual pair) instead of BTC_USDT (spot pair). The API endpoint and request structure are identical.
5
Check open positions
Query open positions. If the limit order from the previous step has not filled, the response is empty. Once an order fills, positions appear with key risk fields including liquidationPrice.
Key fields: basePrice (entry price), liquidationPrice (price triggering forced closure — uses mark price, not last traded price), positionSide (LONG, SHORT, or BOTH in Hedge Mode), margin (funds allocated to the position).
6
Cancel the order
Cancel the limit order to release the reserved collateral.
To close an open position (after a filled order), use the close position endpoint with positionId and market:
# Close an open position (when one exists)close = send_request("/api/v4/collateral-account/position/close", { "positionId": 87654321, "market": "BTC_PERP"})
Position successfully managed through the collateral trading API. The Margin and Futures tabs demonstrate API symmetry — identical endpoints, identical request structure, differentiated only by pair name (BTC_USDT vs. BTC_PERP).
What just happened?
Collateral balance isolation — Leveraged trading requires funds in the Collateral balance specifically. Depositing to the Main balance is not sufficient — an explicit transfer to Collateral is required before any collateral order can be placed. The Collateral balance is shared between Margin and Futures; there is no separate pool per product.How leverage amplifies risk — At 5x leverage, 1 USDT of collateral controls 5 USDT of market exposure. A 20% adverse price move against a 5x position wipes the allocated margin entirely, triggering partial liquidation. WhiteBIT’s partial liquidation mechanism closes 20–30% of the position first to restore margin; full liquidation follows only if that is insufficient. The liquidationPrice field in position responses shows exactly where this occurs — monitor it alongside the collateral balance in production.Why the pair name determines the product — The API has no “margin” or “futures” parameter. The endpoint paths (/api/v4/order/collateral/limit, etc.) are identical for both products. Sending BTC_USDT routes the order to Margin Trading; sending BTC_PERP routes it to Futures Trading. Leverage is also set account-wide — a single call to /api/v4/collateral-account/leverage affects all open and future positions across both products.