Back to Ccxt

Derive

wiki/exchanges/derive.md

4.5.5227.0 KB
Original Source

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

derive{docsify-ignore}

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

<a name="fetchTime" id="fetchtime"></a>

fetchTime{docsify-ignore}

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of <code>derive</code>
Returns: <code>int</code> - the current integer timestamp in milliseconds from the exchange server

See: https://docs.derive.xyz/reference/post_public-get-time

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.fetchTime ([params])

<a name="fetchCurrencies" id="fetchcurrencies"></a>

fetchCurrencies{docsify-ignore}

fetches all available currencies on an exchange

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - an associative dictionary of currencies

See: https://docs.derive.xyz/reference/post_public-get-all-currencies

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.fetchCurrencies ([params])

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

fetchMarkets{docsify-ignore}

retrieves data on all markets for bybit

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - an array of objects representing market data

See: https://docs.derive.xyz/reference/post_public-get-all-instruments

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.fetchMarkets ([params])

<a name="fetchTicker" id="fetchticker"></a>

fetchTicker{docsify-ignore}

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - a ticker structure

See: https://docs.derive.xyz/reference/post_public-get-ticker

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.fetchTicker (symbol[, params])

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

fetchTrades{docsify-ignore}

get the list of most recent trades for a particular symbol

Kind: instance method of <code>derive</code>
Returns: <code>Array<Trade></code> - a list of trade structures

See: https://docs.derive.xyz/reference/post_public-get-trade-history

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Nothe latest time in ms to fetch trades for
javascript
derive.fetchTrades (symbol[, since, limit, params])

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

fetchFundingRateHistory{docsify-ignore}

fetches historical funding rate prices

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of funding rate structures

See: https://docs.derive.xyz/reference/post_public-get-funding-rate-history

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 exchange API endpoint
javascript
derive.fetchFundingRateHistory (symbol[, since, limit, params])

<a name="fetchFundingRate" id="fetchfundingrate"></a>

fetchFundingRate{docsify-ignore}

fetch the current funding rate

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - a funding rate structure

See: https://docs.derive.xyz/reference/post_public-get-funding-rate-history

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

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

createOrder{docsify-ignore}

create a trade order

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - an order structure

See: https://docs.derive.xyz/reference/post_private-order

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to create an order in
type<code>string</code>Yes'market' or 'limit'
side<code>string</code>Yes'buy' or 'sell'
amount<code>float</code>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
params.triggerPrice<code>float</code>NoThe price a trigger order is triggered at
params.takeProfit<code>object</code>NotakeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only)
params.takeProfit.triggerPrice<code>float</code>Notake profit trigger price
params.stopLoss<code>object</code>NostopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only)
params.stopLoss.triggerPrice<code>float</code>Nostop loss trigger price
params.max_fee<code>float</code>Norequired the maximum fee you are willing to pay for the order
javascript
derive.createOrder (symbol, type, side, amount[, price, params])

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

editOrder{docsify-ignore}

edit a trade order

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - an order structure

See: https://docs.derive.xyz/reference/post_private-replace

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified symbol of the market to create an order in
type<code>string</code>Yes'market' or 'limit'
side<code>string</code>Yes'buy' or 'sell'
amount<code>float</code>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.editOrder (id, symbol, type, side, amount[, price, params])

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

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - An order structure

See: https://docs.derive.xyz/reference/post_private-cancel

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>boolean</code>Nowhether the order is a trigger/algo order
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.cancelOrder (id, symbol[, params])

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

cancelAllOrders{docsify-ignore}

cancel all open orders in a market

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - an list of order structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.cancelAllOrders (symbol[, params])

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

