CCXT

bitmart

bitmart cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.

bitmart

Kind: global class
Extends: Exchange

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of bitmart
Returns: int - the current integer timestamp in milliseconds from the exchange server

See: https://developer-pro.bitmart.com/en/spot/#get-system-time

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchTime (params?)

fetchStatus

the latest known information on the availability of the exchange API

Kind: instance method of bitmart
Returns: object - a status structure

See: https://developer-pro.bitmart.com/en/spot/#get-system-service-status

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchStatus (params?)

fetchMarkets

retrieves data on all markets for bitmart

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchMarkets (params?)

fetchCurrencies

fetches all available currencies on an exchange

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

See: https://developer-pro.bitmart.com/en/spot/#get-currency-list-v1

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchCurrencies (params?)

fetchTransactionFee

DEPRECATED

please use fetchDepositWithdrawFee instead

Kind: instance method of bitmart
Returns: object - a fee structure

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe network code of the currency
bitmart.fetchTransactionFee (code, params?)

fetchDepositWithdrawFee

fetch the fee for deposits and withdrawals

Kind: instance method of bitmart
Returns: object - a fee structure

See: https://developer-pro.bitmart.com/en/spot/#withdraw-quota-keyed

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe network code of the currency
bitmart.fetchDepositWithdrawFee (code, params?)

fetchTicker

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchTicker (symbol, params?)

fetchTickers

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

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

See

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchTickers (symbols, params?)

fetchOrderBook

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchOrderBook (symbol, limit?, params?)

fetchTrades

get a list of the most recent trades for a particular symbol

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

See: https://developer-pro.bitmart.com/en/spot/#get-recent-trades-v3

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum number of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchTrades (symbol, since?, limit?, params?)

fetchOHLCV

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp of the latest candle in ms
params.paginatebooleanNospot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitmart.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchMyTrades

fetch all trades made by the user

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch trades for
params.marginModebooleanNospot whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
bitmart.fetchMyTrades (symbol, since?, limit?, params?)

fetchOrderTrades

fetch all the trades made from a single order

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

See: https://developer-pro.bitmart.com/en/spot/#order-trade-list-v4-signed

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
bitmart.fetchOrderTrades (id, symbol, since?, limit?, params?)

fetchBalance

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

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchBalance (params?)

fetchTradingFee

fetch the trading fees for a market

Kind: instance method of bitmart
Returns: object - a fee structure

See: https://developer-pro.bitmart.com/en/spot/#get-actual-trade-fee-rate-keyed

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchTradingFee (symbol, params?)

createMarketBuyOrderWithCost

create a market buy order by providing the symbol and cost

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

See: https://developer-pro.bitmart.com/en/spot/#new-order-v2-signed

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
costfloatYeshow much you want to trade in units of the quote currency
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.createMarketBuyOrderWithCost (symbol, cost, params?)

createOrder

create a trade order

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market', 'limit' or 'trailing' for swap markets only
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNo'cross' or 'isolated'
params.leveragestringNoswap only leverage level
params.clientOrderIdstringNoclient order id of the order
params.reduceOnlybooleanNoswap only reduce only
params.postOnlybooleanNomake sure the order is posted to the order book and not matched immediately
params.triggerPricestringNoswap only the price to trigger a stop order
params.price_typeintNoswap only 1: last price, 2: fair price, default is 1
params.price_wayintNoswap only 1: price way long, 2: price way short
params.activation_price_typeintNoswap trailing order only 1: last price, 2: fair price, default is 1
params.trailingPercentstringNoswap only the percent to trail away from the current market price, min 0.1 max 5
params.trailingTriggerPricestringNoswap only the price to trigger a trailing order, default uses the price argument
params.stopLossPricestringNoswap only the price to trigger a stop-loss order
params.takeProfitPricestringNoswap only the price to trigger a take-profit order
params.plan_categoryintNoswap tp/sl only 1: tp/sl, 2: position tp/sl, default is 1
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
bitmart.createOrder (symbol, type, side, amount, price?, params?)

