ftx icon indicating copy to clipboard operation
ftx copied to clipboard

bid & ask in Ticker subscription can be null

Open dovahcrow opened this issue 2 years ago • 0 comments

e.g. this is the payload: {"channel":"ticker","market":"SRN-PERP","type":"update","data":{"bid":null,"ask":null,"bidSize":null,"askSize":null,"last":0.00385,"time":1656893927.97223}} Change Ticker to

pub struct Ticker {
    pub bid: Option<Decimal>,
    pub ask: Option<Decimal>,
    pub bid_size: Option<Decimal>,
    pub ask_size: Option<Decimal>,
    pub last: Decimal,
    #[serde_as(as = "TimestampSecondsWithFrac<f64>")]
    pub time: DateTime<Utc>,
}

in src/ws/model.rs should work.

dovahcrow avatar Jul 04 '22 00:07 dovahcrow