Skip to main content

Module testing

Module testing 

Source
Expand description

Testing infrastructure: Mock exchanges, paper trading, and simulation utilities.

This module provides reusable components for testing and paper trading:

  • QuoteSource: Trait for quote data providers (mock, live, CSV)
  • FillSimulator: Shared fill matching logic (price crossing detection)
  • MockExchange: Manual quote/fill injection for unit tests
  • PaperExchange: Live quotes with simulated fills for paper trading
  • MockAccountSyncer, MockTradeSyncer: Mock syncers for testing (native only)

Re-exports§

pub use fill_simulator::FillSimulator;
pub use fill_simulator::PendingOrder;
pub use fill_simulator::SimulatedFill;
pub use mock_exchange::MockExchange;
pub use mock_exchange::MockKnobs;
pub use mock_exchange::OrderFailMode;
pub use paper_exchange::create_standalone_paper_exchange;
pub use paper_exchange::create_standalone_paper_exchange_with_id;
pub use paper_exchange::ArcExchange;
pub use paper_exchange::NoOpExchange;
pub use paper_exchange::PaperExchange;
pub use paper_exchange::StandalonePaperExchange;
pub use quote_source::MockQuoteSource;
pub use quote_source::QuoteSource;
pub use mock_syncer::MockAccountSyncer;
pub use mock_syncer::MockTradeSyncer;

Modules§

fill_simulator
Fill simulator: Shared logic for simulating order fills.
mock_exchange
Mock Exchange for deterministic testing.
mock_syncer
Mock Syncers for testing backend integration without real API calls.
paper_exchange
Paper Exchange: Simulates order execution using real quotes.
quote_source
Quote source trait: Abstraction for quote data providers.