Bourse.WS.Semantics.Orderbook (bourse v0.1.0)

Copy Markdown View Source

Orderbook snapshot/delta state driven by websocket.orderbook_semantics.

Summary

Functions

Applies a routed orderbook payload and returns updated state + book snapshot.

Builds state from exchange spec semantics.

Types

t()

@type t() :: %Bourse.WS.Semantics.Orderbook{
  apply_mode: String.t(),
  books: %{required(String.t()) => map()},
  checksum_present: boolean(),
  delta_values: [String.t()],
  discriminator_field: String.t() | nil,
  sequence_fields: [String.t()],
  snapshot_values: [String.t()]
}

Functions

apply(state, key, payload)

@spec apply(t(), String.t(), term()) :: {t(), map() | nil}

Applies a routed orderbook payload and returns updated state + book snapshot.

new(exchange)

@spec new(Bourse.Exchange.t()) :: t()

Builds state from exchange spec semantics.