Integration

BitMEX

Trade BitMEX with NautilusTrader

Stream BitMEX market data and execute spot, perpetual swap, futures, and spread orders through an adapter written in Rust, with REST and WebSocket access, a server-side dead man's switch, and full order and position reconciliation.

Crypto derivatives exchange

Spot, swaps, futures, spreads

Data and execution

Written in Rust 🦀

Founded in 2014, BitMEX (the Bitcoin Mercantile Exchange) is a cryptocurrency derivatives venue best known for inventing the perpetual swap in 2016, now the most traded instrument in crypto. It lists spot pairs, inverse and linear perpetual swaps, quanto contracts that settle in Bitcoin regardless of the underlying, and dated futures with their calendar spreads, all reached over a single REST and WebSocket API.

NautilusTrader integrates with BitMEX through nautilus-bitmex, a platform adapter written in Rust with Python bindings, providing both data and execution clients. It streams order books, quotes, trades, bars, and mark, index, and funding updates, and submits orders signed with HMAC-SHA256 in the Rust core rather than calling an external BitMEX SDK. Order, fill, position, and balance updates drive reconciliation, with liquidation and bankruptcy fills flagged as exchange-generated.

The adapter also wires up the venue-specific machinery that matters for running unattended: BitMEX's dead man's switch arms a server-side cancel-all timer that pulls every open order if the client goes quiet, while opt-in submit and cancel broadcasters fan time-critical requests across parallel HTTP clients and take the first success.

Products

Spot, perpetual swaps, dated futures, and spreads, traded through one adapter and signing path.

Spot

Native spot pairs

Spot pairs quoted against USDT, USDC, and XBT, traded from the same wallet as the derivatives products rather than a separate spot account.

Market and limit orders

USDT, USDC, and XBT quoting

Unified wallet with derivatives

XBT_USDT.BITMEX

Perpetual swaps

Inverse, linear, and quanto

The contract BitMEX invented in 2016, listed three ways: inverse swaps settled in Bitcoin, linear swaps margined in USDT, and quanto swaps that price an altcoin in USD while settling in Bitcoin.

Inverse settlement in XBT

Linear USDT margining

Quanto contracts settled in XBT

XBTUSD.BITMEX

Futures

Dated and quanto

Fixed-expiry futures using standard month and year codes, settled inversely in Bitcoin, linearly in USDT, or as quanto contracts.

Standard month and year codes

Inverse, linear, and quanto settlement

Quarterly and dated expiries

XBTU26.BITMEX

Futures spreads

Basis as one symbol

Spread instruments that quote the basis between two legs as a single tradeable symbol, pairing spot, perpetual, and dated futures so a roll or basis trade is one order rather than two.

Basis quoted as one symbol

Spot, perpetual, and futures legs

Calendar and cash-and-carry rolls

XBTU26-XBTZ26.BITMEX

Markets

Crypto majors across linear perpetual swaps, Bitcoin-settled inverse and quanto contracts, spot pairs, and dated futures.

Perpetual swaps · Linear, USDT-margined

XBT

Bitcoin

ETH

Ethereum

SOL

Solana

XRP

XRP

ZEC

Zcash

HYPE

Hyperliquid

NEAR

Near

BCH

Bitcoin Cash

ADA

Cardano

DOGE

Dogecoin

SUI

Sui

WLD

Worldcoin

LTC

Litecoin

XAUT

Tether Gold

XMR

Monero

AVAX

Avalanche

+ More

USDT-margined perpetual swaps on crypto majors, e.g. XBTUSDT (Bitcoin) and ETHUSDT (Ethereum). Note that BitMEX writes Bitcoin as XBT, not BTC.

Inverse and quanto · Bitcoin-settled contracts

XBT

Bitcoin

ETH

Ethereum

SOL

Solana

XRP

XRP

DOGE

Dogecoin

LINK

Chainlink

BCH

