wiki/exchanges/krakenfutures.md
<a name="krakenfutures" id="krakenfutures"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="fetchMarkets" id="fetchmarkets"></a>
Fetches the available trading markets from the exchange, Multi-collateral markets are returned as linear markets, but can be settled in multiple currencies
Kind: instance method of <code>krakenfutures</code>
Returns: An array of market structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-instruments
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | exchange specific params |
krakenfutures.fetchMarkets ([params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
Fetches a list of open orders in a market
Kind: instance method of <code>krakenfutures</code>
Returns: An order book structure
See: https://docs.kraken.com/api/docs/futures-api/trading/get-orderbook
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified market symbol |
| limit | <code>int</code> | No | Not used by krakenfutures |
| params | <code>object</code> | No | exchange specific params |
krakenfutures.fetchOrderBook (symbol[, limit, params])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - an array of ticker structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.fetchTickers (symbols[, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>krakenfutures</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.kraken.com/api/docs/futures-api/charts/candles
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
krakenfutures.fetchOHLCV (symbol, timeframe[, since, limit, params])
<a name="fetchTrades" id="fetchtrades"></a>
Fetch a history of filled trades that this account has made
Kind: instance method of <code>krakenfutures</code>
Returns: An array of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| since | <code>int</code> | No | Timestamp in ms of earliest trade. Not used by krakenfutures except in combination with params.until |
| limit | <code>int</code> | No | Total number of trades, cannot exceed 100 |
| params | <code>object</code> | No | Exchange specific params |
| params.until | <code>int</code> | No | Timestamp in ms of latest trade |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.method | <code>string</code> | No | The method to use to fetch trades. Can be 'historyGetMarketSymbolExecutions' or 'publicGetHistory' default is 'historyGetMarketSymbolExecutions' |
krakenfutures.fetchTrades (symbol[, since, limit, params])
<a name="createOrder" id="createorder"></a>
Create an order on the exchange
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - an order structure
See: https://docs.kraken.com/api/docs/futures-api/trading/send-order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | number of contracts |
| price | <code>float</code> | No | limit order price |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.reduceOnly | <code>bool</code> | No | set as true if you wish the order to only reduce an existing position, any order which increases an existing position will be rejected, default is false |
| params.postOnly | <code>bool</code> | No | set as true if you wish to make a postOnly order, default is false |
| params.clientOrderId | <code>string</code> | No | UUID The order identity that is specified from the user, It must be globally unique |
| params.triggerPrice | <code>float</code> | No | the price that a stop order is triggered at |
| params.stopLossPrice | <code>float</code> | No | the price that a stop loss order is triggered at |
| params.takeProfitPrice | <code>float</code> | No | the price that a take profit order is triggered at |
| params.triggerSignal | <code>string</code> | No | for triggerPrice, stopLossPrice and takeProfitPrice orders, the trigger price type, 'last', 'mark' or 'index', default is 'last' |
krakenfutures.createOrder (symbol, type, side, amount[, price, params])
<a name="createOrders" id="createorders"></a>
create a list of trade orders
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - an order structure
See: https://docs.kraken.com/api/docs/futures-api/trading/send-batch-order
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.createOrders (orders[, params])
<a name="editOrder" id="editorder"></a>
Edit an open order on the exchange
Kind: instance method of <code>krakenfutures</code>
Returns: An order structure
See: https://docs.kraken.com/api/docs/futures-api/trading/edit-order-spring
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | Not used by Krakenfutures |
| type | <code>string</code> | Yes | Not used by Krakenfutures |
| side | <code>string</code> | Yes | Not used by Krakenfutures |
| amount | <code>float</code> | Yes | Order size |
| price | <code>float</code> | No | Price to fill order at |
| params | <code>object</code> | No | Exchange specific params |
krakenfutures.editOrder (id, symbol, type, side, amount[, price, params])
<a name="cancelOrder" id="cancelorder"></a>
Cancel an open order on the exchange
Kind: instance method of <code>krakenfutures</code>
Returns: An order structure
See: https://docs.kraken.com/api/docs/futures-api/trading/cancel-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | Order id |
| symbol | <code>string</code> | Yes | Not used by Krakenfutures |
| params | <code>object</code> | No | Exchange specific params |
krakenfutures.cancelOrder (id, symbol[, params])
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - an list of order structures
See: https://docs.kraken.com/api/docs/futures-api/trading/send-batch-order
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | No | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.clientOrderIds | <code>Array<string></code> | No | max length 10 e.g. ["my_id_1","my_id_2"] |
krakenfutures.cancelOrders (ids[, symbol, params])
<a name="cancelAllOrders" id="cancelallorders"></a>
Cancels all orders on the exchange, including trigger orders
Kind: instance method of <code>krakenfutures</code>
Returns: Response from exchange api
See: https://docs.kraken.com/api/docs/futures-api/trading/cancel-all-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>str</code> | Yes | Unified market symbol |
| params | <code>dict</code> | No | Exchange specific params |
krakenfutures.cancelAllOrders (symbol[, params])
<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>
dead man's switch, cancel all orders after the given timeout
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - the api result
See: https://docs.kraken.com/api/docs/futures-api/trading/cancel-all-orders-after
| Param | Type | Required | Description |
|---|---|---|---|
| timeout | <code>number</code> | Yes | time in milliseconds, 0 represents cancel the timer |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.cancelAllOrdersAfter (timeout[, params])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
Gets all open orders, including trigger orders, for an account from the exchange api
Kind: instance method of <code>krakenfutures</code>
Returns: An array of order structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-open-orders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified market symbol |
| since | <code>int</code> | No | Timestamp (ms) of earliest order. (Not used by kraken api but filtered internally by CCXT) |
| limit | <code>int</code> | No | How many orders to return. (Not used by kraken api but filtered internally by CCXT) |
| params | <code>object</code> | No | Exchange specific parameters |
krakenfutures.fetchOpenOrders (symbol[, since, limit, params])
<a name="fetchOrders" id="fetchorders"></a>
Gets all orders for an account from the exchange api
Kind: instance method of <code>krakenfutures</code>
Returns: An array of order structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-order-status/
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified market symbol |
| since | <code>int</code> | No | Timestamp (ms) of earliest order. (Not used by kraken api but filtered internally by CCXT) |
| limit | <code>int</code> | No | How many orders to return. (Not used by kraken api but filtered internally by CCXT) |
| params | <code>object</code> | No | Exchange specific parameters |
krakenfutures.fetchOrders (symbol[, since, limit, params])
<a name="fetchOrder" id="fetchorder"></a>
fetches information on an order made by the user
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - An order structure
See: https://docs.kraken.com/api/docs/futures-api/trading/get-order-status/
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the order id |
| symbol | <code>string</code> | Yes | unified market symbol that the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.fetchOrder (id, symbol[, params])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
Gets all closed orders, including trigger orders, for an account from the exchange api
Kind: instance method of <code>krakenfutures</code>
Returns: An array of order structures
See: https://docs.futures.kraken.com/#http-api-history-account-history-get-order-events
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified market symbol |
| since | <code>int</code> | No | Timestamp (ms) of earliest order. |
| limit | <code>int</code> | No | How many orders to return. |
| params | <code>object</code> | No | Exchange specific parameters |
| params.trigger | <code>bool</code> | No | set to true if you wish to fetch only trigger orders |
krakenfutures.fetchClosedOrders (symbol[, since, limit, params])
<a name="fetchCanceledOrders" id="fetchcanceledorders"></a>
Gets all canceled orders, including trigger orders, for an account from the exchange api
Kind: instance method of <code>krakenfutures</code>
Returns: An array of order structures
See: https://docs.kraken.com/api/docs/futures-api/history/get-order-events
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified market symbol |
| since | <code>int</code> | No | Timestamp (ms) of earliest order. |
| limit | <code>int</code> | No | How many orders to return. |
| params | <code>object</code> | No | Exchange specific parameters |
| params.trigger | <code>bool</code> | No | set to true if you wish to fetch only trigger orders |
krakenfutures.fetchCanceledOrders (symbol[, since, limit, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>krakenfutures</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-fills
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | not used by the api the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
krakenfutures.fetchMyTrades (symbol[, since, limit, params])
<a name="fetchBalance" id="fetchbalance"></a>
Fetch the balance for a sub-account, all sub-account balances are inside 'info' in the response
Kind: instance method of <code>krakenfutures</code>
Returns: A balance structure
See: https://docs.kraken.com/api/docs/futures-api/trading/get-accounts
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | Exchange specific parameters |
| params.type | <code>string</code> | No | The sub-account type to query the balance of, possible values include 'flex', 'cash'/'main'/'funding', or a market symbol * defaults to 'flex' * |
| params.symbol | <code>string</code> | No | A unified market symbol, when assigned the balance for a trading market that matches the symbol is returned |
krakenfutures.fetchBalance ([params])
<a name="fetchFundingRates" id="fetchfundingrates"></a>
fetch the current funding rates for multiple markets
Kind: instance method of <code>krakenfutures</code>
Returns: <code>Array<Order></code> - an array of funding rate structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.fetchFundingRates (symbols[, params])
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
fetches historical funding rate prices
Kind: instance method of <code>krakenfutures</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See: https://docs.kraken.com/api/docs/futures-api/trading/historical-funding-rates
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the funding rate history for |
| since | <code>int</code> | No | timestamp in ms of the earliest funding rate to fetch |
| limit | <code>int</code> | No | the maximum amount of funding rate structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the api endpoint |
krakenfutures.fetchFundingRateHistory (symbol[, since, limit, params])
<a name="fetchPositions" id="fetchpositions"></a>
Fetches current contract trading positions
Kind: instance method of <code>krakenfutures</code>
Returns: Parsed exchange response for positions
See: https://docs.kraken.com/api/docs/futures-api/trading/get-open-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | List of unified symbols |
| params | <code>object</code> | No | Not used by krakenfutures |
krakenfutures.fetchPositions (symbols[, params])
<a name="fetchLeverageTiers" id="fetchleveragetiers"></a>
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - a dictionary of leverage tiers structures, indexed by market symbols
See: https://docs.kraken.com/api/docs/futures-api/trading/get-instruments
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.fetchLeverageTiers (symbols[, params])
<a name="transferOut" id="transferout"></a>
transfer from futures wallet to spot wallet
Kind: instance method of <code>krakenfutures</code>
Returns: a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>str</code> | Yes | Unified currency code |
| amount | <code>float</code> | Yes | Size of the transfer |
| params | <code>dict</code> | No | Exchange specific parameters |
krakenfutures.transferOut (code, amount[, params])
<a name="transfer" id="transfer"></a>
transfers currencies between sub-accounts
Kind: instance method of <code>krakenfutures</code>
Returns: a transfer structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | Unified currency code |
| amount | <code>float</code> | Yes | Size of the transfer |
| fromAccount | <code>string</code> | Yes | 'main'/'funding'/'future', 'flex', or a unified market symbol |
| toAccount | <code>string</code> | Yes | 'main'/'funding', 'flex', 'spot' or a unified market symbol |
| params | <code>object</code> | No | Exchange specific parameters |
krakenfutures.transfer (code, amount, fromAccount, toAccount[, params])
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - response from the exchange
See: https://docs.kraken.com/api/docs/futures-api/trading/set-leverage-setting
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.setLeverage (leverage, symbol[, params])
<a name="fetchLeverages" id="fetchleverages"></a>
fetch the set leverage for all contract and margin markets
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - a list of leverage structures
See: https://docs.kraken.com/api/docs/futures-api/trading/get-leverage-setting
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.fetchLeverages ([symbols, params])
<a name="fetchLeverage" id="fetchleverage"></a>
fetch the set leverage for a market
Kind: instance method of <code>krakenfutures</code>
Returns: <code>object</code> - a leverage structure
See: https://docs.kraken.com/api/docs/futures-api/trading/get-leverage-setting
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
krakenfutures.fetchLeverage (symbol[, params])