CCXT
derive

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

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

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

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

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

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the open interest for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch greeks for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of any market of the underlying currency to fetch the settlement history for
sinceintNotimestamp in ms of the earliest settlement to fetch
limitintNothe maximum number of settlements to fetch
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringNounified market symbol of the settlement history to fetch
sinceintNotimestamp in ms of the earliest settlement to fetch
limitintNothe maximum number of settlements to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch; 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
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch trades for
params.paginatebooleanNodefault 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch; a single request covers at most 5000 candles from since, use params.paginate for wider ranges
limitintNothe maximum amount of candles to fetch, also sizes the request window when since is not provided
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest candle to fetch
params.pricestringNo"index" to fetch candles of the index price instead of trades, their volume is undefined
params.paginatebooleanNodefault 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the funding rate history for
sinceintNotimestamp in ms of the earliest funding rate to fetch
limitintNothe maximum amount of funding rate structures to fetch
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired the subaccount id
params.triggerPricefloatNothe price a standalone trigger (stop) order is triggered at
params.stopLossPricefloatNothe price a standalone stop loss order is triggered at
params.takeProfitPricefloatNothe price a standalone take profit order is triggered at
params.trigger_price_typestringNothe price type the trigger watches, only 'mark' is supported by the venue (default)
params.postOnlyboolNotrue makes the order post only
params.reduceOnlyboolNotrue reduces the position only, not available with post only
params.max_feefloatNorequired 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

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerbooleanNowhether the order is a trigger/algo order
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringNounified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch orders for
params.paginatebooleanNoset to true if you want to fetch orders with pagination
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
idstringYesthe order id
symbolstringNonot used by derive.fetchOrder
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerbooleanNowhen true fetches the pending trigger orders that have not fired yet instead of the orders resting on the order book
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.paginatebooleanNoset 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market the orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.paginatebooleanNodefault 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

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.paginatebooleanNoset to true if you want to fetch trades with pagination
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolsArray<string>Nonot used by fetchPositions ()
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringNounified market symbol
sinceintNothe earliest time in ms to fetch funding history for
limitintNothe maximum number of funding history structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch funding history for
params.paginatebooleanNodefault 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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idintNoscope 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

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesthe subaccount id to transfer from
toAccountstringYesthe subaccount id to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.max_fee_usdfloatNothe maximum accepted fee in usd, default 0: transfers between existing subaccounts are free
params.new_subaccount_managerintNoa 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

ParamTypeRequiredDescription
codestringNounified currency code
sinceintNotimestamp in ms of the earliest transfer to fetch
limitintNothe maximum number of transfers to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest transfer to fetch
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNotimestamp in ms of the earliest rate to fetch
limitintNothe maximum number of rates to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest rate to fetch
params.risk_universe_idintNothe risk universe to read the rates from, default 1: without the filter the venue interleaves every universe with duplicate timestamps
params.periodintNothe 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

ParamTypeRequiredDescription
codestringNounified currency code
symbolstringNonot used by derive.fetchBorrowInterest
sinceintNotimestamp in ms of the earliest interest event to fetch
limitintNothe maximum number of interest events to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest interest event to fetch
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe L1 address to withdraw to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.max_fee_usdfloatNothe maximum accepted fee in usd, default 1, or 10 with force_batch
params.force_batchboolNopay the higher fee to have the withdrawal batch proven immediately
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch deposits for
limitintNothe maximum number of deposits structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch withdrawals for
limitintNothe maximum number of withdrawals structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return.
paramsobjectNoextra parameters specific to the exchange API endpoint
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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to unwatch the ticker for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbols of the markets to fetch the bids and asks for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.limitintNoorderbook 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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to unwatch the trades for
paramsobjectNoextra 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trade structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringNonot used by derive unWatchOrders, the whole subaccount channel is unsubscribed
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
symbolstringNonot used by derive unWatchMyTrades, the whole subaccount channel is unsubscribed
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired 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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired the subaccount id
params.fetchBalanceSnapshotbooleanNodefault 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

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols to watch positions for
sinceintNothe earliest time in ms to fetch positions for
limitintNothe maximum number of positions to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.subaccount_idstringNorequired the subaccount id
params.fetchPositionsSnapshotbooleanNodefault true, the channel only streams size changes, so an initial snapshot is loaded over rest before subscribing
derive.watchPositions (symbols?, since?, limit?, params?)

On this page