tai v0.0.48 Tai.Markets.Quote

Represents the inside bid & ask price point within the order book

Link to this section Summary

Link to this section Types

Link to this type

price_point()

price_point() :: Tai.Markets.PricePoint.t()
Link to this type

product_symbol()

product_symbol() :: Tai.Venues.Product.symbol()
Link to this type

t()

t() :: %Tai.Markets.Quote{
  asks: [price_point()],
  bids: [price_point()],
  last_received_at: DateTime.t() | nil,
  last_venue_timestamp: DateTime.t() | nil,
  product_symbol: product_symbol(),
  venue_id: venue_id()
}
Link to this type

venue_id()

venue_id() :: Tai.Venue.id()

Link to this section Functions

Link to this function

inside_ask(market_quote)

inside_ask(t()) :: price_point() | nil
Link to this function

inside_bid(market_quote)

inside_bid(t()) :: price_point() | nil
Link to this function

mid_price(market_quote)

mid_price(t()) ::
  {:ok, Decimal.t()} | {:error, :no_inside_bid | :no_inside_ask}
Link to this function

mid_price(bid, ask)

mid_price(bid :: price_point(), ask :: price_point()) ::
  {:ok, Decimal.t()}
  | {:error, :no_inside_bid | :no_inside_ask | :no_inside_bid_or_ask}