CCXT

bitfinex

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

bitfinex

Kind: global class
Extends: Exchange

fetchStatus

the latest known information on the availability of the exchange API

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

See: https://docs.bitfinex.com/reference/rest-public-platform-status

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

fetchMarkets

retrieves data on all markets for bitfinex

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

See: https://docs.bitfinex.com/reference/rest-public-conf

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

fetchCurrencies

fetches all available currencies on an exchange

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

See: https://docs.bitfinex.com/reference/rest-public-conf

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

fetchBalance

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

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

See: https://docs.bitfinex.com/reference/rest-auth-wallets

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

transfer

transfer currency internally between wallets on the same account

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

See: https://docs.bitfinex.com/reference/rest-auth-transfer

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

fetchOrderBook

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

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

See: https://docs.bitfinex.com/reference/rest-public-book

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return, bitfinex only allows 1, 25, or 100
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchOrderBook (symbol, limit?, params?)

fetchTickers

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

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

See: https://docs.bitfinex.com/reference/rest-public-tickers

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
bitfinex.fetchTickers (symbols, 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 bitfinex
Returns: object - a ticker structure

See: https://docs.bitfinex.com/reference/rest-public-ticker

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

fetchTrades

get the list of most recent trades for a particular symbol

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

See: https://docs.bitfinex.com/reference/rest-public-trades

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, default 120, max 10000
paramsobjectNoextra parameters specific to the exchange API endpoint
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.untilintNothe latest time in ms to fetch entries for
bitfinex.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 bitfinex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://docs.bitfinex.com/reference/rest-public-candles

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, default 100 max 10000
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest candle to fetch
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
bitfinex.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

createOrder

create an order on the exchange

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

See: https://docs.bitfinex.com/reference/rest-auth-submit-order

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
typestringYes'limit' or 'market'
sidestringYes'buy' or 'sell'
amountfloatYesthe amount of currency to trade
pricefloatNoprice of the order
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerPricefloatNothe price that triggers a trigger order
params.timeInForcestringNo"GTC", "IOC", "FOK", or "PO"
params.postOnlybooleanNoset to true if you want to make a post only order
params.reduceOnlybooleanNoindicates that the order is to reduce the size of a position
params.flagsintNoadditional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
params.levintNoleverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
params.price_aux_limitstringNoorder price for stop limit orders
params.price_oco_stopstringNoOCO stop price
params.trailingAmountstringNoswap only the quote amount to trail away from the current market price
bitfinex.createOrder (symbol, type, side, amount, price?, params?)

createOrders

create a list of trade orders

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

See: https://docs.bitfinex.com/reference/rest-auth-order-multi

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
bitfinex.createOrders (orders, params?)

cancelAllOrders

cancel all open orders

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

See: https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple

ParamTypeRequiredDescription
symbolstringYesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.cancelAllOrders (symbol, params?)

cancelOrder

cancels an open order

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

See: https://docs.bitfinex.com/reference/rest-auth-cancel-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesNot used by bitfinex cancelOrder ()
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.cancelOrder (id, symbol, params?)

cancelOrders

cancel multiple orders at the same time

Kind: instance method of bitfinex
Returns: object - an array of order structures

See: https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringYesunified market symbol, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.cancelOrders (ids, symbol, params?)

fetchOpenOrder

fetch an open order by it's id

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchOpenOrder (id, symbol, params?)

fetchClosedOrder

fetch an open order by it's id

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchClosedOrder (id, symbol, params?)

fetchOpenOrders

fetch all unfilled currently open orders

Kind: instance method of bitfinex
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 orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchOpenOrders (symbol, since?, limit?, params?)

fetchClosedOrders

fetches information on multiple closed orders made by the user

Kind: instance method of bitfinex
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.untilintNothe latest time in ms to fetch entries for
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
bitfinex.fetchClosedOrders (symbol, since?, limit?, params?)

fetchOrderTrades

fetch all the trades made from a single order

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

See: https://docs.bitfinex.com/reference/rest-auth-order-trades

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
bitfinex.fetchOrderTrades (id, symbol, since?, limit?, params?)

fetchMyTrades

fetch all trades made by the user

Kind: instance method of bitfinex
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
bitfinex.fetchMyTrades (symbol, since?, limit?, params?)

createDepositAddress

create a currency deposit address

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

See: https://docs.bitfinex.com/reference/rest-auth-deposit-address

ParamTypeRequiredDescription
codestringYesunified currency code of the currency for the deposit address
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.createDepositAddress (code, params?)

fetchDepositAddress

fetch the deposit address for a currency associated with this account

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

See: https://docs.bitfinex.com/reference/rest-auth-deposit-address

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

fetchTradingFees

fetch the trading fees for multiple markets

Kind: instance method of bitfinex
Returns: object - a dictionary of fee structures indexed by market symbols

See: https://docs.bitfinex.com/reference/rest-auth-summary

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchTradingFees (params?)

fetchDepositsWithdrawals

fetch history of deposits and withdrawals

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

See

ParamTypeRequiredDescription
codestringNounified currency code for the currency of the deposit/withdrawals, default is undefined
sinceintNotimestamp in ms of the earliest deposit/withdrawal, default is undefined
limitintNomax number of deposit/withdrawals to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchDepositsWithdrawals (code?, since?, limit?, params?)

withdraw

make a withdrawal

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

See: https://docs.bitfinex.com/reference/rest-auth-withdraw

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to
tagstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.withdraw (code, amount, address, tag, params?)

fetchPositions

fetch all open positions

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

See: https://docs.bitfinex.com/reference/rest-auth-positions

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYeslist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchPositions (symbols, 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 bitfinex
Returns: object - a ledger structure

See: https://docs.bitfinex.com/reference/rest-auth-ledgers

ParamTypeRequiredDescription
codestringNounified currency code, default is undefined
sinceintNotimestamp in ms of the earliest ledger entry, default is undefined
limitintNomax number of ledger entries to return, default is undefined, max is 2500
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest ledger entry
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
bitfinex.fetchLedger (code?, since?, limit?, params?)

fetchFundingRates

fetch the current funding rate for multiple symbols

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

See: https://docs.bitfinex.com/reference/rest-public-derivatives-status

ParamTypeRequiredDescription
symbolsArray<string>Yeslist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchFundingRates (symbols, params?)

fetchFundingRateHistory

fetches historical funding rate prices

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

See: https://docs.bitfinex.com/reference/rest-public-derivatives-status-history

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNotimestamp in ms of the earliest funding rate entry
limitintNomax number of funding rate entrys to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest funding rate
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
bitfinex.fetchFundingRateHistory (symbol, since?, limit?, params?)

fetchOpenInterests

Retrieves the open interest for a list of symbols

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

See: https://docs.bitfinex.com/reference/rest-public-derivatives-status

ParamTypeRequiredDescription
symbolsArray<string>Noa list of unified CCXT market symbols
paramsobjectNoexchange specific parameters
bitfinex.fetchOpenInterests (symbols?, params?)

fetchOpenInterest

retrieves the open interest of a contract trading pair

Kind: instance method of bitfinex
Returns: object - an open interest structure

See: https://docs.bitfinex.com/reference/rest-public-derivatives-status

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
paramsobjectNoexchange specific parameters
bitfinex.fetchOpenInterest (symbol, params?)

fetchOpenInterestHistory

retrieves the open interest history of a currency

Kind: instance method of bitfinex
Returns: An array of open interest structures

See: https://docs.bitfinex.com/reference/rest-public-derivatives-status-history

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
timeframestringYesthe time period of each row of data, not used by bitfinex
sinceintNothe time in ms of the earliest record to retrieve as a unix timestamp
limitintNothe number of records in the response
paramsobjectNoexchange specific parameters
params.untilintNothe time in ms of the latest record to retrieve as a unix timestamp
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
bitfinex.fetchOpenInterestHistory (symbol, timeframe, since?, limit?, params?)

fetchLiquidations

retrieves the public liquidations of a trading pair

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

See: https://docs.bitfinex.com/reference/rest-public-liquidations

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
params.untilintNotimestamp in ms of the latest liquidation
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
bitfinex.fetchLiquidations (symbol, since?, limit?, params?)

setMargin

either adds or reduces margin in a swap position in order to set the margin to a specific value

Kind: instance method of bitfinex
Returns: object - A margin structure

See: https://docs.bitfinex.com/reference/rest-auth-deriv-pos-collateral-set

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market to set margin in
amountfloatYesthe amount to set the margin to
paramsobjectNoparameters specific to the exchange API endpoint
bitfinex.setMargin (symbol, amount, params?)

fetchOrder

fetches information on an order made by the user

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

See

ParamTypeRequiredDescription
idstringYesthe order id
symbolstringNounified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.fetchOrder (id, symbol?, params?)

editOrder

edit a trade order

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

See: https://docs.bitfinex.com/reference/rest-auth-update-order

ParamTypeRequiredDescription
idstringYesedit order id
symbolstringYesunified symbol of the market to edit an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much you want to trade in units of the 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.triggerPricefloatNothe price that triggers a trigger order
params.postOnlybooleanNoset to true if you want to make a post only order
params.reduceOnlybooleanNoindicates that the order is to reduce the size of a position
params.flagsintNoadditional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
params.leverageintNoleverage for a derivative order, supported by derivative symbol orders only, the value should be between 1 and 100 inclusive
params.clientOrderIdintNoa unique client order id for the order
params.trailingAmountfloatNoswap only the quote amount to trail away from the current market price
bitfinex.editOrder (id, symbol, type, side, amount, price?, params?)

watchOHLCV

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

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

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
bitfinex.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 bitfinex
Returns: bool - true if successfully unsubscribed, false otherwise

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
bitfinex.unWatchOHLCV (symbol, timeframe, params?)

watchTrades

get the list of most recent trades for a particular symbol

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

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
bitfinex.watchTrades (symbol, since?, limit?, params?)

unWatchTrades

unWatches the list of most recent trades for a particular symbol

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

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

watchMyTrades

watches information on multiple trades made by the user

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trade structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.watchMyTrades (symbol, since?, limit?, 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 bitfinex
Returns: object - a ticker structure

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitfinex.watchTicker (symbol, 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 bitfinex
Returns: object - a ticker structure

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

watchOrderBook

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

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

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
bitfinex.watchOrderBook (symbol, limit?, params?)

watchBalance

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

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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestrNospot or contract if not provided this.options['defaultType'] is used
bitfinex.watchBalance (params?)

watchOrders

watches information on multiple orders made by the user

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

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
bitfinex.watchOrders (symbol, since?, limit?, params?)

On this page