createOrders

create a list of trade orders

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

See: https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed

ParamTypeRequiredDescription
ordersArrayYeslist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
paramsobjectNoextra parameters specific to the exchange API endpoint
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
bitmart.createOrders (orders, params?)

cancelOrder

cancels an open order

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNospot only the client order id of the order to cancel
params.trailingbooleanNoswap only whether the order is a stop order
params.triggerbooleanNowhether the order is a trigger order
params.stopLossTakeProfitbooleanNowhether the order is a stopLossPrice or takeProfitPrice order
bitmart.cancelOrder (id, symbol, params?)

cancelOrders

cancel multiple orders

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

See: https://developer-pro.bitmart.com/en/spot/#cancel-batch-order-v4-signed

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdsArray<string>Noclient order ids
bitmart.cancelOrders (ids, symbol, params?)

cancelAllOrders

cancel all open orders in a market

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market to cancel orders in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.sidestringNospot only 'buy' or 'sell'
params.triggerbooleanNowhether the orders are trigger orders
params.stopLossTakeProfitbooleanNowhether the orders are stopLossPrice or takeProfitPrice orders
bitmart.cancelAllOrders (symbol, params?)

fetchOpenOrders

fetch all unfilled currently open orders

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModebooleanNospot whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
params.untilintNospot the latest time in ms to fetch orders for
params.typestringNoswap order type, 'limit' or 'market'
params.order_statestringNoswap the order state, 'all' or 'partially_filled', default is 'all'
params.orderTypestringNoswap only 'limit', 'market', or 'trailing'
params.trailingbooleanNoswap only set to true if you want to fetch trailing orders
params.triggerbooleanNoset to true if you want to fetch trigger orders
params.stopLossTakeProfitbooleanNoset to true if you want to fetch stopLossPrice or takeProfitPrice orders
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
bitmart.fetchOpenOrders (symbol, since?, limit?, params?)

fetchClosedOrders

fetches information on multiple closed orders made by the user

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest entry
params.marginModestringNospot only 'cross' or 'isolated', for margin trading
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
params.triggerbooleanNoset to true if you want to fetch trigger orders
params.stopLossTakeProfitbooleanNoset to true if you want to fetch stopLossPrice or takeProfitPrice orders
bitmart.fetchClosedOrders (symbol, since?, limit?, params?)

fetchCanceledOrders

fetches information on multiple canceled orders made by the user

Kind: instance method of bitmart
Returns: object - a list of order structures

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNotimestamp in ms of the earliest order, default is undefined
limitintNomax number of orders to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchCanceledOrders (symbol, since?, limit?, params?)

fetchOrder

fetches information on an order made by the user

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

See

ParamTypeRequiredDescription
idstringYesthe id of the order
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNospot fetch the order by client order id instead of order id
params.orderTypestringNoswap only 'limit', 'market', 'liquidate', 'bankruptcy', 'adl' or 'trailing'
params.trailingbooleanNoswap only set to true if you want to fetch a trailing order
params.stpModestringNoself-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
params.triggerbooleanNowhether the orders is a trigger, stopLossPrice or takeProfitPrice order
bitmart.fetchOrder (id, symbol, params?)

fetchDepositAddress

fetch the deposit address for a currency associated with this account

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

See: https://developer-pro.bitmart.com/en/spot/#deposit-address-keyed

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchDepositAddress (code, params?)

withdraw

make a withdrawal

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

See: https://developer-pro.bitmart.com/en/spot/#withdraw-signed

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to
tagstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe network name for this withdrawal
bitmart.withdraw (code, amount, address, tag, params?)

fetchDeposit

fetch information on a deposit

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

See: https://developer-pro.bitmart.com/en/spot/#get-a-deposit-or-withdraw-detail-keyed

ParamTypeRequiredDescription
idstringYesdeposit id
codestringYesnot used by bitmart fetchDeposit ()
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchDeposit (id, code, params?)

