Exchange v0.2.5 Exchange.TimeSeries behaviour View Source

Behaviour that a time series database must implement to be able to communicate with the Exchange.

Link to this section Summary

Callbacks

Function that fetches the completed trades from a market which a specific user participated.

Function that fetches the completed trades from a market which a specific user participated.

Function that fetches a completed trade from a exchange that matches a trade id

Function that fetches the active orders of the application. It is called when the application starts running allowing the recovery of the previous state when a crash happens.

Callback to initialize the given timeseries adapter and return necessary children.

Link to this section Callbacks

Specs

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

Function that fetches the completed trades from a market which a specific user participated.

Link to this callback

completed_trades_by_id(atom, arg2)

View Source

Specs

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

Function that fetches the completed trades from a market which a specific user participated.

Link to this callback

get_completed_trade_by_trade_id(atom, arg2)

View Source

Specs

get_completed_trade_by_trade_id(atom(), String.t()) :: Exchange.Trade

Function that fetches a completed trade from a exchange that matches a trade id

Specs

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

Function that fetches the active orders of the application. It is called when the application starts running allowing the recovery of the previous state when a crash happens.

Specs

init() :: {:ok, list()}

Callback to initialize the given timeseries adapter and return necessary children.