Exchange v0.1.0 Exchange.Adapters.InMemoryTimeSeries View Source

Documentation for a InMemoryTimeSeries adapter

Link to this section Summary

Link to this section Functions

Link to this function

cast_event(event, payload)

View Source

Specs

cast_event(event :: atom(), payload :: Exchange.Adapters.EventBus.*()) ::
  Exchange.Adapters.EventBus.*()

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

completed_trades_by_id(ticker, trader_id)

View Source

Specs

completed_trades_by_id(ticker :: atom(), trader_id :: String.t()) :: [
  Exchange.Trade
]

Callback implementation for Exchange.TimeSeries.completed_trades_by_id/2.

Specs

get_live_orders(ticker :: atom()) :: [Exchange.Order]

Callback implementation for Exchange.TimeSeries.get_live_orders/1.

Specs

get_state() :: map()

Callback implementation for GenServer.init/1.

Link to this function

save(item, timestamp, state_map)

View Source

Specs

save(item :: any(), timestamp :: number(), state :: map()) :: map()
Link to this function

save_order(order, state)

View Source
Link to this function

save_price(price, state)

View Source

Specs

save_price(price :: map(), state :: map()) :: map()
Link to this function

save_trade(trade, state)

View Source

Specs

save_trade(Exchange.Order, map()) :: map()
save_trade(trade :: Exchange.Trade, state :: map()) :: map()