fetchDeposits

fetch all deposits made to an account

Kind: instance method of bitmart
Returns: Array<object> - a list of transaction structures

See: https://developer-pro.bitmart.com/en/spot/#get-deposit-and-withdraw-history-keyed

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch deposits for
limitintNothe maximum number of deposits structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchDeposits (code, since?, limit?, params?)

fetchWithdrawal

fetch data on a currency withdrawal via the withdrawal id

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

See: https://developer-pro.bitmart.com/en/spot/#get-a-deposit-or-withdraw-detail-keyed

ParamTypeRequiredDescription
idstringYeswithdrawal id
codestringYesnot used by bitmart.fetchWithdrawal
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchWithdrawal (id, code, params?)

fetchWithdrawals

fetch all withdrawals made from an account

Kind: instance method of bitmart
Returns: Array<object> - a list of transaction structures

See: https://developer-pro.bitmart.com/en/spot/#get-deposit-and-withdraw-history-keyed

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch withdrawals for
limitintNothe maximum number of withdrawals structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchWithdrawals (code, since?, limit?, params?)

repayIsolatedMargin

repay borrowed margin and interest

Kind: instance method of bitmart
Returns: object - a margin loan structure

See: https://developer-pro.bitmart.com/en/spot/#margin-repay-isolated-signed

ParamTypeRequiredDescription
symbolstringYesunified market symbol
codestringYesunified currency code of the currency to repay
amountstringYesthe amount to repay
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.repayIsolatedMargin (symbol, code, amount, params?)

borrowIsolatedMargin

create a loan to borrow margin

Kind: instance method of bitmart
Returns: object - a margin loan structure

See: https://developer-pro.bitmart.com/en/spot/#margin-borrow-isolated-signed

ParamTypeRequiredDescription
symbolstringYesunified market symbol
codestringYesunified currency code of the currency to borrow
amountstringYesthe amount to borrow
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.borrowIsolatedMargin (symbol, code, amount, params?)

fetchIsolatedBorrowRate

fetch the rate of interest to borrow a currency for margin trading

Kind: instance method of bitmart
Returns: object - an isolated borrow rate structure

See: https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the borrow rate for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchIsolatedBorrowRate (symbol, params?)

fetchIsolatedBorrowRates

fetch the borrow interest rates of all currencies, currently only works for isolated margin

Kind: instance method of bitmart
Returns: object - a list of isolated borrow rate structures

See: https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchIsolatedBorrowRates (params?)

transfer

transfer currency internally between wallets on the same account, currently only supports transfer between spot and margin

Kind: instance method of bitmart
Returns: object - a transfer structure

See

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.transfer (code, amount, fromAccount, toAccount, params?)

fetchTransfers

fetch a history of internal transfers made on an account, only transfers between spot and swap are supported

Kind: instance method of bitmart
Returns: Array<object> - a list of transfer structures

See: https://developer-pro.bitmart.com/en/futuresv2/#get-transfer-list-signed

ParamTypeRequiredDescription
codestringYesunified currency code of the currency transferred
sinceintNothe earliest time in ms to fetch transfers for
limitintNothe maximum number of transfer structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.pageintNothe required number of pages, default is 1, max is 1000
params.untilintNothe latest time in ms to fetch transfers for
bitmart.fetchTransfers (code, since?, limit?, params?)

fetchBorrowInterest

fetch the interest owed by the user for borrowing currency for margin trading

Kind: instance method of bitmart
Returns: Array<object> - a list of borrow interest structures

See: https://developer-pro.bitmart.com/en/spot/#get-borrow-record-isolated-keyed

ParamTypeRequiredDescription
codestringYesunified currency code
symbolstringYesunified market symbol when fetch interest in isolated markets
sinceintNothe earliest time in ms to fetch borrrow interest for
limitintNothe maximum number of structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchBorrowInterest (code, symbol, since?, limit?, params?)

