Skip to content
github-actions[bot] edited this page Jun 11, 2026 · 3 revisions

bitmex{docsify-ignore}

Kind: global class
Extends: Exchange

fetchCurrencies{docsify-ignore}

fetches all available currencies on an exchange

Kind: instance method of bitmex
Returns: object - an associative dictionary of currencies

See: https://www.bitmex.com/api/explorer/#!/Wallet/Wallet_getAssetsConfig

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchCurrencies (params?)

fetchMarkets{docsify-ignore}

retrieves data on all markets for bitmex

Kind: instance method of bitmex
Returns: Array<object> - an array of objects representing market data

See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActive

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchMarkets (params?)

fetchBalance{docsify-ignore}

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of bitmex
Returns: object - a balance structure

See: https://www.bitmex.com/api/explorer/#!/User/User_getMargin

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchBalance (params?)

fetchOrderBook{docsify-ignore}

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of bitmex
Returns: object - A dictionary of order book structures indexed by market symbols

See: https://www.bitmex.com/api/explorer/#!/OrderBook/OrderBook_getL2

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the order book for
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchOrderBook (symbol, limit?, params?)

fetchOrder{docsify-ignore}

fetches information on an order made by the user

Kind: instance method of bitmex
Returns: object - An order structure

See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders

Param Type Required Description
id string Yes the order id
symbol string Yes unified symbol of the market the order was made in
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchOrder (id, symbol, params?)

