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

Copy Markdown View Source

Trades cache driven by websocket.trades_semantics.

Summary

Functions

Applies a routed trades payload and returns updated state + emitted trades.

Builds state from exchange spec semantics.

Types

t()

@type t() :: %Bourse.WS.Semantics.Trades{
  cache_type: String.t() | nil,
  caches: %{required(String.t()) => [map()]},
  dedup_key: String.t() | nil,
  update_model: String.t()
}

Functions

apply(state, key, payload)

@spec apply(t(), String.t(), term()) :: {t(), [map()]}

Applies a routed trades payload and returns updated state + emitted trades.

new(exchange)

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

Builds state from exchange spec semantics.