Back to Ccxt

Krakenfutures

wiki/exchanges/krakenfutures.md

4.5.5225.4 KB
Original Source

<a name="krakenfutures" id="krakenfutures"></a>

krakenfutures{docsify-ignore}

Kind: global class
Extends: <code>Exchange</code>

<a name="fetchMarkets" id="fetchmarkets"></a>

fetchMarkets{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noexchange specific params
javascript
krakenfutures.fetchMarkets ([params])

<a name="fetchOrderBook" id="fetchorderbook"></a>

fetchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified market symbol
limit<code>int</code>NoNot used by krakenfutures
params<code>object</code>Noexchange specific params
javascript
krakenfutures.fetchOrderBook (symbol[, limit, params])

<a name="fetchTickers" id="fetchtickers"></a>

fetchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.fetchTickers (symbols[, params])

<a name="fetchOHLCV" id="fetchohlcv"></a>

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 <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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
krakenfutures.fetchOHLCV (symbol, timeframe[, since, limit, params])

<a name="fetchTrades" id="fetchtrades"></a>

fetchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified CCXT market symbol
since<code>int</code>NoTimestamp in ms of earliest trade. Not used by krakenfutures except in combination with params.until
limit<code>int</code>NoTotal number of trades, cannot exceed 100
params<code>object</code>NoExchange specific params
params.until<code>int</code>NoTimestamp in ms of latest trade
params.paginate<code>boolean</code>Nodefault 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>NoThe method to use to fetch trades. Can be 'historyGetMarketSymbolExecutions' or 'publicGetHistory' default is 'historyGetMarketSymbolExecutions'
javascript
krakenfutures.fetchTrades (symbol[, since, limit, params])

<a name="createOrder" id="createorder"></a>

createOrder{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
type<code>string</code>Yes'limit' or 'market'
side<code>string</code>Yes'buy' or 'sell'
amount<code>float</code>Yesnumber of contracts
price<code>float</code>Nolimit order price
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.reduceOnly<code>bool</code>Noset 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>Noset as true if you wish to make a postOnly order, default is false
params.clientOrderId<code>string</code>NoUUID The order identity that is specified from the user, It must be globally unique
params.triggerPrice<code>float</code>Nothe price that a stop order is triggered at
params.stopLossPrice<code>float</code>Nothe price that a stop loss order is triggered at
params.takeProfitPrice<code>float</code>Nothe price that a take profit order is triggered at
params.triggerSignal<code>string</code>Nofor triggerPrice, stopLossPrice and takeProfitPrice orders, the trigger price type, 'last', 'mark' or 'index', default is 'last'
javascript
krakenfutures.createOrder (symbol, type, side, amount[, price, params])

<a name="createOrders" id="createorders"></a>

createOrders{docsify-ignore}

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

ParamTypeRequiredDescription
orders<code>Array</code>Yeslist 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>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.createOrders (orders[, params])

<a name="editOrder" id="editorder"></a>

editOrder{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>YesNot used by Krakenfutures
type<code>string</code>YesNot used by Krakenfutures
side<code>string</code>YesNot used by Krakenfutures
amount<code>float</code>YesOrder size
price<code>float</code>NoPrice to fill order at
params<code>object</code>NoExchange specific params
javascript
krakenfutures.editOrder (id, symbol, type, side, amount[, price, params])

<a name="cancelOrder" id="cancelorder"></a>

cancelOrder{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>YesOrder id
symbol<code>string</code>YesNot used by Krakenfutures
params<code>object</code>NoExchange specific params
javascript
krakenfutures.cancelOrder (id, symbol[, params])

<a name="cancelOrders" id="cancelorders"></a>

cancelOrders{docsify-ignore}

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

ParamTypeRequiredDescription
ids<code>Array<string></code>Yesorder ids
symbol<code>string</code>Nounified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS
params.clientOrderIds<code>Array<string></code>Nomax length 10 e.g. ["my_id_1","my_id_2"]
javascript
krakenfutures.cancelOrders (ids[, symbol, params])

<a name="cancelAllOrders" id="cancelallorders"></a>

cancelAllOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>str</code>YesUnified market symbol
params<code>dict</code>NoExchange specific params
javascript
krakenfutures.cancelAllOrders (symbol[, params])

<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>

cancelAllOrdersAfter{docsify-ignore}

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

ParamTypeRequiredDescription
timeout<code>number</code>Yestime in milliseconds, 0 represents cancel the timer
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.cancelAllOrdersAfter (timeout[, params])

<a name="fetchOpenOrders" id="fetchopenorders"></a>

fetchOpenOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified market symbol
since<code>int</code>NoTimestamp (ms) of earliest order. (Not used by kraken api but filtered internally by CCXT)
limit<code>int</code>NoHow many orders to return. (Not used by kraken api but filtered internally by CCXT)
params<code>object</code>NoExchange specific parameters
javascript
krakenfutures.fetchOpenOrders (symbol[, since, limit, params])

<a name="fetchOrders" id="fetchorders"></a>

fetchOrders{docsify-ignore}

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/

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified market symbol
since<code>int</code>NoTimestamp (ms) of earliest order. (Not used by kraken api but filtered internally by CCXT)
limit<code>int</code>NoHow many orders to return. (Not used by kraken api but filtered internally by CCXT)
params<code>object</code>NoExchange specific parameters
javascript
krakenfutures.fetchOrders (symbol[, since, limit, params])

<a name="fetchOrder" id="fetchorder"></a>

fetchOrder{docsify-ignore}

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/

ParamTypeRequiredDescription
id<code>string</code>Yesthe order id
symbol<code>string</code>Yesunified market symbol that the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.fetchOrder (id, symbol[, params])

<a name="fetchClosedOrders" id="fetchclosedorders"></a>

fetchClosedOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified market symbol
since<code>int</code>NoTimestamp (ms) of earliest order.
limit<code>int</code>NoHow many orders to return.
params<code>object</code>NoExchange specific parameters
params.trigger<code>bool</code>Noset to true if you wish to fetch only trigger orders
javascript
krakenfutures.fetchClosedOrders (symbol[, since, limit, params])

<a name="fetchCanceledOrders" id="fetchcanceledorders"></a>

fetchCanceledOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified market symbol
since<code>int</code>NoTimestamp (ms) of earliest order.
limit<code>int</code>NoHow many orders to return.
params<code>object</code>NoExchange specific parameters
params.trigger<code>bool</code>Noset to true if you wish to fetch only trigger orders
javascript
krakenfutures.fetchCanceledOrders (symbol[, since, limit, params])

<a name="fetchMyTrades" id="fetchmytrades"></a>

fetchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nonot used by the api the earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Nothe latest time in ms to fetch entries for
javascript
krakenfutures.fetchMyTrades (symbol[, since, limit, params])

<a name="fetchBalance" id="fetchbalance"></a>

fetchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>NoExchange specific parameters
params.type<code>string</code>NoThe 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>NoA unified market symbol, when assigned the balance for a trading market that matches the symbol is returned
javascript
krakenfutures.fetchBalance ([params])

<a name="fetchFundingRates" id="fetchfundingrates"></a>

fetchFundingRates{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.fetchFundingRates (symbols[, params])

<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>

fetchFundingRateHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the funding rate history for
since<code>int</code>Notimestamp in ms of the earliest funding rate to fetch
limit<code>int</code>Nothe maximum amount of funding rate structures to fetch
params<code>object</code>Noextra parameters specific to the api endpoint
javascript
krakenfutures.fetchFundingRateHistory (symbol[, since, limit, params])

<a name="fetchPositions" id="fetchpositions"></a>

fetchPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>YesList of unified symbols
params<code>object</code>NoNot used by krakenfutures
javascript
krakenfutures.fetchPositions (symbols[, params])

<a name="fetchLeverageTiers" id="fetchleveragetiers"></a>

fetchLeverageTiers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.fetchLeverageTiers (symbols[, params])

<a name="transferOut" id="transferout"></a>

transferOut{docsify-ignore}

transfer from futures wallet to spot wallet

Kind: instance method of <code>krakenfutures</code>
Returns: a transfer structure

ParamTypeRequiredDescription
code<code>str</code>YesUnified currency code
amount<code>float</code>YesSize of the transfer
params<code>dict</code>NoExchange specific parameters
javascript
krakenfutures.transferOut (code, amount[, params])

<a name="transfer" id="transfer"></a>

transfer{docsify-ignore}

transfers currencies between sub-accounts

Kind: instance method of <code>krakenfutures</code>
Returns: a transfer structure

See

ParamTypeRequiredDescription
code<code>string</code>YesUnified currency code
amount<code>float</code>YesSize 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>NoExchange specific parameters
javascript
krakenfutures.transfer (code, amount, fromAccount, toAccount[, params])

<a name="setLeverage" id="setleverage"></a>

setLeverage{docsify-ignore}

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

ParamTypeRequiredDescription
leverage<code>float</code>Yesthe rate of leverage
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.setLeverage (leverage, symbol[, params])

<a name="fetchLeverages" id="fetchleverages"></a>

fetchLeverages{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Noa list of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.fetchLeverages ([symbols, params])

<a name="fetchLeverage" id="fetchleverage"></a>

fetchLeverage{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
krakenfutures.fetchLeverage (symbol[, params])