How astomelio/binance works
This repository combines a Binance-facing API, a market-data lake and feature pipeline, ML strategy exploration and allocation, and a reusable trading library, plus automation and bot integrations. The principal research workflow is collect and transform market data, load decision features, train or infer allocations, then evaluate them with backtests. The graph includes documented capabilities whose source was not excerpted; their internal links are omitted where the evidence does not establish them. Paths and connections reflect the tree, README, and supplied source index/excerpts.
Main entry points: main.py REST and WebSocket API · loader.py Feature loader · pipeline.py Model training · agent.py Strategy explorer
Components 23
Binance API
- REST and WebSocket API
apps/api/main.py
Market Data
- Market collectors
data_platform/ingestion/collectors.py - Lake pipeline
data_platform/pipeline.py - Bronze and silver lake
data_platform/storage/lake_writer.py - DuckDB loader
data_platform/loaders/bronze_to_duckdb.py - Silver and gold transforms
data_platform/transforms/gold.py - Feature warehouse
data_platform/loaders/bronze_to_duckdb.py
AI Strategies
- Feature loader
ai/data/loader.py - Model training
ai/training/pipeline.py - Allocation inference
ai/inference/predictor.py - Allocation backtest
ai/allocation/backtest.py - Strategy explorer
ai/explorer/agent.py - Strategy registry
ai/explorer/registry.py - Run registry
ai/registry.py
Trading Library
- Planner engine
trading_lib/planner/engine.py - Constrained allocation
trading_lib/planner/allocation.py - Quant calibration
trading_lib/quant/calibration.py
Automation
- Market alerts
apps/automation/market_alert_engine.py - Fee calculator
apps/automation/fee_calculator.py - Bot rebalance integration
apps/integrations/bot_integrator.py - Trading signals
apps/integrations/trading_signals.py
Other components
- API client
- Binance
Connections 23
- API client → REST and WebSocket API: requests
README.md - REST and WebSocket API → Binance: calls
apps/api/main.py - Lake pipeline → Market collectors: runs collection
data_platform/pipeline.py - Lake pipeline → Bronze and silver lake: writes events
data_platform/pipeline.py - Market collectors → Binance: fetches market data
data_platform/ingestion/collectors.py - Bronze and silver lake → DuckDB loader: loads bronze data
README.md - DuckDB loader → Feature warehouse: writes tables
README.md - Silver and gold transforms → Feature warehouse: builds features
README.md - Feature loader → Feature warehouse: reads features
ai/data/loader.py - Model training → Feature loader: loads rows
ai/training/pipeline.py - Allocation inference → Feature loader: loads latest features
ai/inference/predictor.py - Model training → Quant calibration: uses calibration
ai/training/pipeline.py - Allocation inference → Quant calibration: uses calibration
ai/inference/predictor.py - Model training → Run registry: records runs
ai/training/pipeline.py - Strategy explorer → Feature loader: loads data
ai/explorer/agent.py - Strategy explorer → Strategy registry: selects strategies
ai/explorer/agent.py - Strategy explorer → Allocation backtest: evaluates experiments
- Allocation backtest → Run registry: records results
- Planner engine → Constrained allocation: computes allocations
trading_lib/planner/engine.py - Market alerts → REST and WebSocket API: requests market data
apps/automation/market_alert_engine.py - Market alerts → Fee calculator: checks fees
apps/automation/market_alert_engine.py - Bot rebalance integration → REST and WebSocket API: integrates rebalance
- Trading signals → REST and WebSocket API: signal integration