fetchOrders{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of <code>derive</code>
Returns: <code>Array<Order></code> - a list of order structures

See: https://docs.derive.xyz/reference/post_private-get-orders

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Noset to true if you want to fetch orders with pagination
params.trigger<code>boolean</code>Nowhether the order is a trigger/algo order
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.fetchOrders (symbol[, since, limit, params])

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

fetchOpenOrders{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of <code>derive</code>
Returns: <code>Array<Order></code> - a list of order structures

See: https://docs.derive.xyz/reference/post_private-get-orders

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Noset to true if you want to fetch orders with pagination
javascript
derive.fetchOpenOrders (symbol[, since, limit, params])

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

fetchClosedOrders{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of <code>derive</code>
Returns: <code>Array<Order></code> - a list of order structures

See: https://docs.derive.xyz/reference/post_private-get-orders

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Noset to true if you want to fetch orders with pagination
javascript
derive.fetchClosedOrders (symbol[, since, limit, params])

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

fetchCanceledOrders{docsify-ignore}

fetches information on multiple canceled orders made by the user

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of order structures

See: https://docs.derive.xyz/reference/post_private-get-orders

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
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 available parameters
javascript
derive.fetchCanceledOrders (symbol[, since, limit, params])

<a name="fetchOrderTrades" id="fetchordertrades"></a>

fetchOrderTrades{docsify-ignore}

fetch all the trades made from a single order

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of trade structures

See: https://docs.derive.xyz/reference/post_private-get-trade-history

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.fetchOrderTrades (id, 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>derive</code>
Returns: <code>Array<Trade></code> - a list of trade structures

See: https://docs.derive.xyz/reference/post_private-get-trade-history

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe 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.paginate<code>boolean</code>Noset to true if you want to fetch trades with pagination
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.fetchMyTrades (symbol[, since, limit, params])

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

fetchPositions{docsify-ignore}

fetch all open positions

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of position structure

See: https://docs.derive.xyz/reference/post_private-get-positions

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nonot used by kraken fetchPositions ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.fetchPositions ([symbols, params])

<a name="fetchFundingHistory" id="fetchfundinghistory"></a>

fetchFundingHistory{docsify-ignore}

fetch the history of funding payments paid and received on this account

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - a funding history structure

See: https://docs.derive.xyz/reference/post_private-get-funding-history

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol
since<code>int</code>Nothe earliest time in ms to fetch funding history for
limit<code>int</code>Nothe maximum number of funding history structures to retrieve
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
derive.fetchFundingHistory ([symbol, since, limit, params])

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

fetchBalance{docsify-ignore}

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - a balance structure

See: https://docs.derive.xyz/reference/post_private-get-all-portfolios

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.fetchBalance ([params])

<a name="fetchDeposits" id="fetchdeposits"></a>

fetchDeposits{docsify-ignore}

fetch all deposits made to an account

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of transaction structures

See: https://docs.derive.xyz/reference/post_private-get-deposit-history

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Nothe earliest time in ms to fetch deposits for
limit<code>int</code>Nothe maximum number of deposits structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.fetchDeposits (code[, since, limit, params])

<a name="fetchWithdrawals" id="fetchwithdrawals"></a>

fetchWithdrawals{docsify-ignore}

fetch all withdrawals made from an account

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of transaction structures

See: https://docs.derive.xyz/reference/post_private-get-withdrawal-history

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Nothe earliest time in ms to fetch withdrawals for
limit<code>int</code>Nothe maximum number of withdrawals structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.fetchWithdrawals (code[, since, limit, params])

<a name="watchOrderBook" id="watchorderbook"></a>

watchOrderBook{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols

See: https://docs.derive.xyz/reference/orderbook-instrument_name-group-depth

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return.
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.watchOrderBook (symbol[, limit, params])

<a name="watchTicker" id="watchticker"></a>

watchTicker{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - a ticker structure

See: https://docs.derive.xyz/reference/ticker-instrument_name-interval

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.watchTicker (symbol[, params])

<a name="unWatchOrderBook" id="unwatchorderbook"></a>

unWatchOrderBook{docsify-ignore}

unsubscribe from the orderbook channel

Kind: instance method of <code>derive</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.limit<code>int</code>Noorderbook limit, default is undefined
javascript
derive.unWatchOrderBook (symbol[, params])

<a name="unWatchTrades" id="unwatchtrades"></a>

unWatchTrades{docsify-ignore}

unsubscribe from the trades channel

Kind: instance method of <code>derive</code>
Returns: <code>any</code> - status of the unwatch request

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to unwatch the trades for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.unWatchTrades (symbol[, params])

<a name="watchTrades" id="watchtrades"></a>

watchTrades{docsify-ignore}

watches information on multiple trades made in a market

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of trade structures

See: https://docs.derive.xyz/reference/trades-instrument_name

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market trades were made in
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trade structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
derive.watchTrades (symbol[, since, limit, params])

<a name="watchOrders" id="watchorders"></a>

watchOrders{docsify-ignore}

watches information on multiple orders made by the user

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of order structures

See: https://docs.derive.xyz/reference/subaccount_id-orders

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.watchOrders (symbol[, since, limit, params])

<a name="watchMyTrades" id="watchmytrades"></a>

watchMyTrades{docsify-ignore}

watches information on multiple trades made by the user

Kind: instance method of <code>derive</code>
Returns: <code>Array<object></code> - a list of trade structures

See: https://docs.derive.xyz/reference/subaccount_id-trades

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subaccount_id<code>string</code>Norequired the subaccount id
javascript
derive.watchMyTrades (symbol[, since, limit, params])