tai v0.0.10 Tai.Venues.Adapter behaviour

Link to this section Summary

Link to this section Types

Link to this type asset_balance()
asset_balance() :: Tai.Venues.AssetBalance.t()
Link to this type create_order_error_reason()
create_order_error_reason() ::
  :not_implemented
  | shared_error_reason()
  | Tai.Trading.InsufficientBalanceError.t()
Link to this type credentials()
credentials() :: map()
Link to this type order_response()
order_response() :: Tai.Trading.OrderResponse.t()
Link to this type product()
product() :: Tai.Venues.Product.t()
Link to this type shared_error_reason()
shared_error_reason() :: :timeout | Tai.CredentialError.t()
Link to this type t()
t() :: %Tai.Venues.Adapter{
  accounts: map(),
  adapter: :atom,
  id: :atom,
  products: String.t(),
  timeout: term()
}
Link to this type venue_order_id()
venue_order_id() :: String.t()

Link to this section Callbacks

Link to this callback asset_balances(exchange_id, account_id, credentials)
asset_balances(
  exchange_id :: atom(),
  account_id :: atom(),
  credentials :: map()
) :: {:ok, [asset_balance()]} | {:error, reason :: term()}
Link to this callback cancel_order(venue_order_id, credentials)
cancel_order(venue_order_id(), credentials()) ::
  {:ok, venue_order_id()} | {:error, :not_implemented | reason() :: term()}
Link to this callback create_order(order, credentials)
create_order(order(), credentials()) ::
  {:ok, order_response()} | {:error, create_order_error_reason()}
Link to this callback maker_taker_fees(exchange_id, account_id, credentials)
maker_taker_fees(
  exchange_id :: atom(),
  account_id :: atom(),
  credentials :: map()
) ::
  {:ok, {maker :: Decimal.t(), taker :: Decimal.t()} | nil}
  | {:error, reason :: term()}
Link to this callback order_book_feed()
order_book_feed() :: atom()
Link to this callback products(exchange_id)
products(exchange_id :: atom()) ::
  {:ok, [product()]} | {:error, reason :: term()}
Link to this callback stream_supervisor()
stream_supervisor() :: atom()