Struct coinnect::types::Orderbook
[−]
[src]
pub struct Orderbook { pub timestamp: i64, pub pair: Pair, pub asks: Vec<(Price, Volume)>, pub bids: Vec<(Price, Volume)>, }
Fields
timestamp: i64
UNIX timestamp in ms (when the response was received)
pair: Pair
The Pair corresponding to the Orderbook returned (maybe useful later for asynchronous APIs)
asks: Vec<(Price, Volume)>
Vec containing the ask offers (by ascending price)
bids: Vec<(Price, Volume)>
Vec containing the bid offers (by descending price)
Methods
impl Orderbook
[src]
fn avg_price(&self) -> Option<Price>
Convenient function that returns the average price from the orderbook
Return None if Orderbook is empty
Average price = (lowest ask + highest bid)/2