Bitcoin Cash

BNB

BNB

ADA

Cardano

PEPE

Pepe

WLD

Worldcoin

LTC

Litecoin

XBTUSD is the flagship inverse swap: quoted in USD, margined and settled in Bitcoin. The quanto swaps price an altcoin against USD but also settle in Bitcoin, e.g. ETHUSD and SOLUSD.

Spot · USDT, USDC, and XBT quoted

XBT

Bitcoin

ETH

Ethereum

SOL

Solana

XRP

XRP

XAUT

Tether Gold

RLUSD

Ripple USD

USDC

USD Coin

LINK

Chainlink

UNI

Uniswap

TRX

TRON

ATOM

Cosmos

BMEX

BMEX Token

+ More

Spot symbols separate the pair with an underscore, e.g. XBT_USDT, ETH_XBT, and SOL_USDC. The underscore is what distinguishes spot XBT_USDT from the linear perpetual XBTUSDT.

Futures · Fixed expiry

XBT

Bitcoin

ETH

Ethereum

ADA

Cardano

XRP

XRP

Futures date the symbol with a month code and year, e.g. XBTU26 (September 2026) and XBTH27 (March 2027). Calendar spreads join two contracts, e.g. XBTU26-XBTZ26.

These are a representative sample. BitMEX lists close to 100 adapter-supported instruments across spot, perpetual swaps, futures, and spreads, and adds new ones continuously; the adapter discovers the live instrument set at startup and maps every BitMEX symbol to a NautilusTrader instrument.

Data feeds

Each BitMEX feed maps to a native NautilusTrader data type across the public streams.

Data feed

NautilusTrader type

Notes

Order book (L2)

OrderBookDeltas

Snapshot then deltas from the L2 stream; depth is either the full book or 25 levels.

Order book (depth 10)

OrderBookDepth10

Fixed 10-level snapshots from the orderBook10 channel.

Quotes

QuoteTick

Best bid and offer streamed over WebSocket.

Trades

TradeTick

Live public trades over WebSocket, with REST history up to 1,000 rows per call.

Bars

Bar

Externally aggregated 1m, 5m, 1h, and 1d time bars over REST, with optional partial bins.

Mark price

MarkPriceUpdate

Mark price for perpetual and futures contracts.

Index price

IndexPriceUpdate

Underlying index price, including the non-tradeable BitMEX reference indices.

Funding rate

FundingRateUpdate

Perpetual funding, with the interval read from the venue fundingInterval field.

Instruments

CurrencyPairCryptoPerpetualCryptoFutureCryptoFuturesSpread

Spot pairs, perpetual swaps, dated futures, and calendar spreads discovered at startup.

Status

InstrumentStatus

Trading-status transitions per instrument.

Order types

BitMEX maps to the full range of Nautilus order types, including both trailing stop variants, which reach the venue as pegged orders.

Type

Supported

Notes

MARKET

Immediate execution at the current market price; quote quantity is not supported.

LIMIT

Executed only at the specified price or better.

STOP_MARKET

Conditional trigger to a market order, evaluated at the venue.

STOP_LIMIT

Conditional trigger to a limit order, carrying both price and trigger price.

MARKET_IF_TOUCHED

Take-profit trigger to a market order.

LIMIT_IF_TOUCHED

Take-profit trigger to a limit order.

TRAILING_STOP_MARKET

Maps to a BitMEX pegged order with a trailing stop peg; absolute price offsets only.

TRAILING_STOP_LIMIT

Trailing peg that additionally carries the limit price; absolute price offsets only.

Time in force

GTC, IOC, FOK, and DAY are all native. BitMEX has no good-till-date instruction.

Type

Supported

Notes

GTC

Good-till-canceled; the default for resting orders.

GTD

No native good-till-date on BitMEX.

IOC

Immediate-or-cancel; partial fills allowed.

FOK

Fill-or-kill; fills the entire order or cancels.

