pub enum DeribitWsChannel {
Show 19 variants
Trades,
Book,
Ticker,
Quote,
PriceIndex,
PriceRanking,
VolatilityIndex,
EstimatedExpirationPrice,
Perpetual,
MarkPriceOptions,
PlatformState,
Announcements,
ChartTrades,
InstrumentState,
UserOrders,
UserTrades,
UserPortfolio,
UserChanges,
UserAccessLog,
}Expand description
Deribit WebSocket public data channels.
Channels follow the format: {channel_type}.{instrument_or_currency}.{interval}
Variants§
Trades
Raw trade stream: trades.{instrument}.raw
Book
Order book updates: book.{instrument}.{group}.{depth}.{interval}
Ticker
Ticker updates: ticker.{instrument}.{interval}
Quote
Quote updates (best bid/ask): quote.{instrument}
PriceIndex
Index price: deribit_price_index.{currency}
PriceRanking
Price ranking: deribit_price_ranking.{currency}
VolatilityIndex
Volatility index: deribit_volatility_index.{currency}
EstimatedExpirationPrice
Estimated expiration price: estimated_expiration_price.{currency}
Perpetual
Perpetual interest rate: perpetual.{instrument}.{interval}
MarkPriceOptions
Mark price options: markprice.options.{currency}
PlatformState
Platform state: platform_state
Announcements
Announcements: announcements
ChartTrades
Chart trades: chart.trades.{instrument}.{resolution}
InstrumentState
Instrument state changes: instrument.state.{kind}.{currency}
Used for instrument lifecycle notifications (created, started, settled, closed, terminated)
UserOrders
User orders: user.orders.{instrument}.{interval}
UserTrades
User trades/fills: user.trades.{instrument}.{interval}
UserPortfolio
User portfolio: user.portfolio.{currency}
UserChanges
User changes (combined orders/trades/positions): user.changes.{instrument}.{interval}
UserAccessLog
User access log: user.access_log
Implementations§
Source§impl DeribitWsChannel
impl DeribitWsChannel
Sourcepub fn format_channel(
&self,
instrument_or_currency: &str,
interval: Option<DeribitUpdateInterval>,
) -> String
pub fn format_channel( &self, instrument_or_currency: &str, interval: Option<DeribitUpdateInterval>, ) -> String
Formats the channel name for subscription with the given instrument or currency.
Returns the full channel string for Deribit subscription.
§Arguments
instrument_or_currency- The instrument name (e.g., “BTC-PERPETUAL”) or currency (e.g., “BTC”)interval- Optional update interval. Defaults toMs100(100ms) if not specified.
§Panics
Panics if called on InstrumentState variant. Use format_instrument_state_channel() instead.
§Note
Raw subscriptions require authentication. Use Ms100 for public/unauthenticated access.
Sourcepub fn format_instrument_state_channel(kind: &str, currency: &str) -> String
pub fn format_instrument_state_channel(kind: &str, currency: &str) -> String
Formats the instrument status channel for subscription.
Returns the full channel string: instrument.state.{kind}.{currency}
§Arguments
kind- Instrument kind: “future”, “option”, “spot”, “future_combo”, “option_combo”, or “any”currency- Currency: “BTC”, “ETH”, “USDC”, “USDT”, “EURR”, or “any”
Sourcepub fn from_channel_string(channel: &str) -> Option<Self>
pub fn from_channel_string(channel: &str) -> Option<Self>
Parses a channel string to extract the channel type.
Returns the channel enum variant if recognized.
Sourcepub const fn is_private(&self) -> bool
pub const fn is_private(&self) -> bool
Returns whether this is a private (authenticated) channel.
Sourcepub fn requires_auth(channel: &str) -> bool
pub fn requires_auth(channel: &str) -> bool
Returns whether a channel string requires authentication.
This includes private user.* channels and any channel with
a .raw interval (book, trades, ticker) which Deribit gates
behind auth.
Trait Implementations§
Source§impl AsRef<str> for DeribitWsChannel
impl AsRef<str> for DeribitWsChannel
Source§impl Clone for DeribitWsChannel
impl Clone for DeribitWsChannel
Source§fn clone(&self) -> DeribitWsChannel
fn clone(&self) -> DeribitWsChannel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DeribitWsChannel
Source§impl Debug for DeribitWsChannel
impl Debug for DeribitWsChannel
Source§impl<'de> Deserialize<'de> for DeribitWsChannel
impl<'de> Deserialize<'de> for DeribitWsChannel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for DeribitWsChannel
impl Display for DeribitWsChannel
impl Eq for DeribitWsChannel
Source§impl FromStr for DeribitWsChannel
impl FromStr for DeribitWsChannel
Source§impl Hash for DeribitWsChannel
impl Hash for DeribitWsChannel
Source§impl IntoEnumIterator for DeribitWsChannel
impl IntoEnumIterator for DeribitWsChannel
type Iterator = DeribitWsChannelIter
fn iter() -> DeribitWsChannelIter ⓘ
Source§impl PartialEq for DeribitWsChannel
impl PartialEq for DeribitWsChannel
Source§impl Serialize for DeribitWsChannel
impl Serialize for DeribitWsChannel
impl StructuralPartialEq for DeribitWsChannel
Auto Trait Implementations§
impl Freeze for DeribitWsChannel
impl RefUnwindSafe for DeribitWsChannel
impl Send for DeribitWsChannel
impl Sync for DeribitWsChannel
impl Unpin for DeribitWsChannel
impl UnsafeUnpin for DeribitWsChannel
impl UnwindSafe for DeribitWsChannel
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more