## bitfinex2{docsify-ignore} **Kind**: global class **Extends**: Exchange * [fetchStatus](#fetchstatus) * [fetchMarkets](#fetchmarkets) * [fetchCurrencies](#fetchcurrencies) * [fetchBalance](#fetchbalance) * [transfer](#transfer) * [fetchOrderBook](#fetchorderbook) * [fetchTickers](#fetchtickers) * [fetchTicker](#fetchticker) * [fetchTrades](#fetchtrades) * [fetchOHLCV](#fetchohlcv) * [createOrder](#createorder) * [createOrders](#createorders) * [cancelAllOrders](#cancelallorders) * [cancelOrder](#cancelorder) * [cancelOrders](#cancelorders) * [fetchOpenOrder](#fetchopenorder) * [fetchClosedOrder](#fetchclosedorder) * [fetchOpenOrders](#fetchopenorders) * [fetchClosedOrders](#fetchclosedorders) * [fetchOrderTrades](#fetchordertrades) * [fetchMyTrades](#fetchmytrades) * [createDepositAddress](#createdepositaddress) * [fetchDepositAddress](#fetchdepositaddress) * [fetchTradingFees](#fetchtradingfees) * [fetchDepositsWithdrawals](#fetchdepositswithdrawals) * [withdraw](#withdraw) * [fetchPositions](#fetchpositions) * [fetchLedger](#fetchledger) * [fetchFundingRate](#fetchfundingrate) * [fetchFundingRate](#fetchfundingrate) * [fetchFundingRateHistory](#fetchfundingratehistory) * [fetchOpenInterest](#fetchopeninterest) * [fetchOpenInterestHistory](#fetchopeninteresthistory) * [fetchLiquidations](#fetchliquidations) * [setMargin](#setmargin) * [fetchOrder](#fetchorder) * [editOrder](#editorder) * [watchOHLCV](#watchohlcv) * [watchTrades](#watchtrades) * [watchMyTrades](#watchmytrades) * [watchTicker](#watchticker) * [watchOrderBook](#watchorderbook) * [watchBalance](#watchbalance) * [watchOrders](#watchorders) ### fetchStatus{docsify-ignore} the latest known information on the availability of the exchange API **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [status structure](https://docs.ccxt.com/#/?id=exchange-status-structure) **See**: https://docs.bitfinex.com/reference/rest-public-platform-status | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchStatus ([params]) ``` ### fetchMarkets{docsify-ignore} retrieves data on all markets for bitfinex2 **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - an array of objects representing market data **See**: https://docs.bitfinex.com/reference/rest-public-conf | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchMarkets ([params]) ``` ### fetchCurrencies{docsify-ignore} fetches all available currencies on an exchange **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an associative dictionary of currencies **See**: https://docs.bitfinex.com/reference/rest-public-conf | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchCurrencies ([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 [bitfinex2](#bitfinex2) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-wallets | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchBalance ([params]) ``` ### transfer{docsify-ignore} transfer currency internally between wallets on the same account **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [transfer structure](https://docs.ccxt.com/#/?id=transfer-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-transfer | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | amount to transfer | | fromAccount | string | Yes | account to transfer from | | toAccount | string | Yes | account to transfer to | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.transfer (code, amount, fromAccount, toAccount[, params]) ``` ### fetchOrderBook{docsify-ignore} fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See**: https://docs.bitfinex.com/reference/rest-public-book | 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, bitfinex only allows 1, 25, or 100 | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchOrderBook (symbol[, limit, 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 [bitfinex2](#bitfinex2) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://docs.bitfinex.com/reference/rest-public-tickers | 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 | ```javascript bitfinex2.fetchTickers (symbols[, 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 [bitfinex2](#bitfinex2) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See**: https://docs.bitfinex.com/reference/rest-public-ticker | 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 | ```javascript bitfinex2.fetchTicker (symbol[, params]) ``` ### fetchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See**: https://docs.bitfinex.com/reference/rest-public-trades | 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, default 120, max 10000 | | 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 [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | | params.until | int | No | the latest time in ms to fetch entries for | ```javascript bitfinex2.fetchTrades (symbol[, since, limit, 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 [bitfinex2](#bitfinex2) **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 | 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, default 100 max 10000 | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | timestamp in ms of the latest candle to fetch | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript bitfinex2.fetchOHLCV (symbol, timeframe[, since, limit, params]) ``` ### createOrder{docsify-ignore} create an order on the exchange **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-submit-order | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified CCXT market symbol | | type | string | Yes | 'limit' or 'market' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | the amount of currency to trade | | price | float | No | price of the order | | params | object | No | extra parameters specific to the exchange API endpoint | | params.stopPrice | float | No | the price that triggers a trigger order | | params.timeInForce | string | No | "GTC", "IOC", "FOK", or "PO" | | params.postOnly | boolean | No | set to true if you want to make a post only order | | params.reduceOnly | boolean | No | indicates that the order is to reduce the size of a position | | params.flags | int | No | additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates) | | params.lev | int | No | leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive. | | params.price_aux_limit | string | No | order price for stop limit orders | | params.price_oco_stop | string | No | OCO stop price | | params.trailingAmount | string | No | *swap only* the quote amount to trail away from the current market price | ```javascript bitfinex2.createOrder (symbol, type, side, amount[, price, params]) ``` ### createOrders{docsify-ignore} create a list of trade orders **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-order-multi | Param | Type | Required | Description | | --- | --- | --- | --- | | orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.createOrders (orders[, params]) ``` ### cancelAllOrders{docsify-ignore} cancel all open orders **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple | 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 | ```javascript bitfinex2.cancelAllOrders (symbol[, params]) ``` ### cancelOrder{docsify-ignore} cancels an open order **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-cancel-order | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | symbol | string | Yes | Not used by bitfinex2 cancelOrder () | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.cancelOrder (id, symbol[, params]) ``` ### cancelOrders{docsify-ignore} cancel multiple orders at the same time **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an array of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple | Param | Type | Required | Description | | --- | --- | --- | --- | | ids | Array<string> | Yes | order ids | | symbol | string | Yes | unified market symbol, default is undefined | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.cancelOrders (ids, symbol[, params]) ``` ### fetchOpenOrder{docsify-ignore} fetch an open order by it's id **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | symbol | string | Yes | unified market symbol, default is undefined | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchOpenOrder (id, symbol[, params]) ``` ### fetchClosedOrder{docsify-ignore} fetch an open order by it's id **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | symbol | string | Yes | unified market symbol, default is undefined | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchClosedOrder (id, symbol[, params]) ``` ### fetchOpenOrders{docsify-ignore} fetch all unfilled currently open orders **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol | 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 | ```javascript bitfinex2.fetchOpenOrders (symbol[, since, limit, params]) ``` ### fetchClosedOrders{docsify-ignore} fetches information on multiple closed orders made by the user **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol | 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 latest time in ms to fetch entries 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](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript bitfinex2.fetchClosedOrders (symbol[, since, limit, params]) ``` ### fetchOrderTrades{docsify-ignore} fetch all the trades made from a single order **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-order-trades | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | 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 to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchOrderTrades (id, symbol[, since, limit, params]) ``` ### fetchMyTrades{docsify-ignore} fetch all trades made by the user **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See** - https://docs.bitfinex.com/reference/rest-auth-trades - https://docs.bitfinex.com/reference/rest-auth-trades-by-symbol | 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 | ```javascript bitfinex2.fetchMyTrades (symbol[, since, limit, params]) ``` ### createDepositAddress{docsify-ignore} create a currency deposit address **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-deposit-address | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code of the currency for the deposit address | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.createDepositAddress (code[, params]) ``` ### fetchDepositAddress{docsify-ignore} fetch the deposit address for a currency associated with this account **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-deposit-address | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchDepositAddress (code[, params]) ``` ### fetchTradingFees{docsify-ignore} fetch the trading fees for multiple markets **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a dictionary of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) indexed by market symbols **See**: https://docs.bitfinex.com/reference/rest-auth-summary | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchTradingFees ([params]) ``` ### fetchDepositsWithdrawals{docsify-ignore} fetch history of deposits and withdrawals **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a list of [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See** - https://docs.bitfinex.com/reference/movement-info - https://docs.bitfinex.com/reference/rest-auth-movements | 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 | ```javascript bitfinex2.fetchDepositsWithdrawals ([code, since, limit, params]) ``` ### withdraw{docsify-ignore} make a withdrawal **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-withdraw | 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 | ```javascript bitfinex2.withdraw (code, amount, address, tag[, params]) ``` ### fetchPositions{docsify-ignore} fetch all open positions **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - a list of [position structure](https://docs.ccxt.com/#/?id=position-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-positions | 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 | ```javascript bitfinex2.fetchPositions (symbols[, params]) ``` ### fetchLedger{docsify-ignore} fetch the history of changes, actions done by the user or operations that altered balance of the user **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [ledger structure](https://docs.ccxt.com/#/?id=ledger-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-ledgers | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | 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 entrys to return, default is undefined max is 2500 | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | timestamp in ms of the latest ledger entry | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript bitfinex2.fetchLedger (code[, since, limit, params]) ``` ### fetchFundingRate{docsify-ignore} fetch the current funding rate **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure) **See**: https://docs.bitfinex.com/reference/rest-public-derivatives-status | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchFundingRate (symbol[, params]) ``` ### fetchFundingRate{docsify-ignore} fetch the current funding rate **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure) **See**: https://docs.bitfinex.com/reference/rest-public-derivatives-status | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchFundingRate (symbols[, params]) ``` ### fetchFundingRateHistory{docsify-ignore} fetches historical funding rate prices **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure) **See**: https://docs.bitfinex.com/reference/rest-public-derivatives-status-history | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | since | int | No | timestamp in ms of the earliest funding rate entry | | limit | int | No | max number of funding rate entrys to return | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | timestamp in ms of the latest funding rate | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript bitfinex2.fetchFundingRateHistory (symbol[, since, limit, params]) ``` ### fetchOpenInterest{docsify-ignore} retrieves the open interest of a contract trading pair **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [open interest structure](https://docs.ccxt.com/#/?id=open-interest-structure) **See**: https://docs.bitfinex.com/reference/rest-public-derivatives-status | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified CCXT market symbol | | params | object | No | exchange specific parameters | ```javascript bitfinex2.fetchOpenInterest (symbol[, params]) ``` ### fetchOpenInterestHistory{docsify-ignore} retrieves the open interest history of a currency **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: An array of [open interest structures](https://docs.ccxt.com/#/?id=open-interest-structure) **See**: https://docs.bitfinex.com/reference/rest-public-derivatives-status-history | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified CCXT market symbol | | timeframe | string | Yes | the time period of each row of data, not used by bitfinex2 | | since | int | No | the time in ms of the earliest record to retrieve as a unix timestamp | | limit | int | No | the number of records in the response | | params | object | No | exchange specific parameters | | params.until | int | No | the time in ms of the latest record to retrieve as a unix timestamp | | params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript bitfinex2.fetchOpenInterestHistory (symbol, timeframe[, since, limit, params]) ``` ### fetchLiquidations{docsify-ignore} retrieves the public liquidations of a trading pair **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an array of [liquidation structures](https://docs.ccxt.com/#/?id=liquidation-structure) **See**: https://docs.bitfinex.com/reference/rest-public-liquidations | 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 | | 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 [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) | ```javascript bitfinex2.fetchLiquidations (symbol[, since, limit, params]) ``` ### setMargin{docsify-ignore} either adds or reduces margin in a swap position in order to set the margin to a specific value **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - A [margin structure](https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-deriv-pos-collateral-set | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market to set margin in | | amount | float | Yes | the amount to set the margin to | | params | object | No | parameters specific to the exchange API endpoint | ```javascript bitfinex2.setMargin (symbol, amount[, params]) ``` ### fetchOrder{docsify-ignore} fetches information on an order made by the user **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders - https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | the order id | | symbol | string | No | unified symbol of the market the order was made in | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitfinex2.fetchOrder (id[, symbol, params]) ``` ### editOrder{docsify-ignore} edit a trade order **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See**: https://docs.bitfinex.com/reference/rest-auth-update-order | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | edit order id | | symbol | string | Yes | unified symbol of the market to edit an order in | | type | string | Yes | 'market' or 'limit' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much you want to trade in units of the 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.stopPrice | float | No | the price that triggers a trigger order | | params.postOnly | boolean | No | set to true if you want to make a post only order | | params.reduceOnly | boolean | No | indicates that the order is to reduce the size of a position | | params.flags | int | No | additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates) | | params.leverage | int | No | leverage for a derivative order, supported by derivative symbol orders only, the value should be between 1 and 100 inclusive | | params.clientOrderId | int | No | a unique client order id for the order | | params.trailingAmount | float | No | *swap only* the quote amount to trail away from the current market price | ```javascript bitfinex2.editOrder (id, symbol, type, side, amount[, price, 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 [bitfinex2](#bitfinex2) **Returns**: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume | 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 | ```javascript bitfinex2.watchOHLCV (symbol, timeframe[, since, limit, params]) ``` ### watchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) | 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 | ```javascript bitfinex2.watchTrades (symbol[, since, limit, params]) ``` ### watchMyTrades{docsify-ignore} watches information on multiple trades made by the user **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) | 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 | ```javascript bitfinex2.watchMyTrades (symbol[, since, limit, 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 [bitfinex2](#bitfinex2) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) | 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 | ```javascript bitfinex2.watchTicker (symbol[, params]) ``` ### watchOrderBook{docsify-ignore} watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols | 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 | ```javascript bitfinex2.watchOrderBook (symbol[, 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 [bitfinex2](#bitfinex2) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | str | No | spot or contract if not provided this.options['defaultType'] is used | ```javascript bitfinex2.watchBalance ([params]) ``` ### watchOrders{docsify-ignore} watches information on multiple orders made by the user **Kind**: instance method of [bitfinex2](#bitfinex2) **Returns**: Array<object> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) | 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 | ```javascript bitfinex2.watchOrders (symbol[, since, limit, params]) ```