DeribitWsChannel

Enum DeribitWsChannel 

Source
pub enum DeribitWsChannel {
Show 18 variants Trades, Book, Ticker, Quote, PriceIndex, PriceRanking, VolatilityIndex, EstimatedExpirationPrice, Perpetual, MarkPriceOptions, PlatformState, Announcements, ChartTrades, 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}

§

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

Source

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 to Ms100 (100ms) if not specified.
§Note

Raw subscriptions require authentication. Use Ms100 for public/unauthenticated access.

Source

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.

Source

pub const fn is_private(&self) -> bool

Returns whether this is a private (authenticated) channel.

Trait Implementations§

Source§

impl AsRef<str> for DeribitWsChannel

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for DeribitWsChannel

Source§

fn clone(&self) -> DeribitWsChannel

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeribitWsChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DeribitWsChannel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DeribitWsChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl FromStr for DeribitWsChannel

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<DeribitWsChannel, <Self as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for DeribitWsChannel

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoEnumIterator for DeribitWsChannel

Source§

impl PartialEq for DeribitWsChannel

Source§

fn eq(&self, other: &DeribitWsChannel) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DeribitWsChannel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&str> for DeribitWsChannel

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &str) -> Result<DeribitWsChannel, <Self as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl Eq for DeribitWsChannel

Source§

impl StructuralPartialEq for DeribitWsChannel

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Separable for T
where T: Display,

Source§

fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String

Adds separators according to the given SeparatorPolicy. Read more
Source§

fn separate_with_commas(&self) -> String

Inserts a comma every three digits from the right. Read more
Source§

fn separate_with_spaces(&self) -> String

Inserts a space every three digits from the right. Read more
Source§

fn separate_with_dots(&self) -> String

Inserts a period every three digits from the right. Read more
Source§

fn separate_with_underscores(&self) -> String

Inserts an underscore every three digits from the right. Read more
§

impl<T> SetterInput<Owned> for T
where T: AsRef<str>,

§

fn set_pointer_builder( pointer: PointerBuilder<'_>, value: T, _canonicalize: bool, ) -> Result<(), Error>

Copies the values from input into builder, where builder represents the backing memory of a <Receiver as Owned>::Builder. Read more
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Ungil for T
where T: Send,