Skip to main content

Channel

WebSocket subscription channels:
pub enum Channel {
    /// L2 orderbook updates
    Book,

    /// Price ticker
    Ticker,

    /// Trade executions
    Trade,

    /// OHLC candlesticks
    Ohlc,

    /// Instrument information
    Instrument,

    /// L3 order-level data
    Level3,

    /// Private: order fills
    Executions,

    /// Private: balance updates
    Balances,
}

Depth

Orderbook depth levels:
pub enum Depth {
    D10 = 10,
    D25 = 25,
    D100 = 100,
    D500 = 500,
    D1000 = 1000,
}

Side

Order/trade side:
pub enum Side {
    Buy,
    Sell,
}

OrderType

pub enum OrderType {
    Market,
    Limit,
    StopLoss,
    TakeProfit,
    StopLossLimit,
    TakeProfitLimit,
}

OrderStatus

pub enum OrderStatus {
    New,
    PartiallyFilled,
    Filled,
    Canceled,
    Expired,
    Rejected,
}

TimeInForce

pub enum TimeInForce {
    /// Good until canceled
    GoodTilCanceled,

    /// Fill immediately or cancel remainder
    ImmediateOrCancel,

    /// Fill entirely or cancel entirely
    FillOrKill,

    /// Expires at specified time
    GoodTilDate(DateTime),
}

OrderbookState

pub enum OrderbookState {
    Uninitialized,
    AwaitingSnapshot,
    Synced,
    Desynchronized,
}

DisconnectReason

pub enum DisconnectReason {
    /// Clean shutdown
    Normal,

    /// Connection lost
    ConnectionLost,

    /// Server closed connection
    ServerClosed,

    /// Timeout
    Timeout,

    /// Error occurred
    Error(String),
}

BackpressurePolicy

pub enum BackpressurePolicy {
    /// Drop newest messages when full
    DropNewest,

    /// Drop oldest messages to make room
    DropOldest,

    /// Block sender until space available
    Block,
}

OhlcInterval

pub enum OhlcInterval {
    M1,   // 1 minute
    M5,   // 5 minutes
    M15,  // 15 minutes
    M30,  // 30 minutes
    H1,   // 1 hour
    H4,   // 4 hours
    D1,   // 1 day
    W1,   // 1 week
}