Skip to main content

use_cost_for_bar_volume

Function use_cost_for_bar_volume 

Source
pub fn use_cost_for_bar_volume(instrument: &InstrumentAny) -> bool
Expand description

Returns true when Bar.volume should be populated from the chart cost field (USD) instead of the volume field (base currency).

Deribit’s trades.{instrument} channel reports each trade’s amount in USD for inverse perpetuals and inverse futures, and in the underlying base currency for options and linear futures. To keep Bar.volume and TradeTick.size on a single unit per instrument, route inverse non-option products through cost. Options and option spreads stay on volume even when flagged is_inverse, because their trade amount is reported in base currency.

Reference: https://docs.deribit.com/api-reference/market-data/public-get_last_trades_by_currency