Repository navigation
Project Structure
Sergey Gerasimov edited this page Oct 22, 2026
·
3 revisions
DerivLab/
├── app.py # Streamlit entry point
├── derivlab/
│ ├── config.py # assets, scenarios, copy, version
│ ├── data_fetcher.py # yfinance, cache, seed, fallback
│ ├── strategies.py # plans, legs, Black-Scholes, Greeks
│ ├── backtest_engine.py # Backtrader controller, ledger, event bridge
│ ├── game_mode.py # scenario game state machine
│ ├── metrics.py # performance metrics and game score
│ ├── charts.py # Plotly figures
│ ├── theme.py # cyberpunk CSS and components
│ ├── ui.py # six screens and navigation
│ └── agents/
│ ├── llm.py # provider settings, HTTP client, model catalog
│ ├── personas.py # desks, context, policies, decision prompt
│ ├── bridge.py # async Backtrader event bridge
│ ├── commentary.py # critic report, NewsWire, fallbacks
│ ├── arena.py # four-desk arena, scoring, triggers
│ └── parsing.py # tolerant JSON extraction
├── tests/ # 247 offline tests
├── .github/workflows/ # CI and CodeQL
├── .devcontainer/ # reproducible Dev Container
├── docs/
│ ├── screenshots/ # README/Wiki imagery
│ └── demo/ # MP4, GIF, poster
├── data/
│ ├── seed/ # committed demo snapshot
│ └── cache/ # per-machine cache (gitignored)
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── requirements-dev.txt
├── CHANGELOG.md
└── README.md
| Path | Responsibility |
|---|---|
ui.py |
Screen composition, session state, live game fragment |
backtest_engine.py |
Event loop, ledger, NAV, trade metadata, bridge events |
strategies.py |
Position sizing, option legs, pricing, Greeks |
data_fetcher.py |
Source precedence, Parquet I/O, retry behavior |
agents/arena.py |
Four-desk orchestration, ranking, payload, model stack |
agents/llm.py |
OpenAI-compatible/Anthropic calls, timeouts, fallbacks |
agents/commentary.py |
Strict report/news contracts and local fallbacks |
- Add the strategy key and education copy in
config.pyandstrategies.py. - Implement the plan/legs and any strategy-specific ledger logic.
- Add a policy branch if an AI desk should use it.
- Extend tests in
tests/test_strategies.py,test_backtest_engine.py, andtest_agents.py. - Update Strategies and the README tour if it is user-facing.
- Add the provider label and base URL/default models in
agents/llm.py. - Implement the request/response shape in
LLMClient. - Add a mocked HTTP test.
- Document it in AI Model Guide.
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