How gbeced/basana works
Main Components Identification
The system should be divided into these major components:
a. Core Framework Layer
• Event Dispatcher System
• WebSocket Management
• Configuration Management
• Data Models (Bars, Events, Pairs)
b. Backtesting Engine
• Exchange Simulation
• Account Management
• Order Management
• Lending/Margin Trading
• Charts/Visualization
c. External Exchange Integration
• Binance Integration
• Bitstamp Integration
• Yahoo Finance Integration
• Common Exchange Components
┌─ Core Framework Layer ─────────────────────┐
• Event Dispatcher │
• WebSocket Handler │
• Configuration Management │
• ┬───────────────────────┘
┌─ Backtesting ─────┼─── External Exchanges ─┐
• Exchange Sim ◄────┼────► Binance │
• Account Manager │ ├ Spot │
• Order Manager │ ├ Margin │
• Lending System │ └ Cross Margin │
• Charts/Viz │ Bitstamp │
• Spot │
• Order Book │
• ┼────────────────────────┘
┌─ Data Sources ────┼────────────────────────┐
• CSV Handlers │ │
• Trading Signals │ │
• Market Data │ │
• ┴────────────────────────┘
Key Architectural Patterns to Highlight
a. Event-Driven Architecture
• Event flow between components
• Central dispatcher role
• Async communication paths
b. Plugin Architecture
• How external exchanges plug into the core
• Demonstrate common interface implementations
• Extension points
c. Data Flow
• Market data ingestion paths
• Order execution flow
• Backtesting simulation flow
Important Implementation Details
• Separation between spot and margin trading
• WebSocket connections for real-time data
• Where configuration management applies
• Points where technical indicators can be plugged in
Integration Points
• External exchange APIs
• Data source connectors
• Strategy implementation hooks
• Visualization outputs