deribit_websocket/
subscriptions.rs1#[derive(Debug, Clone)]
5pub enum SubscriptionChannel {
6 Ticker(String),
7 OrderBook(String),
8 Trades(String),
9 UserOrders,
10 UserTrades,
11}
12
13impl SubscriptionChannel {
14 pub fn to_string(&self) -> String {
16 match self {
17 Self::Ticker(instrument) => format!("ticker.{instrument}.raw"),
18 Self::OrderBook(instrument) => format!("book.{instrument}.raw"),
19 Self::Trades(instrument) => format!("trades.{instrument}.raw"),
20 Self::UserOrders => "user.orders.any.any.raw".to_string(),
21 Self::UserTrades => "user.trades.any.any.raw".to_string(),
22 }
23 }
24}