tucano-execution

Crates.iotucano-execution
lib.rstucano-execution
version0.1.0
created_at2025-08-14 02:04:36.714892+00
updated_at2025-08-18 02:52:18.530405+00
descriptionOrder & account data: execution (mock/live) and private streams
homepage
repositoryhttps://github.com/brbtavares/tucano
max_upload_size
id1794329
size212,156
Bruno Tavares (brbtavares)

documentation

https://docs.rs/tucano-execution

README

Tucano Execution

Order execution and account synchronization layer (global venues, with all concrete integrations implemented as local modules; markets contains only abstractions).

๐ŸŽฏ Role

The execution crate encapsulates interaction with venues for order submission, fill reception, balance and position synchronization, offering a stable interface to core and abstracting specific details (latency, proprietary formats).

Responsibility Description
Client Trait client/ abstracts submission, cancellation, state fetching
Order order/ models the lifecycle (request, snapshot, state)
Trade trade/ represents executions and fees
Balance balance/ tracks multi-asset balances
Indexing indexer.rs and map/ for efficient lookup
Mock exchange/mock for deterministic tests and backtests

๐Ÿ”‘ Main Elements

  • ExecutionClient (trait) โ€“ Contract for any execution integration.
  • MockExchange / MockExecutionConfig โ€“ Controlled simulation environment.
  • AccountEvent / AccountSnapshot โ€“ Unified account updates.
  • OrderRequest(Open/Cancel) and OrderSnapshot โ€“ Complete order flow.
  • map::ExecutionTxMap โ€“ Routing requests to different exchanges.

๐Ÿ”— Interdependencies

Depends on Reason
markets Abstractions (traits, enums, types) for exchange/instrument identifiers
integration Async channels for requests/responses
data Coherence between market events and fills (timestamp)
Consumed by Usage
core Order submission and account event ingestion
risk Validation before submit/cancel
analytics Sourcing trades for metrics

โœ… Completed

  • Functional mock execution structure.

  • Structured account event pipeline (snapshot, open order, cancel, trade).

  • Compat layer (String โ†” ExchangeId) stabilized post-refactor.

๐Ÿงช Partial

  • Execution reconnection management (only a draft).

๐Ÿšง Roadmap

  • Implement effective cancellation / partial fills.

  • Time-in-force, advanced types (stop, OCO) โ€“ roadmap.

  • Latency measurement (queueing timestamps).

  • Order sequence persistence for recovery.

๐Ÿ Exemplo Conceitual

use execution::order::request::OrderRequestOpen; // assinatura ilustrativa

let order = OrderRequestOpen::market_buy("PETR4", 100.0);
execution_tx.send(order)?;
Commit count: 0

cargo fmt