4 releases (2 breaking)
Uses new Rust 2024
| 0.3.1 | Dec 29, 2025 |
|---|---|
| 0.3.0 | Dec 29, 2025 |
| 0.2.0 | Dec 29, 2025 |
| 0.1.0 | Dec 29, 2025 |
#627 in Finance
Used in paracas-lib
55KB
1K
SLoC
paracas-fetch
HTTP client and data fetching for the paracas tick data downloader.
Features
- Concurrent HTTP downloads with connection pooling
- LZMA decompression for bi5 files
- Binary tick data parsing
- Streaming async API with backpressure
Architecture
The fetch pipeline consists of:
- URL Builder - Constructs Dukascopy data URLs
- HTTP Client - Downloads bi5 files with retries
- Decompressor - LZMA decompression
- Parser - Binary tick data parsing
Usage
use paracas_fetch::{DownloadClient, ClientConfig, tick_stream};
use paracas_instruments::InstrumentRegistry;
use paracas_types::DateRange;
use futures::StreamExt;
#[tokio::main]
async fn main() {
let client = DownloadClient::new(ClientConfig::default()).unwrap();
let registry = InstrumentRegistry::global();
let instrument = registry.get("eurusd").unwrap();
let range = DateRange::new(
chrono::NaiveDate::from_ymd_opt(2024, 1, 1).unwrap(),
chrono::NaiveDate::from_ymd_opt(2024, 1, 1).unwrap(),
).unwrap();
let mut stream = tick_stream(&client, instrument, range);
while let Some(result) = stream.next().await {
match result {
Ok(tick) => println!("{:?}", tick),
Err(e) => eprintln!("Error: {}", e),
}
}
}
License
MIT License - see LICENSE for details.
Dependencies
~8–24MB
~263K SLoC