Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exchange engine implementation #2

Open
featherenvy opened this issue Jan 18, 2022 · 0 comments
Open

Exchange engine implementation #2

featherenvy opened this issue Jan 18, 2022 · 0 comments
Labels
Milestone

Comments

@featherenvy
Copy link
Owner

featherenvy commented Jan 18, 2022

The exchange engine provides trading functionality and serves as a gateway for the trading engine.

Trading engine features:

  • Support different exchanges using exchange adapters
  • Rate limit support - exchange adapters will expose rate limits and exchange engine will stay within them
  • Batch interface methods
trait RestExchangeAdapter {
  fn place_orders(&mut self, orders: &[OrderRequest]) -> Result<Box<[Order]>, PlaceOrdersError>;
  fn cancel_orders(&mut self, order_ids: &[OrderId]) -> Result<Box<[Order]>, CancelOrdersError>;
  fn fetch_balances(&self) -> Result<Box<[AssetBalance]>, FetchBalancesError>;
}

trait FixExchangeAdapter {
  fn connect(&mut self) -> Result<(), ConnectError>;
  fn place_order(&mut self, order: OrderRequest) -> Result<Order, PlaceOrderError>;
  fn cancel_order(&mut self, order_id: OrderId) -> Result<Order, CancelOrderError>;
}

trait WsExchangeAdapter {
  fn connect(&mut self) -> Result<(), ConnectError>;
}
@featherenvy featherenvy added this to the 0.1 milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant