TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/bitget-api/llms.txt
Use this file to discover all available pages before exploring further.
RestClientV2 class supports both cross and isolated margin trading through a consistent API surface. Every margin method accepts a marginType parameter of type MarginType — either 'crossed' or 'isolated' — which is validated at runtime and routes the request to the appropriate endpoint path (/api/v2/margin/crossed/... or /api/v2/margin/isolated/...). All methods in this section require authentication.
Cross vs. isolated margin: In
'crossed' mode, all margin positions share a single pool of collateral. In 'isolated' mode, each position has its own dedicated margin allocation, limiting losses to that amount. Pass marginType as the first argument to every margin method to select the correct mode.Account
| Method | Description |
|---|---|
getMarginCurrencies() | Lists all supported margin trading currencies (no marginType required) |
getMarginAccountAssets(marginType, params?) | Returns asset balances; optionally filter by coin |
getMarginRiskRate(marginType) | Returns risk rate ratios across your margin positions |
getMarginMaxBorrowable(marginType, params) | Maximum borrowable amount for a given coin |
getMarginMaxTransferable(marginType, params) | Maximum transferable amount for a given coin |
getMarginInterestRateAndMaxBorrowable(marginType, params) | Current interest rate and borrowing limits per coin |
getMarginTierConfiguration(marginType, params) | Risk tier table for a coin |
getMarginLoanGrowthRate(params) | Loan growth rate data from the market insights endpoint |
getMarginFinancialHistory(marginType, params) | Paginated financial records (transfers, fees, interest) |
Orders
| Method | Description |
|---|---|
marginSubmitOrder(marginType, params) | Places a single margin order |
marginCancelOrder(marginType, params) | Cancels an order by orderId or clientOid |
marginBatchSubmitOrders(marginType, params) | Places multiple orders in one call |
marginBatchCancelOrders(marginType, params) | Cancels multiple orders by ID list |
getMarginOpenOrders(marginType, params) | Lists currently open orders |
getMarginHistoricOrders(marginType, params) | Paginated order history |
getMarginHistoricOrderFills(marginType, params) | Paginated fill records |
getMarginTransactionRecords(params) | Tax/accounting transaction records via /api/v2/tax/margin-record |
MarginPlaceOrderRequestV2 parameters
Trading pair symbol, e.g.
"BTCUSDT".Order direction.
Execution type.
Time-in-force policy.
Controls automatic borrowing and repayment behavior. Use
'autoLoan' to borrow automatically when placing an order, 'autoRepay' to repay automatically on fill, or 'autoLoanAndRepay' for both.Order quantity in base currency. Either
baseSize or quoteSize must be provided.Order quantity in quote currency. Either
baseSize or quoteSize must be provided.Limit price. Required when
orderType is 'limit'.Optional client-assigned order ID.
Borrow / Repay
| Method | Description |
|---|---|
marginBorrow(marginType, params) | Borrows a specific coin amount against collateral |
marginRepay(marginType, params) | Repays a specific borrow via repayId |
marginFlashRepay(marginType, params) | Instantly repays all debt for a coin using available balance |
getMarginFlashRepayResult(marginType, params) | Polls the result of a flash repay operation |
getMarginBorrowHistory(marginType, params) | Paginated borrow history |
getMarginRepayHistory(marginType, params) | Paginated repayment history |
getMarginInterestHistory(marginType, params) | Paginated interest charge history |
getMarginLiquidationHistory(marginType, params) | Paginated liquidation event history |
getMarginLiquidationOrders(marginType, params) | Paginated liquidation order records |