A high-performance Rust library for compressing multi-symbol financial time series data with built-in integrity verification.
This is just a pet project (and my first in rust), don't take it seriously.
- High compression ratio on typical financial data
- Microsecond-level serialization and deserialization
- Checksum verification (CRC32)
- Multi-symbol support - compress multiple instruments simultaneously
- Lossless with controlled precision - basis point accuracy
- Fail-fast corruption detection
HDRS exploits three key properties of financial data:
- Temporal correlation - Prices change in small increments most of the time
- Cross-symbol correlation - Related assets often move together
- Sparse significant events - Large moves are rare
┌─────────────────────────────────────────────────────┐
│ Layer 1: Reference Frame │
│ • Full precision baseline at T₀ │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Layer 2: Variable-Bit Delta Encoding │
│ • 4 bits: ±7 basis points (common case) │
│ • 8 bits: ±127 basis points (moderate moves) │
│ • 32 bits: Full precision (rare large moves) │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Layer 3: Symbol Interleaving │
│ • Bitmap indicates which symbols changed │
│ • Only store deltas for changed symbols │
└─────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────┐
│ Layer 4: Integrity Checksums (CRC32) │
│ • Reference frame checksum │
│ • Compressed data checksum │
│ • Overall structure checksum │
└─────────────────────────────────────────────────────┘
Flesh this out more, drive error down, up compression
This project is licensed under the WTFPL. See LICENSE for more details