fetchOrders{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of bitmex
Returns: Array<Order> - a list of order structures

See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.until int No the earliest time in ms to fetch orders for
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitmex.fetchOrders (symbol, since?, limit?, params?)

fetchOpenOrders{docsify-ignore}

fetch all unfilled currently open orders

Kind: instance method of bitmex
Returns: Array<Order> - a list of order structures

See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch open orders for
limit int No the maximum number of open orders structures to retrieve
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchOpenOrders (symbol, since?, limit?, params?)

fetchClosedOrders{docsify-ignore}

fetches information on multiple closed orders made by the user

Kind: instance method of bitmex
Returns: Array<Order> - a list of order structures

See: https://www.bitmex.com/api/explorer/#!/Order/Order_getOrders

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchClosedOrders (symbol, since?, limit?, params?)

fetchMyTrades{docsify-ignore}

fetch all trades made by the user

Kind: instance method of bitmex
Returns: Array<Trade> - a list of trade structures

See: https://www.bitmex.com/api/explorer/#!/Execution/Execution_getTradeHistory

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch trades for
limit int No the maximum number of trades structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitmex.fetchMyTrades (symbol, since?, limit?, params?)

fetchLedger{docsify-ignore}

fetch the history of changes, actions done by the user or operations that altered the balance of the user

Kind: instance method of bitmex
Returns: object - a ledger structure

See: https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory

Param Type Required Description
code string No unified currency code, default is undefined
since int No timestamp in ms of the earliest ledger entry, default is undefined
limit int No max number of ledger entries to return, default is undefined
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchLedger (code?, since?, limit?, params?)

fetchDepositsWithdrawals{docsify-ignore}

fetch history of deposits and withdrawals

Kind: instance method of bitmex
Returns: object - a list of transaction structure

See: https://www.bitmex.com/api/explorer/#!/User/User_getWalletHistory

Param Type Required Description
code string No unified currency code for the currency of the deposit/withdrawals, default is undefined
since int No timestamp in ms of the earliest deposit/withdrawal, default is undefined
limit int No max number of deposit/withdrawals to return, default is undefined
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchDepositsWithdrawals (code?, since?, limit?, params?)

fetchTicker{docsify-ignore}

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of bitmex
Returns: object - a ticker structure

See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_get

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchTicker (symbol, params?)

fetchTickers{docsify-ignore}

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of bitmex
Returns: object - a dictionary of ticker structures

See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices

Param Type Required Description
symbols Array<string>, undefined Yes unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchTickers (symbols, params?)

fetchOHLCV{docsify-ignore}

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of bitmex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://www.bitmex.com/api/explorer/#!/Trade/Trade_getBucketed

Param Type Required Description
symbol string Yes unified symbol of the market to fetch OHLCV data for
timeframe string Yes the length of time each candle represents
since int No timestamp in ms of the earliest candle to fetch
limit int No the maximum amount of candles to fetch
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitmex.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchTrades{docsify-ignore}

get the list of most recent trades for a particular symbol

Kind: instance method of bitmex
Returns: Array<Trade> - a list of trade structures

See: https://www.bitmex.com/api/explorer/#!/Trade/Trade_get

Param Type Required Description
symbol string Yes unified symbol of the market to fetch trades for
since int No timestamp in ms of the earliest trade to fetch
limit int No the maximum amount of trades to fetch
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitmex.fetchTrades (symbol, since?, limit?, params?)

createOrder{docsify-ignore}

create a trade order

Kind: instance method of bitmex
Returns: object - an order structure

See: https://www.bitmex.com/api/explorer/#!/Order/Order_new

Param Type Required Description
symbol string Yes unified symbol of the market to create an order in
type string Yes 'market' or 'limit'
side string Yes 'buy' or 'sell'
amount float Yes how much of currency you want to trade in units of base currency
price float No the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params object No extra parameters specific to the exchange API endpoint
params.triggerPrice object No the price at which a trigger order is triggered at
params.triggerDirection object No the direction whenever the trigger happens with relation to price - 'ascending' or 'descending'
params.trailingAmount float No the quote amount to trail away from the current market price
bitmex.createOrder (symbol, type, side, amount, price?, params?)

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of bitmex
Returns: object - An order structure

See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancel

Param Type Required Description
id string Yes order id
symbol string Yes not used by bitmex cancelOrder ()
params object No extra parameters specific to the exchange API endpoint
bitmex.cancelOrder (id, symbol, params?)

cancelOrders{docsify-ignore}

cancel multiple orders

Kind: instance method of bitmex
Returns: object - an list of order structures

See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancel

Param Type Required Description
ids Array<string> Yes order ids
symbol string Yes not used by bitmex cancelOrders ()
params object No extra parameters specific to the exchange API endpoint
bitmex.cancelOrders (ids, symbol, params?)

cancelAllOrders{docsify-ignore}

cancel all open orders

Kind: instance method of bitmex
Returns: Array<object> - a list of order structures

See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancelAll

Param Type Required Description
symbol string Yes unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
params object No extra parameters specific to the exchange API endpoint
bitmex.cancelAllOrders (symbol, params?)

cancelAllOrdersAfter{docsify-ignore}

dead man's switch, cancel all orders after the given timeout

Kind: instance method of bitmex
Returns: object - the api result

See: https://www.bitmex.com/api/explorer/#!/Order/Order_cancelAllAfter

Param Type Required Description
timeout number Yes time in milliseconds, 0 represents cancel the timer
params object No extra parameters specific to the exchange API endpoint
bitmex.cancelAllOrdersAfter (timeout, params?)

fetchLeverages{docsify-ignore}

fetch the set leverage for all contract markets

Kind: instance method of bitmex
Returns: object - a list of leverage structures

See: https://www.bitmex.com/api/explorer/#!/Position/Position_get

Param Type Required Description
symbols Array<string> No a list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchLeverages (symbols?, params?)

fetchPositions{docsify-ignore}

fetch all open positions

Kind: instance method of bitmex
Returns: Array<object> - a list of position structure

See: https://www.bitmex.com/api/explorer/#!/Position/Position_get

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchPositions (symbols, params?)

withdraw{docsify-ignore}

make a withdrawal

Kind: instance method of bitmex
Returns: object - a transaction structure

See: https://www.bitmex.com/api/explorer/#!/User/User_requestWithdrawal

Param Type Required Description
code string Yes unified currency code
amount float Yes the amount to withdraw
address string Yes the address to withdraw to
tag string Yes
params object No extra parameters specific to the exchange API endpoint
bitmex.withdraw (code, amount, address, tag, params?)

fetchFundingRates{docsify-ignore}

fetch the funding rate for multiple markets

Kind: instance method of bitmex
Returns: Array<object> - a list of funding rate structures, indexed by market symbols

See: https://www.bitmex.com/api/explorer/#!/Instrument/Instrument_getActiveAndIndices

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchFundingRates (symbols, params?)

fetchFundingRateHistory{docsify-ignore}

Fetches the history of funding rates

Kind: instance method of bitmex
Returns: Array<object> - a list of funding rate structures

See: https://www.bitmex.com/api/explorer/#!/Funding/Funding_get

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the funding rate history for
since int No timestamp in ms of the earliest funding rate to fetch
limit int No the maximum amount of funding rate structures to fetch
params object No extra parameters specific to the exchange API endpoint
params.until int No timestamp in ms for ending date filter
params.reverse bool No if true, will sort results newest first
params.start int No starting point for results
params.columns string No array of column names to fetch in info, if omitted, will return all columns
params.filter string No generic table filter, send json key/value pairs, such as {"key": "value"}, you can key on individual fields, and do more advanced querying on timestamps, see the timestamp docs for more details
bitmex.fetchFundingRateHistory (symbol, since?, limit?, params?)

setLeverage{docsify-ignore}

set the level of leverage for a market

Kind: instance method of bitmex
Returns: object - response from the exchange

See: https://www.bitmex.com/api/explorer/#!/Position/Position_updateLeverage

Param Type Required Description
leverage float Yes the rate of leverage
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
bitmex.setLeverage (leverage, symbol, params?)

setMarginMode{docsify-ignore}

set margin mode to 'cross' or 'isolated'

Kind: instance method of bitmex
Returns: object - response from the exchange

See: https://www.bitmex.com/api/explorer/#!/Position/Position_isolateMargin

Param Type Required Description
marginMode string Yes 'cross' or 'isolated'
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
bitmex.setMarginMode (marginMode, symbol, params?)

fetchDepositAddress{docsify-ignore}

fetch the deposit address for a currency associated with this account

Kind: instance method of bitmex
Returns: object - an address structure

See: https://www.bitmex.com/api/explorer/#!/User/User_getDepositAddress

Param Type Required Description
code string Yes unified currency code
params object No extra parameters specific to the exchange API endpoint
params.network string No deposit chain, can view all chains via this.publicGetWalletAssets, default is eth, unless the currency has a default chain within this.options['networks']
bitmex.fetchDepositAddress (code, params?)

fetchDepositWithdrawFees{docsify-ignore}

fetch deposit and withdraw fees

Kind: instance method of bitmex
Returns: object - a list of fee structures

See: https://www.bitmex.com/api/explorer/#!/Wallet/Wallet_getAssetsConfig

Param Type Required Description
codes Array<string>, undefined Yes list of unified currency codes
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchDepositWithdrawFees (codes, params?)

fetchOpenInterests{docsify-ignore}

Retrieves the open interest for a list of symbols

Kind: instance method of bitmex
Returns: Array<object> - a list of open interest structures

See: https://docs.bitmex.com/api-explorer/get-stats

Param Type Required Description
symbols Array<string> No a list of unified CCXT market symbols
params object No exchange specific parameters
bitmex.fetchOpenInterests (symbols?, params?)

fetchLiquidations{docsify-ignore}

retrieves the public liquidations of a trading pair

Kind: instance method of bitmex
Returns: object - an array of liquidation structures

See: https://www.bitmex.com/api/explorer/#!/Liquidation/Liquidation_get

Param Type Required Description
symbol string Yes unified CCXT market symbol
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
params.until int No timestamp in ms of the latest liquidation
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitmex.fetchLiquidations (symbol, since?, limit?, params?)

fetchPositionsADLRank{docsify-ignore}

fetches the auto deleveraging rank and risk percentage for a list of symbols

Kind: instance method of bitmex
Returns: Array<object> - an auto de leverage structure

See: https://www.bitmex.com/api/explorer/#!/Position/Position_get

Param Type Required Description
symbols Array<string> No list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
bitmex.fetchPositionsADLRank (symbols?, params?)

fetchSettlementHistory{docsify-ignore}

fetches historical settlement records

Kind: instance method of bitmex
Returns: Array<object> - a list of settlement history objects

See: https://docs.bitmex.com/api-explorer/get-settlements

Param Type Required Description
symbol string Yes unified market symbol of the settlement history
since int No timestamp in ms
limit int No number of records
params object No exchange specific params
params.until int No timestamp in ms EXCHANGE SPECIFIC PARAMETERS
params.filter string No generic table filter, send json key/value pairs, such as {"key": "value"}, you can key on individual fields, and do more advanced querying on timestamps, see the timestamp docs for more details, default value = {}
params.columns string No array of column names to fetch, if omitted, will return all columns, note that this method will always return item keys, even when not specified, so you may receive more columns that you expect
params.start int No possible values are >= 0 starting point for results, default value = 0
params.reverse boolean No if true, will sort results newest first, default value = false
bitmex.fetchSettlementHistory (symbol, since?, limit?, params?)

closePosition{docsify-ignore}

closes open positions for a market

Kind: instance method of bitmex
Returns: object - an order structure

See

Param Type Required Description
symbol string Yes Unified CCXT market symbol
side string Yes the buy or sell side of the closing order, if the position is long set the side to sell, reduceOnly is implied
params object No extra parameters specific to the bingx api endpoint
bitmex.closePosition (symbol, side, params?)

watchTicker{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of bitmex
Returns: object - a ticker structure

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
bitmex.watchTicker (symbol, params?)

watchTickers{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of bitmex
Returns: object - a ticker structure

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
bitmex.watchTickers (symbols, params?)

watchLiquidations{docsify-ignore}

watch the public liquidations of a trading pair

Kind: instance method of bitmex
Returns: object - an array of liquidation structures

See: https://www.bitmex.com/app/wsAPI#Liquidation

Param Type Required Description
symbol string Yes unified CCXT market symbol
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
bitmex.watchLiquidations (symbol, since?, limit?, params?)

watchLiquidationsForSymbols{docsify-ignore}

watch the public liquidations of a trading pair

Kind: instance method of bitmex
Returns: object - an array of liquidation structures

See: https://www.bitmex.com/app/wsAPI#Liquidation

Param Type Required Description
symbols Array<string> Yes
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
bitmex.watchLiquidationsForSymbols (symbols, since?, limit?, params?)

watchBalance{docsify-ignore}

watch balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of bitmex
Returns: object - a balance structure

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
bitmex.watchBalance (params?)

watchTrades{docsify-ignore}

get the list of most recent trades for a particular symbol

Kind: instance method of bitmex
Returns: Array<object> - a list of trade structures

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbol string Yes unified symbol of the market to fetch trades for
since int No timestamp in ms of the earliest trade to fetch
limit int No the maximum amount of trades to fetch
params object No extra parameters specific to the exchange API endpoint
bitmex.watchTrades (symbol, since?, limit?, params?)

watchPositions{docsify-ignore}

watch all open positions

Kind: instance method of bitmex
Returns: Array<object> - a list of position structure

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
since int No the earliest time in ms to watch positions for
limit int No the maximum number of positions to retrieve
params object Yes extra parameters specific to the exchange API endpoint
bitmex.watchPositions (symbols, since?, limit?, params)

watchOrders{docsify-ignore}

watches information on multiple orders made by the user

Kind: instance method of bitmex
Returns: Array<object> - a list of order structures

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
bitmex.watchOrders (symbol, since?, limit?, params?)

watchMyTrades{docsify-ignore}

watches information on multiple trades made by the user

Kind: instance method of bitmex
Returns: Array<object> - a list of trade structures

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbol string Yes unified market symbol of the market trades were made in
since int No the earliest time in ms to fetch trades for
limit int No the maximum number of trade structures to retrieve
params object No extra parameters specific to the exchange API endpoint
bitmex.watchMyTrades (symbol, since?, limit?, params?)

watchOrderBook{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of bitmex
Returns: object - A dictionary of order book structures indexed by market symbols

See: https://www.bitmex.com/app/wsAPI#OrderBookL2

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the order book for
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
bitmex.watchOrderBook (symbol, limit?, params?)

watchOrderBookForSymbols{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of bitmex
Returns: object - A dictionary of order book structures indexed by market symbols

See: https://www.bitmex.com/app/wsAPI#OrderBookL2

Param Type Required Description
symbols Array<string> Yes unified array of symbols
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
bitmex.watchOrderBookForSymbols (symbols, limit?, params?)

watchTradesForSymbols{docsify-ignore}

get the list of most recent trades for a list of symbols

Kind: instance method of bitmex
Returns: Array<object> - a list of trade structures

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch trades for
since int No timestamp in ms of the earliest trade to fetch
limit int No the maximum amount of trades to fetch
params object No extra parameters specific to the exchange API endpoint
bitmex.watchTradesForSymbols (symbols, since?, limit?, params?)

watchOHLCV{docsify-ignore}

watches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of bitmex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://www.bitmex.com/app/wsAPI#Subscriptions

Param Type Required Description
symbol string Yes unified symbol of the market to fetch OHLCV data for
timeframe string Yes the length of time each candle represents
since int No timestamp in ms of the earliest candle to fetch
limit int No the maximum amount of candles to fetch
params object No extra parameters specific to the exchange API endpoint
bitmex.watchOHLCV (symbol, timeframe, since?, limit?, params?)

Clone this wiki locally