Trading.MarketData.Feed (trading v0.1.0)
Market data feed handler for processing real-time market data updates.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the current state of an order book.
Processes a market data update.
Starts a market data feed.
Subscribes to market data updates.
Unsubscribes from market data updates.
Types
@type market_data_type() ::
:trade | :quote | :order_book_update | :order_book_snapshot
@type t() :: %Trading.MarketData.Feed{ buffer: list(), feed_type: atom(), last_updates: %{required(String.t()) => integer()}, order_books: %{required(String.t()) => Trading.OrderBook.t()}, subscribers: MapSet.t(subscriber()) }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec get_order_book(GenServer.server(), String.t()) :: {:ok, Trading.OrderBook.t()} | {:error, term()}
Gets the current state of an order book.
@spec process_update(GenServer.server(), map()) :: :ok
Processes a market data update.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a market data feed.
@spec subscribe(GenServer.server(), subscriber(), [String.t()]) :: :ok
Subscribes to market data updates.
@spec unsubscribe(GenServer.server(), subscriber()) :: :ok
Unsubscribes from market data updates.