Exchange v0.2.0 Exchange.Adapters.InMemoryTimeSeries View Source

Public API to use the adapter of Exchange.TimeSeries, the InMemoryTimeSeries. This adapter is an approach of an in memory time series database and it keeps state about orders, prices and trades.

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.MessageBus.*()) ::
  Exchange.Adapters.MessageBus.*()

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

completed_trades(ticker)

View Source

Specs

completed_trades(ticker :: atom()) :: [Exchange.Trade]

Callback implementation for Exchange.TimeSeries.completed_trades/1.

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

Specs

save_order(Exchange.Order, map()) :: map()
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(trade :: Exchange.Trade, state :: map()) :: map()
Link to this function

validate_config(config \\ [])

View Source