Tai.Markets.Quote (tai v0.0.75)

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()

Specs

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

product_symbol()

Specs

product_symbol() :: Tai.Venues.Product.symbol()

Specs

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

Specs

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

Link to this section Functions

Link to this function

inside_ask(market_quote)

Specs

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

inside_bid(market_quote)

Specs

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

mid_price(market_quote)

Specs

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

mid_price(bid, ask)

Specs

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