Repository navigation
Data Pipeline
DerivLab is designed to keep working when the network does not.
flowchart LR
YF[Yahoo Finance] --> CACHE[Local Parquet cache]
SEED[Bundled seed] --> CACHE
CACHE --> HV[30-day realised HV]
HV --> IV[Synthetic implied volatility]
IV --> CHAIN[Black-Scholes chain + Greeks]
CHAIN --> ENGINE[Backtrader engine]
ENGINE --> GAME[Hold the Position]
ENGINE --> ARENA[AI Arena]
YF -. failure .-> SEED
SEED -. missing .-> SYN[Synthetic fallback]
In plain English: the seed and cache are both valid starting points; a refresh is optional. The option chain is derived locally, so the simulation and the agent decisions never depend on a live quote feed.
-
Bundled seed — committed five-year snapshot in
data/seed/. -
Local cache — per-machine Parquet files in
data/cache/. -
Yahoo Finance — optional refresh via
yfinance. - Synthetic fallback — deterministic generated prices for the last resort.
The UI labels the active source on the Data Vault screen: Live cache, Bundled seed, or Synthetic fallback.
Fourteen instruments across US and European equities, FX, gold, Brent, and four indices. Each asset carries its own contract multiplier, currency, and base volatility assumptions.
From the UI: Data Vault → Refresh all (5Y).
From the command line:
docker compose run --rm derivlab-seedThe seeder:
- retries transient failures;
- keeps the last good cache file if a download fails;
- writes a manifest with source, row count, and dates;
- never deletes a successful file during a failed refresh.
Realized volatility is computed from 30-day log returns. Synthetic IV is derived from that with an asset-specific base and a configurable multiplier. The option chain is priced with Black-Scholes.
This is a teaching model: it gives a realistic-looking surface without pretending to be an executable market.
Backtests, the game, and the AI Arena share the same scenario slicing. The AI context is computed strictly before the scenario start, so no future bars leak into the agents' decisions.
data/
├── seed/ # committed demo snapshot (Parquet + manifest)
└── cache/ # per-machine runtime cache (gitignored)
The cache is stored in a named Docker volume in Compose deployments, so
docker compose down -v resets it.
- Missing cache + no network → seed.
- Missing seed + no network → synthetic fallback with a visible warning.
- A failed refresh keeps the existing cache.
- A corrupt asset is reported per asset, not as a global crash.
See Troubleshooting.
DerivLab · an educational options & futures strategy emulator · docs verified against v1.2.0 on 2026-10-23 · README · Docs feedback · MIT License · Not investment advice.
Start here
- Home
- Getting Started
- Compatibility & Versions
- Feature Tour
- FAQ
- Documentation & ADRs
- Versioning
- Roadmap
Core systems
- Architecture
- Backtest Engine
- Strategy Library
- AI Agents
- AI Model Guide
- LLM Quality & Safety
- Data Pipeline
- Game Mode
Engineering
- Configuration
- Testing & CI
- Deployment
- Security
- Project Structure
- Troubleshooting
- Glossary
- Release Notes