DAY

Expires at 00:00 UTC, the BitMEX trading day boundary.

Data and execution clients

Data client

Public REST and WebSocket streams

Feeds: order books, quotes, trades, bars, and mark, index, and funding updates.

Products: one client covers spot, perpetual swaps, futures, and spreads from a single stream.

Resilience: reconnecting WebSocket with snapshot-and-buffer order book recovery, and keep-alive pooled HTTP.

Execution client

Signed orders over REST with WebSocket account streams

Orders: entry, in-place amend, conditional triggers, pegged and trailing orders, plus batch cancel.

Account: order, fill, position, and balance updates drive reconciliation, with liquidation and bankruptcy fills flagged as exchange-generated.

Safety: an optional dead man's switch, plus submit and cancel broadcasters for parallel request fanout.

How the integration works

Adapter crate

nautilus-bitmex, a Rust core with Python bindings.

Data client

BitmexDataClient streams instruments, books, quotes, trades, bars, and mark, index, and funding updates.

Execution client

BitmexExecutionClient handles signed orders, account queries, and reconciliation.

Signing

HMAC-SHA256 over the REST and WebSocket APIs, handled in the Rust core, with an api-expires replay window.

Product types

Spot, perpetual swaps, dated futures, and calendar spreads, discovered from the venue instrument catalogue.

Environments

Mainnet and testnet, selected by BitmexEnvironment.

Authentication

API key and secret.

Considerations

•

Public market data needs no credentials; execution needs an API key and secret.

•

BitMEX writes Bitcoin as XBT rather than BTC, following the ISO 4217 convention where X denotes a non-national currency.

•

Instrument IDs use the native BitMEX symbol: XBTUSD (inverse swap), XBTUSDT (linear swap), XBT_USDT (spot), and XBTU26 (September 2026 future).

•

BitMEX reports quantities in contracts; the adapter derives the contract size from the venue lot size and position multiplier, so quantities in Nautilus stay in base units.

•

Time in force is GTC, IOC, FOK, or DAY; BitMEX has no native GTD, and DAY orders expire at 00:00 UTC.

•

Order book deltas are L2 only, at either full depth or 25 levels; the orderBook10 channel adds fixed 10-level snapshots.

•

Batch cancel is supported; BitMEX offers no batch submit or batch modify.

•

Rate limits are 10 requests per second burst and 120 per rolling minute for authenticated users, enforced locally by the adapter; each broadcaster client holds its own budget, so a pool multiplies the quota a request consumes.

•

The dead man's switch cancels every open order on the account, including orders placed by other systems.

•

Bracket flows link natively through the venue's contingent order mechanics, but mutual cancel between stop-loss and take-profit legs needs strategy-level emulation.

•

BitMEX reports auto-deleveraging and counterparty liquidation with the same execution code, so the two cannot be distinguished from the public API.

•

Stock perpetuals on equities, FX, and commodities are listed by BitMEX but not yet supported by the adapter; BitMEX has discontinued its options products.

•

Event-based prediction markets are mapped whenever BitMEX lists them, though no new event contract has been listed since 2024.

Integration guide

Read the full integration guide

The guide covers installation, account setup, configuration, symbology, order handling, rate limits, and worked examples for trading BitMEX.

footer-logo

© 2026 Nautech Systems Pty Ltd. All rights reserved.

NautilusTraderâ„¢ is a product of Nautech Systems Pty Ltd (ABN 88 609 589 237). Nautech Systems provides algorithmic trading software only. We do not operate as a broker, dealer, or exchange, nor offer financial advisory services. Users are solely responsible for compliance with applicable laws and regulations. Subject to non-excludable consumer guarantees, we make no warranties and accept no liability for trading losses or regulatory violations arising from use of the software. Read full disclaimer.

We use essential cookies and, with your consent, optional analytics cookies, as described in our Privacy Policy. Manage your Cookie Preferences.