pub struct Orderbook {
pub yes: Option<Vec<Vec<i32>>>,
pub no: Option<Vec<Vec<i32>>>,
pub yes_dollars: Vec<(f32, i32)>,
pub no_dollars: Vec<(f32, i32)>,
}Expand description
Represents the orderbook for a market on the Kalshi exchange.
The orderbook contains current bid and ask orders for both Yes and No sides of a market, showing the current market depth and liquidity.
Fields§
§yes: Option<Vec<Vec<i32>>>Price levels in cents: [[price_cents, count], …]
no: Option<Vec<Vec<i32>>>Price levels in cents: [[price_cents, count], …]
yes_dollars: Vec<(f32, i32)>Price levels in dollars: [[price_dollars, count], …] The price_dollars string from API is converted to f32 (4 dp, range 0-1)
no_dollars: Vec<(f32, i32)>Price levels in dollars: [[price_dollars, count], …] The price_dollars string from API is converted to f32 (4 dp, range 0-1)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Orderbook
impl<'de> Deserialize<'de> for Orderbook
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Orderbook
impl RefUnwindSafe for Orderbook
impl Send for Orderbook
impl Sync for Orderbook
impl Unpin for Orderbook
impl UnwindSafe for Orderbook
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more