Skip to main content

Crate opendeviationbar_providers

Crate opendeviationbar_providers 

Source
Expand description

Data provider integrations

Source-specific adapters for fetching and processing tick/trade data.

§Supported Providers

  • binance - Binance spot and futures markets (primary - crypto)
  • exness - Exness EURUSD Standard tick data (primary - forex)

§Provider Selection

Asset ClassProviderRationale
CryptoBinanceOfficial data, high volume, REST + WebSocket
ForexExnessZero rate limiting, 100% reliability, simple format

§Adding New Providers

Follow the established pattern:

providers/
└── [provider_name]/
    ├── mod.rs          # Public API and documentation
    ├── client.rs       # HTTP client or WebSocket
    ├── types.rs        # Provider-specific data structures
    ├── builder.rs      # Open deviation bar builder (if custom logic needed)
    └── conversion.rs   # Convert to AggTrade format

§Design Principles

  1. Adapter pattern: Convert provider format → AggTrade (core format)
  2. Error propagation: Raise immediately, no silent failures
  3. Stateless where possible: Cache externally, not in provider
  4. Documented edge cases: Timezone handling, decimal factors, etc.
  5. Out-of-box dependencies: Use standard crates (zip, csv, chrono)

§Quick Start

Top-level re-exports allow shorter import paths:

// Top-level imports (recommended)
use opendeviationbar_providers::{
    HistoricalDataLoader,
    get_tier1_symbols,
    ExnessFetcher,
};

Or use submodule paths directly:

// Submodule imports (also supported)
use opendeviationbar_providers::binance::HistoricalDataLoader;
use opendeviationbar_providers::exness::ExnessFetcher;

Re-exports§

pub use binance::AdaptiveRateLimiter;
pub use binance::BinanceWebSocketStream;
pub use binance::CsvAggTrade;
pub use binance::HistoricalDataLoader;
pub use binance::HistoricalError;
pub use binance::IntraDayChunkIterator;
pub use binance::RateLimitError;
pub use binance::TIER1_SYMBOLS;
pub use binance::WebSocketError;
pub use binance::detect_csv_headers;
pub use binance::fetch_aggtrades_parallel;
pub use binance::get_tier1_symbols;
pub use binance::get_tier1_usdt_pairs;
pub use binance::is_tier1_symbol;
pub use binance::python_bool;
pub use binance::shared_binance_limiter;

Modules§

binance
Binance data provider
serde_helpers
Binance sends price and quantity as JSON strings (e.g., "112070.01000000"). Instead of deserializing to String then parsing, these helpers deserialize directly to FixedPoint — eliminating per-trade String allocations (~4000/sec on WS).