Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/binance/llms.txt
Use this file to discover all available pages before exploring further.
CoinMClient is the dedicated REST client for Binance’s COIN-M Futures market. Unlike USD-M Futures, COIN-M contracts are settled and margined in the underlying cryptocurrency — for example, a BTCUSD_PERP position uses BTC as collateral and is settled in BTC. The client targets the dapi*.binance.com subdomains and provides typed methods for market data, order management, position control, and account operations across all COIN-M Futures instruments.
Installation
Constructor Options
Your Binance API key. Required for all authenticated (private) endpoints.
Your Binance API secret. Supports HMAC, RSA, and Ed25519 — key type is detected automatically.
When
true, numeric strings in responses are parsed into JavaScript numbers for well-known fields.Routes requests to
https://testnet.binancefuture.com (COIN-M testnet). Uses simulated market data.Routes requests to
https://demo-dapi.binance.com. Uses real market data with simulated order execution — the preferred option for testing COIN-M strategies.COIN-M vs USD-M Key Differences
- COIN-M Futures
- USD-M Futures
- Base URL:
dapi*.binance.com - Settlement currency: Underlying asset (BTC, ETH, BNB, etc.)
- Symbol format:
BTCUSD_PERP,ETHUSD_PERP,BTCUSD_240329(delivery) - Margin: Denominated in the underlying coin
- P&L: Expressed in the underlying coin
- Use case: Naturally long the underlying coin; ideal for miners and holders who want leveraged exposure without selling their crypto
Base URL
| Mode | Base URL |
|---|---|
| Production | https://dapi.binance.com |
| Testnet | https://testnet.binancefuture.com |
| Demo Trading | https://demo-dapi.binance.com |
Method Categories
Market Data
Public endpoints — no API key required.| Method | Endpoint | Description |
|---|---|---|
testConnectivity() | GET dapi/v1/ping | Test REST API connectivity |
getExchangeInfo() | GET dapi/v1/exchangeInfo | Exchange rules, filters, and symbol info |
getOrderBook(params) | GET dapi/v1/depth | Order book depth for a symbol |
getRecentTrades(params) | GET dapi/v1/trades | Recent trades |
getHistoricalTrades(params) | GET dapi/v1/historicalTrades | Older trade history |
getAggregateTrades(params) | GET dapi/v1/aggTrades | Compressed aggregate trades |
getMarkPrice(params?) | GET dapi/v1/premiumIndex | Mark price and funding rate |
getFundingRateHistory(params?) | GET dapi/v1/fundingRate | Historical funding rates |
getFundingRate(params?) | GET dapi/v1/fundingInfo | Current funding rates |
getKlines(params) | GET dapi/v1/klines | Candlestick data |
getContinuousContractKlines(params) | GET dapi/v1/continuousKlines | Continuous contract klines |
getIndexPriceKlines(params) | GET dapi/v1/indexPriceKlines | Index price klines |
getMarkPriceKlines(params) | GET dapi/v1/markPriceKlines | Mark price klines |
getPremiumIndexKlines(params) | GET dapi/v1/premiumIndexKlines | Premium index klines |
get24hrChangeStatistics(params?) | GET dapi/v1/ticker/24hr | 24-hour price change statistics |
getSymbolPriceTicker(params?) | GET dapi/v1/ticker/price | Latest price for symbol(s) |
getSymbolOrderBookTicker(params?) | GET dapi/v1/ticker/bookTicker | Best bid/ask price and quantity |
getOpenInterest(params) | GET dapi/v1/openInterest | Current open interest |
getOpenInterestStatistics(params) | GET futures/data/openInterestHist | Historical open interest |
getTopTradersLongShortAccountRatio(params) | GET futures/data/topLongShortAccountRatio | Top trader account ratio |
getTopTradersLongShortPositionRatio(params) | GET futures/data/topLongShortPositionRatio | Top trader position ratio |
getGlobalLongShortAccountRatio(params) | GET futures/data/globalLongShortAccountRatio | Global account long/short ratio |
getTakerBuySellVolume(params) | GET futures/data/takerBuySellVol | Taker buy/sell volume |
getCompositeSymbolIndex(params) | GET futures/data/basis | Basis data |
getQuarterlyContractSettlementPrices(params) | GET futures/data/delivery-price | Quarterly delivery settlement prices |
Order Management
Authenticated endpoints — requireapi_key and api_secret.
| Method | Endpoint | Description |
|---|---|---|
submitNewOrder(params) | POST dapi/v1/order | Place a new COIN-M futures order |
submitMultipleOrders(orders) | POST dapi/v1/batchOrders | Place up to 5 orders in one request |
modifyOrder(params) | PUT dapi/v1/order | Modify an existing LIMIT order |
modifyMultipleOrders(orders) | PUT dapi/v1/batchOrders | Modify up to 5 orders in one request |
cancelOrder(params) | DELETE dapi/v1/order | Cancel an active order |
cancelMultipleOrders(params) | DELETE dapi/v1/batchOrders | Cancel multiple orders |
cancelAllOpenOrders(params?) | DELETE dapi/v1/allOpenOrders | Cancel all open orders |
setCancelOrdersOnTimeout(params) | POST dapi/v1/countdownCancelAll | Auto-cancel all orders after timeout |
getOrder(params) | GET dapi/v1/order | Query a specific order |
getAllOrders(params) | GET dapi/v1/allOrders | All orders for a symbol |
getAllOpenOrders(params?) | GET dapi/v1/openOrders | All open orders |
getCurrentOpenOrder(params) | GET dapi/v1/openOrder | Query a specific open order |
getOrderModifyHistory(params) | GET dapi/v1/orderAmendment | Order modification history |
getForceOrders(params?) | GET dapi/v1/forceOrders | Liquidation orders |
Position Management
| Method | Endpoint | Description |
|---|---|---|
getPositions(params?) | GET dapi/v1/positionRisk | Current open positions |
setLeverage(params) | POST dapi/v1/leverage | Set leverage for a symbol |
setMarginType(params) | POST dapi/v1/marginType | Switch ISOLATED / CROSSED margin |
setIsolatedPositionMargin(params) | POST dapi/v1/positionMargin | Adjust isolated margin |
setPositionMode(params) | POST dapi/v1/positionSide/dual | Toggle one-way / hedge mode |
getCurrentPositionMode() | GET dapi/v1/positionSide/dual | Query current position mode |
getPositionMarginChangeHistory(params) | GET dapi/v1/positionMargin/history | Margin change history |
getADLQuantileEstimation(params?) | GET dapi/v1/adlQuantile | ADL quantile estimation |
getNotionalAndLeverageBrackets(params?) | GET dapi/v2/leverageBracket | Notional and leverage brackets |
Account
| Method | Endpoint | Description |
|---|---|---|
getAccountInformation() | GET dapi/v1/account | Full account information |
getBalance() | GET dapi/v1/balance | Balance per asset |
getAccountTrades(params) | GET dapi/v1/userTrades | Trade history |
getIncomeHistory(params?) | GET dapi/v1/income | Income history (funding, P&L, commission) |
getAccountCommissionRate(params) | GET dapi/v1/commissionRate | Commission rates for a symbol |
getDownloadIdForFuturesTransactionHistory(params) | GET dapi/v1/income/asyn | Request income history download ID |
getFuturesTransactionHistoryDownloadLink(params) | GET dapi/v1/income/asyn/id | Retrieve income history download link |
Code Examples
COIN-M Symbol Naming
COIN-M symbols follow a different convention from Spot and USD-M Futures:| Format | Example | Description |
|---|---|---|
{BASE}USD_PERP | BTCUSD_PERP | Perpetual contract |
{BASE}USD_{YYMMDD} | BTCUSD_240927 | Quarterly delivery contract |
{BASE}USD_{YYMMDD} | BTCUSD_241227 | Next-quarter delivery contract |
The
pair parameter (e.g. BTCUSD) can be used in some COIN-M endpoints instead of symbol to retrieve data for all contracts on a given underlying asset simultaneously.Testing Environments
COIN-M Futures supports two sandbox environments:- Demo Trading (
demoTrading: true) — uses real market data with simulated order fills athttps://demo-dapi.binance.com. Recommended for strategy testing. - Testnet (
testnet: true) — uses simulated market data athttps://testnet.binancefuture.com. Suitable for SDK integration tests.
Full Endpoint Map
A complete reference of everyCoinMClient method, its authentication requirement, HTTP method, and target endpoint:
REST Endpoint Function List →