Book event. A full order book snapshot for an asset.
Summary
Functions
Builds a BookEvent from a decoded (atom-keyed) websocket message.
Types
@type t() :: %Polymarket.Schemas.BookEvent{ asks: [Polymarket.Schemas.Ask.t()], asset_id: String.t() | nil, bids: [Polymarket.Schemas.Bid.t()], event_type: String.t() | nil, hash: String.t() | nil, last_trade_price: float() | nil, market: String.t() | nil, tick_size: float() | nil, timestamp: integer() | nil }
Functions
Builds a BookEvent from a decoded (atom-keyed) websocket message.
Constructs the struct directly — no Ecto.Changeset — for the websocket hot
path. Numeric fields (delivered as JSON strings) are coerced via
Polymarket.Schemas.Coerce. Returns {:error, {:missing_fields, fields}} when
a required field is absent.