fetchOpenInterest

Retrieves the open interest of a currency

Kind: instance method of bitmart
Returns: object - an open interest structure/docs/manual#open-interest-structure

See: https://developer-pro.bitmart.com/en/futuresv2/#get-futures-openinterest

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
paramsobjectNoexchange specific parameters
bitmart.fetchOpenInterest (symbol, params?)

setLeverage

set the level of leverage for a market

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

See: https://developer-pro.bitmart.com/en/futuresv2/#submit-leverage-signed

ParamTypeRequiredDescription
leveragefloatYesthe rate of leverage
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNo'isolated' or 'cross'
bitmart.setLeverage (leverage, symbol, params?)

fetchFundingRate

fetch the current funding rate

Kind: instance method of bitmart
Returns: object - a funding rate structure

See: https://developer-pro.bitmart.com/en/futuresv2/#get-current-funding-rate

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchFundingRate (symbol, params?)

fetchFundingRateHistory

fetches historical funding rate prices

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

See: https://developer-pro.bitmart.com/en/futuresv2/#get-funding-rate-history

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the funding rate history for
sinceintNonot sent to exchange api, exchange api always returns the most recent data, only used to filter exchange response
limitintNothe maximum amount of funding rate structures to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchFundingRateHistory (symbol, since?, limit?, params?)

fetchPosition

fetch data on a single open contract trade position

Kind: instance method of bitmart
Returns: object - a position structure

See: https://developer-pro.bitmart.com/en/futuresv2/#get-current-position-keyed

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market the position is held in
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchPosition (symbol, params?)

fetchPositions

fetch all open contract positions

Kind: instance method of bitmart
Returns: Array<object> - a list of position structures

See

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYeslist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchPositions (symbols, params?)

fetchMyLiquidations

retrieves the users liquidated positions

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

See: https://developer-pro.bitmart.com/en/futuresv2/#get-order-history-keyed

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
sinceintNothe earliest time in ms to fetch liquidations for
limitintNothe maximum number of liquidation structures to retrieve
paramsobjectNoexchange specific parameters for the bitmart api endpoint
params.untilintNotimestamp in ms of the latest liquidation
bitmart.fetchMyLiquidations (symbol, since?, limit?, params?)

editOrder

edits an open order

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market to edit an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatNohow much you want to trade in units of the base currency
pricefloatNothe price to fulfill the order, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerPricestringNoswap only the price to trigger a stop order
params.stopLossPricestringNoswap only the price to trigger a stop-loss order
params.takeProfitPricestringNoswap only the price to trigger a take-profit order
params.stopLoss.triggerPricestringNoswap only the price to trigger a preset stop-loss order
params.takeProfit.triggerPricestringNoswap only the price to trigger a preset take-profit order
params.clientOrderIdstringNoclient order id of the order
params.price_typeintNoswap only 1: last price, 2: fair price, default is 1
params.plan_categoryintNoswap tp/sl only 1: tp/sl, 2: position tp/sl, default is 1
bitmart.editOrder (id, symbol, type, side, amount?, price?, params?)

fetchLedger

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

Kind: instance method of bitmart
Returns: Array<object> - a list of ledger structures

See: https://developer-pro.bitmart.com/en/futuresv2/#get-transaction-history-keyed

ParamTypeRequiredDescription
codestringNounified currency code
sinceintNotimestamp in ms of the earliest ledger entry
limitintNomax number of ledger entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest ledger entry
bitmart.fetchLedger (code?, since?, limit?, params?)

fetchFundingHistory

fetch the history of funding payments paid and received on this account

Kind: instance method of bitmart
Returns: Array<object> - a list of funding history structures

See: https://developer-pro.bitmart.com/en/futuresv2/#get-transaction-history-keyed

ParamTypeRequiredDescription
symbolstringNounified market symbol
sinceintNothe starting timestamp in milliseconds
limitintNothe number of entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch funding history for
bitmart.fetchFundingHistory (symbol?, since?, limit?, params?)

