tai v0.0.13 Tai.Advisor behaviour

A behavior for implementing a process that receives changes in the order book.

It can be used to monitor one or more quote streams and create, update or cancel orders.

Link to this section Summary

Link to this section Types

Link to this type

advisor()
advisor() :: Tai.Advisor.t()

Link to this type

product()
product() :: Tai.Venues.Product.t()

Link to this type

store()
store() :: map()

Link to this type

t()
t() :: %Tai.Advisor{
  advisor_id: atom(),
  config: map(),
  group_id: atom(),
  inside_quotes: map(),
  products: [product()],
  store: map()
}

Link to this section Functions

Link to this function

cached_inside_quote(advisor, venue_id, product_symbol)
cached_inside_quote(
  advisor(),
  Tai.Venues.Adapter.venue_id(),
  Tai.Venues.Product.symbol()
) :: map() | nil

Link to this function

cast_order_updated(name, old_order, updated_order, callback)
cast_order_updated(atom(), order() | nil, order(), (... -> any())) :: :ok

Link to this function

cast_order_updated(name, old_order, updated_order, callback, opts)
cast_order_updated(atom(), order() | nil, order(), (... -> any()), term()) ::
  :ok

Link to this function

to_name(group_id, advisor_id)
to_name(atom(), atom()) :: atom()

Link to this section Callbacks

Link to this callback

handle_inside_quote(order_book_feed_id, symbol, inside_quote, changes, state)
handle_inside_quote(
  order_book_feed_id :: atom(),
  symbol :: atom(),
  inside_quote :: Tai.Markets.Quote.t(),
  changes :: map() | list(),
  state :: advisor()
) :: :ok | {:ok, store()} | term()

Link to this callback

handle_order_book_changes(order_book_feed_id, symbol, changes, state)
handle_order_book_changes(
  order_book_feed_id :: atom(),
  symbol :: atom(),
  changes :: term(),
  state :: advisor()
) :: :ok