derive
derive cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
🔌 Looking for raw exchange endpoints? See the derive implicit API — every endpoint in this exchange's API exposed as an implicit method.
derive
Kind: global class
Extends: Exchange
- fetchTime
- fetchAccounts
- fetchCurrencies
- fetchMarkets
- fetchTicker
- fetchOpenInterest
- fetchGreeks
- fetchOption
- fetchSettlementHistory
- fetchMySettlementHistory
- fetchTrades
- fetchOHLCV
- fetchFundingRateHistory
- fetchFundingRate
- createOrder
- editOrder
- cancelOrder
- cancelAllOrders
- fetchCanceledAndClosedOrders
- fetchOrder
- fetchOpenOrders
- fetchClosedOrders
- fetchCanceledOrders
- fetchOrderTrades
- fetchMyTrades
- fetchPositions
- fetchFundingHistory
- fetchBalance
- transfer
- fetchTransfers
- fetchBorrowRateHistory
- fetchBorrowInterest
- withdraw
- fetchDeposits
- fetchWithdrawals
- watchOrderBook
- watchTicker
- unWatchTicker
- watchBidsAsks
- unWatchOrderBook
- unWatchTrades
- watchTrades
- watchOrders
- unWatchOrders
- watchMyTrades
- unWatchMyTrades
- watchBalance
- watchPositions
fetchTime
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of derive
Returns: int - the current integer timestamp in milliseconds from the exchange server
See: https://docs.derive.xyz/api-reference/system/publicget_time
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchTime (params?)fetchAccounts
fetch all the subaccounts associated with the wallet
Kind: instance method of derive
Returns: Array<object> - a list of account structures
See: https://docs.derive.xyz/api-reference/subaccounts/privateget_subaccounts
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchAccounts (params?)fetchCurrencies
fetches all available currencies on an exchange
Kind: instance method of derive
Returns: object - an associative dictionary of currencies
See: https://docs.derive.xyz/api-reference/market-data/publicget_all_currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchCurrencies (params?)fetchMarkets
retrieves data on all markets for derive
Kind: instance method of derive
Returns: Array<object> - an array of objects representing market data
See: https://docs.derive.xyz/api-reference/market-data/publicget_all_instruments
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchMarkets (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 derive
Returns: object - a ticker structure
See: https://docs.derive.xyz/api-reference/market-data/publicget_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 |
derive.fetchTicker (symbol, params?)fetchOpenInterest
retrieves the open interest of a contract market
Kind: instance method of derive
Returns: object - an open interest structure
See: https://docs.derive.xyz/api-reference/market-data/publicget_ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the open interest for |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchOpenInterest (symbol, params?)fetchGreeks
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance method of derive
Returns: object - a greeks structure
See: https://docs.derive.xyz/api-reference/market-data/publicget_ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch greeks for |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchGreeks (symbol, params?)fetchOption
fetches option data that is commonly found in an option chain
Kind: instance method of derive
Returns: object - an option structure
See: https://docs.derive.xyz/api-reference/market-data/publicget_ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchOption (symbol, params?)fetchSettlementHistory
fetches historical settlement records, the venue publishes one underlying settlement price per currency and expiry rather than per option instrument, so the records carry no symbol
Kind: instance method of derive
Returns: Array<object> - a list of settlement history objects
See: https://docs.derive.xyz/api-reference/market-data/publicget_option_settlement_prices
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of any market of the underlying currency to fetch the settlement history for |
| since | int | No | timestamp in ms of the earliest settlement to fetch |
| limit | int | No | the maximum number of settlements to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchSettlementHistory (symbol, since?, limit?, params?)fetchMySettlementHistory
fetches historical settlement records of the user
Kind: instance method of derive
Returns: Array<object> - a list of settlement history objects
See: https://docs.derive.xyz/api-reference/history/privateget_option_settlement_history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the settlement history to fetch |
| since | int | No | timestamp in ms of the earliest settlement to fetch |
| limit | int | No | the maximum number of settlements to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchMySettlementHistory (symbol?, since?, limit?, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of derive
Returns: Array<Trade> - a list of trade structures
See: https://docs.derive.xyz/api-reference/market-data/publicget_trade_history
| 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; limits above ~500 cannot be filled in a single request because the venue caps pages at 1000 raw rows (two per match), use params.paginate instead |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch trades for |
| 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 |
derive.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 derive
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://docs.derive.xyz/api-reference/market-data/publicget_tradingview_chart_data // trade candles
- https://docs.derive.xyz/api-reference/market-data/publicget_index_chart_data // params.price = 'index'
| 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; a single request covers at most 5000 candles from since, use params.paginate for wider ranges |
| limit | int | No | the maximum amount of candles to fetch, also sizes the request window when since is not provided |
| 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.price | string | No | "index" to fetch candles of the index price instead of trades, their volume is undefined |
| 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 |
derive.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance method of derive
Returns: Array<object> - a list of funding rate structures
See: https://docs.derive.xyz/api-reference/market-data/publicget_funding_rate_history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the funding rate history for |
| since | int | No | timestamp in ms of the earliest funding rate to fetch |
| limit | int | No | the maximum amount of funding rate structures to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchFundingRateHistory (symbol, since?, limit?, params?)fetchFundingRate
fetch the current funding rate
Kind: instance method of derive
Returns: object - a funding rate structure
See: https://docs.derive.xyz/api-reference/market-data/publicget_funding_rate_history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.fetchFundingRate (symbol, params?)createOrder
create a trade order
Kind: instance method of derive
Returns: object - an order structure
See: https://docs.derive.xyz/api-reference/orderbook/privateorder
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of 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.subaccount_id | string | No | required the subaccount id |
| params.triggerPrice | float | No | the price a standalone trigger (stop) order is triggered at |
| params.stopLossPrice | float | No | the price a standalone stop loss order is triggered at |
| params.takeProfitPrice | float | No | the price a standalone take profit order is triggered at |
| params.trigger_price_type | string | No | the price type the trigger watches, only 'mark' is supported by the venue (default) |
| params.postOnly | bool | No | true makes the order post only |
| params.reduceOnly | bool | No | true reduces the position only, not available with post only |
| params.max_fee | float | No | required the maximum fee you are willing to pay for the order |
derive.createOrder (symbol, type, side, amount, price?, params?)editOrder
edit a trade order
Kind: instance method of derive
Returns: object - an order structure
See: https://docs.derive.xyz/api-reference/orderbook/privatereplace
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of 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.subaccount_id | string | No | required the subaccount id |
derive.editOrder (id, symbol, type, side, amount, price?, params?)cancelOrder
cancels an open order
Kind: instance method of derive
Returns: object - An order structure
See: https://docs.derive.xyz/api-reference/orderbook/privatecancel
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | boolean | No | whether the order is a trigger/algo order |
| params.subaccount_id | string | No | required the subaccount id |
derive.cancelOrder (id, symbol, params?)cancelAllOrders
cancel all open orders in a market
Kind: instance method of derive
Returns: object - an list of order structures
See
- https://docs.derive.xyz/api-reference/orderbook/privatecancel_by_instrument
- https://docs.derive.xyz/api-reference/orderbook/privatecancel_all
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.cancelAllOrders (symbol?, params?)fetchCanceledAndClosedOrders
fetches information on multiple canceled and closed orders made by the user; only orders in a terminal state (filled, cancelled, expired) are returned, use fetchOpenOrders for orders resting on the order book
Kind: instance method of derive
Returns: Array<Order> - a list of order structures
See: https://docs.derive.xyz/api-reference/history/privateget_order_history
| 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 orders for |
| params.paginate | boolean | No | set to true if you want to fetch orders with pagination |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchCanceledAndClosedOrders (symbol, since?, limit?, params?)fetchOrder
fetches information on an order made by the user, a standalone trigger order is not visible here until it triggers, list those through fetchOpenOrders with params.trigger instead
Kind: instance method of derive
Returns: object - an order structure
See: https://docs.derive.xyz/api-reference/orderbook/privateget_order
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| symbol | string | No | not used by derive.fetchOrder |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchOrder (id, symbol?, params?)fetchOpenOrders
fetches information on all currently open orders of the user resting on the order book
Kind: instance method of derive
Returns: Array<Order> - a list of order structures
See
- https://docs.derive.xyz/api-reference/orderbook/privateget_open_orders
- https://docs.derive.xyz/api-reference/orderbook/privateget_trigger_orders
| 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.trigger | boolean | No | when true fetches the pending trigger orders that have not fired yet instead of the orders resting on the order book |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchOpenOrders (symbol, since?, limit?, params?)fetchClosedOrders
fetches information on multiple closed (fully filled) orders made by the user
Kind: instance method of derive
Returns: Array<Order> - a list of order structures
See: https://docs.derive.xyz/api-reference/history/privateget_order_history
| 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.paginate | boolean | No | set to true if you want to fetch orders with pagination |
derive.fetchClosedOrders (symbol, since?, limit?, params?)fetchCanceledOrders
fetches information on multiple canceled orders made by the user
Kind: instance method of derive
Returns: Array<object> - a list of order structures
See: https://docs.derive.xyz/api-reference/history/privateget_order_history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the 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.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
derive.fetchCanceledOrders (symbol, since?, limit?, params?)fetchOrderTrades
fetch all the trades made from a single order
Kind: instance method of derive
Returns: Array<object> - a list of trade structures
See: https://docs.derive.xyz/api-reference/history/privateget_trade_history
| 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 |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchOrderTrades (id, symbol, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of derive
Returns: Array<Trade> - a list of trade structures
See: https://docs.derive.xyz/api-reference/history/privateget_trade_history
| 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 |
| params.paginate | boolean | No | set to true if you want to fetch trades with pagination |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchMyTrades (symbol, since?, limit?, params?)fetchPositions
fetch all open positions
Kind: instance method of derive
Returns: Array<object> - a list of position structure
See: https://docs.derive.xyz/api-reference/subaccounts/privateget_positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | not used by fetchPositions () |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchPositions (symbols?, params?)fetchFundingHistory
fetch the history of funding payments paid and received on this account
Kind: instance method of derive
Returns: object - a funding history structure
See: https://docs.derive.xyz/api-reference/history/privateget_funding_history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| since | int | No | the earliest time in ms to fetch funding history for |
| limit | int | No | the maximum number of funding history 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 funding history 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 |
derive.fetchFundingHistory (symbol?, since?, limit?, params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of derive
Returns: object - a balance structure
See
- https://docs.derive.xyz/api-reference/subaccounts/privateget_all_portfolios // whole wallet
- https://docs.derive.xyz/api-reference/subaccounts/privateget_subaccount // params.subaccount_id
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | int | No | scope the balance to a single subaccount instead of the whole wallet |
derive.fetchBalance (params?)transfer
transfer a spot asset between subaccounts belonging to the same wallet
Kind: instance method of derive
Returns: object - a transfer structure
See: https://docs.derive.xyz/api-reference/transfers-&-withdrawals/privatetransfer_spot
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | the subaccount id to transfer from |
| toAccount | string | Yes | the subaccount id to transfer to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.max_fee_usd | float | No | the maximum accepted fee in usd, default 0: transfers between existing subaccounts are free |
| params.new_subaccount_manager | int | No | a manager id creates a fresh subaccount under the sender wallet as the destination instead of toAccount, the creation charges a fee so max_fee_usd must cover it |
derive.transfer (code, amount, fromAccount, toAccount, params?)fetchTransfers
fetch the spot transfer history of a subaccount
Kind: instance method of derive
Returns: Array<object> - a list of transfer structures
See: https://docs.derive.xyz/api-reference/history/privateget_erc20_transfer_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | timestamp in ms of the earliest transfer to fetch |
| limit | int | No | the maximum number of transfers to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest transfer to fetch |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchTransfers (code?, since?, limit?, params?)fetchBorrowRateHistory
retrieves a history of a currencies borrow interest rate at specific time slots
Kind: instance method of derive
Returns: Array<object> - an array of borrow rate structures
See: https://docs.derive.xyz/api-reference/market-data/publicget_interest_rate_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | timestamp in ms of the earliest rate to fetch |
| limit | int | No | the maximum number of rates to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest rate to fetch |
| params.risk_universe_id | int | No | the risk universe to read the rates from, default 1: without the filter the venue interleaves every universe with duplicate timestamps |
| params.period | int | No | the bucket size in seconds, default hourly |
derive.fetchBorrowRateHistory (code, since?, limit?, params?)fetchBorrowInterest
fetches the interest accrued on the cash balance of a subaccount, the venue charges or pays it on the settlement currency only
Kind: instance method of derive
Returns: Array<object> - a list of borrow interest structures
See: https://docs.derive.xyz/api-reference/history/privateget_interest_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| symbol | string | No | not used by derive.fetchBorrowInterest |
| since | int | No | timestamp in ms of the earliest interest event to fetch |
| limit | int | No | the maximum number of interest events to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest interest event to fetch |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchBorrowInterest (code?, symbol?, since?, limit?, params?)withdraw
make a withdrawal to an L1 address, the payout defaults to the owner wallet and a session key may only pay out to the owner wallet or a whitelisted recipient
Kind: instance method of derive
Returns: object - a transaction structure
See: https://docs.derive.xyz/api-reference/transfers-&-withdrawals/privatewithdraw
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the L1 address to withdraw to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.max_fee_usd | float | No | the maximum accepted fee in usd, default 1, or 10 with force_batch |
| params.force_batch | bool | No | pay the higher fee to have the withdrawal batch proven immediately |
| params.subaccount_id | string | No | required the subaccount id |
derive.withdraw (code, amount, address, params?)fetchDeposits
fetch all deposits made to an account
Kind: instance method of derive
Returns: Array<object> - a list of transaction structures
See: https://docs.derive.xyz/api-reference/history/privateget_deposit_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of deposits structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchDeposits (code, since?, limit?, params?)fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance method of derive
Returns: Array<object> - a list of transaction structures
See: https://docs.derive.xyz/api-reference/history/privateget_withdrawal_history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of withdrawals structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.fetchWithdrawals (code, since?, limit?, params?)watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of derive
Returns: object - an order book structure
See: https://docs.derive.xyz/api-reference/channels/orderbook
| 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 |
derive.watchOrderBook (symbol, 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 derive
Returns: object - a ticker structure
See: https://docs.derive.xyz/api-reference/channels/tickerslim
| 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 |
derive.watchTicker (symbol, params?)unWatchTicker
unsubscribe from the ticker channel; note that the bid ask feed of the same symbol shares the channel and stops as well
Kind: instance method of derive
Returns: any - status of the unwatch request
See: https://docs.derive.xyz/api-reference/channels/tickerslim
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.unWatchTicker (symbol, params?)watchBidsAsks
watches best bid & ask for symbols; the data is sourced from the same ticker_slim channel the ticker uses
Kind: instance method of derive
Returns: object - a dictionary of ticker structures
See: https://docs.derive.xyz/api-reference/channels/tickerslim
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbols of the markets to fetch the bids and asks for |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.watchBidsAsks (symbols, params?)unWatchOrderBook
unsubscribe from the orderbook channel
Kind: instance method of derive
Returns: object - A dictionary of order book structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.limit | int | No | orderbook limit, default is undefined |
derive.unWatchOrderBook (symbol, params?)unWatchTrades
unsubscribe from the trades channel
Kind: instance method of derive
Returns: any - status of the unwatch request
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to unwatch the trades for |
| params | object | No | extra parameters specific to the exchange API endpoint |
derive.unWatchTrades (symbol, params?)watchTrades
watches information on multiple trades made in a market
Kind: instance method of derive
Returns: Array<object> - a list of trade structures
See: https://docs.derive.xyz/api-reference/channels/tradesbyinstrument
| 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 |
derive.watchTrades (symbol, since?, limit?, params?)watchOrders
watches information on multiple orders made by the user
Kind: instance method of derive
Returns: Array<object> - a list of order structures
See: https://docs.derive.xyz/api-reference/channels/subaccountorders
| 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.subaccount_id | string | No | required the subaccount id |
derive.watchOrders (symbol, since?, limit?, params?)unWatchOrders
unsubscribe from the orders channel
Kind: instance method of derive
Returns: any - status of the unwatch request
See: https://docs.derive.xyz/api-reference/channels/subaccountorders
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | not used by derive unWatchOrders, the whole subaccount channel is unsubscribed |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.unWatchOrders (symbol?, params?)watchMyTrades
watches information on multiple trades made by the user
Kind: instance method of derive
Returns: Array<object> - a list of trade structures
See: https://docs.derive.xyz/api-reference/channels/subaccounttrades
| 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.subaccount_id | string | No | required the subaccount id |
derive.watchMyTrades (symbol, since?, limit?, params?)unWatchMyTrades
unsubscribe from the my trades channel
Kind: instance method of derive
Returns: any - status of the unwatch request
See: https://docs.derive.xyz/api-reference/channels/subaccounttrades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | not used by derive unWatchMyTrades, the whole subaccount channel is unsubscribed |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
derive.unWatchMyTrades (symbol?, params?)watchBalance
watches balance updates for a single subaccount, the returned structure is scoped to the watched subaccount
Kind: instance method of derive
Returns: object - a balance structure
See: https://docs.derive.xyz/api-reference/channels/subaccountbalances
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
| params.fetchBalanceSnapshot | boolean | No | default true, the channel only streams changed totals, so an initial snapshot is loaded over rest before subscribing |
derive.watchBalance (params?)watchPositions
watch all open positions; the sizes stream over the balances channel, while entry price, pnl and margin fields stay from the rest snapshot until the next one
Kind: instance method of derive
Returns: Array<object> - a list of position structures
See: https://docs.derive.xyz/api-reference/channels/subaccountbalances
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols to watch positions for |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum number of positions to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subaccount_id | string | No | required the subaccount id |
| params.fetchPositionsSnapshot | boolean | No | default true, the channel only streams size changes, so an initial snapshot is loaded over rest before subscribing |
derive.watchPositions (symbols?, since?, limit?, params?)