setPositionMode

set hedged to true or false for a market

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

See: https://developer-pro.bitmart.com/en/futuresv2/#submit-leverage-signed

ParamTypeRequiredDescription
hedgedboolYesset to true to use dualSidePosition
symbolstringYesnot used by bingx setPositionMode ()
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.setPositionMode (hedged, symbol, params?)

fetchPositionMode

fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets

Kind: instance method of bitmart
Returns: object - an object detailing whether the market is in hedged or one-way mode

See: https://developer-pro.bitmart.com/en/futuresv2/#get-position-mode-keyed

ParamTypeRequiredDescription
symbolstringYesnot used
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.fetchPositionMode (symbol, params?)

watchBalance

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

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchBalance (params?)

watchTrades

get the list of most recent trades for a particular symbol

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchTrades (symbol, since?, limit?, params?)

watchTradesForSymbols

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

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchTradesForSymbols (symbols, since?, limit?, params?)

unWatchTrades

unWatches from the stream channel

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchTrades (symbol, params?)

unWatchTradesForSymbols

unsubscribes from the trades channel

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch trades for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchTradesForSymbols (symbols, params?)

watchTicker

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchTicker (symbol, params?)

watchTickers

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 bitmart
Returns: object - a ticker structure

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchTickers (symbols, params?)

unWatchTicker

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchTicker (symbol, params?)

unWatchTickers

unWatches 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 bitmart
Returns: object - a ticker structure

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchTickers (symbols, params?)

watchBidsAsks

watches best bid & ask for symbols

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchBidsAsks (symbols, params?)

watchOrders

watches information on multiple orders made by the user

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchOrders (symbol, since?, limit?, params?)

unWatchOrders

unWatches information on multiple orders made by the user

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchOrders (symbol, params?)

watchPositions

watch all open positions

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

See: https://developer-pro.bitmart.com/en/futures/#private-position-channel

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYeslist of unified market symbols
sinceintNothe earliest time in ms to fetch positions
limitintNothe maximum number of positions to retrieve
paramsobjectYesextra parameters specific to the exchange API endpoint
bitmart.watchPositions (symbols, since?, limit?, params)

unWatchPositions

unWatches all open positions

Kind: instance method of bitmart
Returns: object - status of the unwatch request

See: https://developer-pro.bitmart.com/en/futures/#private-position-channel

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchPositions (symbols?, params?)

watchOHLCV

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchOHLCV (symbol, timeframe, since?, limit?, params?)

unWatchOHLCV

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchOHLCV (symbol, timeframe, params?)

watchOrderBook

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.speedstringNofutures only '100ms' or '200ms'
bitmart.watchOrderBook (symbol, limit?, params?)

unWatchOrderBook

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified array of symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.unWatchOrderBook (symbol, params?)

watchOrderBookForSymbols

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

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

See: https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel

ParamTypeRequiredDescription
symbolsArray<string>Yesunified array of symbols
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.depthstringNothe type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
bitmart.watchOrderBookForSymbols (symbols, limit?, params?)

unWatchOrderBookForSymbols

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

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

See: https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel

ParamTypeRequiredDescription
symbolsArray<string>Yesunified array of symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
params.depthstringNothe type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
bitmart.unWatchOrderBookForSymbols (symbols, params?)

watchFundingRate

watch the current funding rate

Kind: instance method of bitmart
Returns: object - a funding rate structure

See: https://developer-pro.bitmart.com/en/futuresv2/#public-funding-rate-channel

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchFundingRate (symbol, params?)

watchFundingRates

watch the funding rate for multiple markets

Kind: instance method of bitmart
Returns: object - a dictionary of funding rate structures, indexed by market symbols

See: https://developer-pro.bitmart.com/en/futuresv2/#public-funding-rate-channel

ParamTypeRequiredDescription
symbolsArray<string>Yesa list of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
bitmart.watchFundingRates (symbols, params?)

On this page