openlimits_coinbase/model/
book_record_l1.rs

1use serde::Deserialize;
2use serde::Serialize;
3use rust_decimal::prelude::Decimal;
4use super::BookLevel;
5use super::shared::string_to_decimal;
6
7/// This struct represents a level 1 book record
8#[derive(Serialize, Deserialize, Debug, Clone)]
9pub struct BookRecordL1 {
10    #[serde(with = "string_to_decimal")]
11    pub price: Decimal,
12    #[serde(with = "string_to_decimal")]
13    pub size: Decimal,
14    pub num_orders: usize,
15}
16
17impl BookLevel for BookRecordL1 {
18    fn level() -> u8 {
19        1
20    }
21}