Skip to content

Coin‐M Futures

Igor Sazonov edited this page Mar 9, 2026 · 1 revision

The BingX Python SDK provides specialized support for Coin-M perpetual futures, which are crypto-margined contracts. Unlike USDT-M futures that are margined and settled in USDT, Coin-M futures use the underlying cryptocurrency (e.g., BTC, ETH) as the margin and settlement asset.

Accessing the Coin-M Client

To interact with Coin-M futures, you must first access the CoinMClient through the main BingXClient instance:

from bingx import BingXClient

client = BingXClient(api_key="YOUR_API_KEY", api_secret="YOUR_API_SECRET")
coinm_client = client.coinm()

The CoinMClient is a dedicated client that provides access to the following services for Coin-M futures:

  • Market Service: For all Coin-M market data.
  • Trade Service: For all Coin-M trading operations.
  • Listen Key Service: For Coin-M WebSocket authentication.

Coin-M Market Service

The CoinMMarketService provides a comprehensive set of methods for retrieving market data for Coin-M contracts.

Method Description
get_contracts() Retrieves all available Coin-M contract information.
get_ticker(symbol) Retrieves the 24-hour ticker for a Coin-M contract.
get_depth(symbol, limit) Retrieves the order book depth.
get_klines(symbol, ...) Retrieves candlestick data.
get_open_interest(symbol) Retrieves the open interest.
get_funding_rate(symbol) Retrieves the funding rate.

Coin-M Trade Service

The CoinMTradeService allows you to manage your trading operations for Coin-M contracts.

Method Description
create_order(params) Creates a new Coin-M order.
cancel_order(symbol, order_id) Cancels a specific order.
get_order(symbol, order_id) Retrieves the details of a specific order.
get_open_orders(symbol) Retrieves a list of all your open orders.
get_positions(symbol) Retrieves your current positions.
get_balance() Retrieves your Coin-M account balance.
set_leverage(symbol, ...) Sets the leverage for a contract.
set_margin_mode(symbol, ...) Sets the margin mode for a contract.
get_order_history(symbol, ...) Retrieves your historical order data.
get_user_trades(symbol, ...) Retrieves your historical trade data.

Clone this wiki locally