# victorh-silveira/aether-quantum-engine architecture

> Architecture diagram of the GitHub repository victorh-silveira/aether-quantum-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/victorh-silveira/aether-quantum-engine
- Repository: https://github.com/victorh-silveira/aether-quantum-engine

## Overview

Aether Quantum Engine is an asynchronous quantitative trading system for Deriv Rise/Fall contracts. Its operational path starts with engine configuration and authentication, consumes market streams, evaluates indicator and trading signals, sizes and gates orders, then submits trades and tracks settlement. Training, pullback research, and deep-learning services are separate capabilities alongside live execution. The graph emphasizes relationships visible in the sampled files and SOURCE INDEX; unsampled subsystem links are omitted where their callers could not be verified.

Main entry points: [`src/application/services/orchestrator/execution_manager_execute.py`](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/execution_manager_execute.py) (Order Sizing), [`src/infrastructure/handlers/trade_handler.py`](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/handlers/trade_handler.py) (Trade Handler), [`src/application/services/orchestrator/engine_session.py`](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/engine_session.py) (Engine Bootstrap), [`src/infrastructure/api/websocket_manager.py`](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/api/websocket_manager.py) (WebSocket Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Engine Control"]
  node_engine_session["Engine Bootstrap<br/>[engine_session.py]"]
  node_auth["Deriv Authentication<br/>[auth_manager.py]"]
  node_engine_mode["Engine Modes<br/>[engine_mode.py]"]
  node_execution_manager["Execution Manager"]
end

subgraph group_market["Market Data"]
  node_stream_handler["Market Stream<br/>[stream_handler.py]"]
  node_websocket["WebSocket Client"]
  node_market_data["Market Models<br/>[market_data.py]"]
end

subgraph group_signals["Signals and Models"]
  node_indicator_service["Indicator Service<br/>[service.py]"]
  node_indicator_model["Indicator Model<br/>[model.py]"]
  node_research_pipeline["Pullback Research"]
  node_deep_learning["Deep Learning"]
  node_consensus["Indicator Consensus"]
end

subgraph group_trading["Trading and Risk"]
  node_execution_orders["Order Sizing"]
  node_risk_manager["Risk Manager<br/>[risk_manager.py]"]
  node_stake_sizing["Stake Sizing<br/>[stake_sizing.py]"]
  node_trade_handler["Trade Handler<br/>[trade_handler.py]"]
  node_quote_guard["Quote EV Guard"]
  node_trade_model["Trade Contracts<br/>[trade.py]"]
end

subgraph group_platform["State and Infrastructure"]
  node_rest_client["Deriv REST Client"]
  node_state_manager["State Manager<br/>[state_manager.py]"]
  node_persistence["Persistence Manager"]
  node_redis_pipeline["Redis State Pipeline"]
  node_timescale[("Timescale Writer")]
end

node_operator(("Operator"))
node_deriv{{"Deriv API"}}
node_redis[("Redis")]
node_timescale_db[("TimescaleDB")]

node_operator -->|"starts"| node_engine_session
node_engine_session -->|"creates auth"| node_auth
node_engine_session -->|"applies mode"| node_engine_mode
node_engine_session -->|"validates config"| node_risk_manager
node_auth -->|"creates client"| node_rest_client
node_rest_client -.->|"requests account"| node_deriv
node_execution_manager -->|"delegates orders"| node_execution_orders
node_execution_orders -->|"reads consensus"| node_consensus
node_execution_orders -->|"sizes stake"| node_stake_sizing
node_execution_orders -->|"checks quote"| node_quote_guard
node_execution_orders -->|"uses trade types"| node_trade_model
node_stream_handler -->|"receives stream"| node_websocket
node_stream_handler -->|"builds market data"| node_market_data
node_websocket -.->|"connects"| node_deriv
node_indicator_service -->|"uses model"| node_indicator_model
node_indicator_model -->|"supports research"| node_research_pipeline
node_consensus -->|"writes evidence"| node_timescale
node_execution_manager -->|"uses risk state"| node_risk_manager
node_trade_handler -->|"submits trades"| node_websocket
node_trade_handler -->|"checks quote EV"| node_quote_guard
node_trade_handler -->|"returns contract"| node_trade_model
node_trade_handler -.->|"may use REST"| node_deriv
node_state_manager -->|"delegates persistence"| node_persistence
node_redis_pipeline -.->|"writes state"| node_redis
node_timescale -.->|"persists market data"| node_timescale_db

click node_engine_session "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/engine_session.py"
click node_auth "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/auth_manager.py"
click node_engine_mode "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/engine_mode.py"
click node_execution_manager "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/execution_manager.py"
click node_execution_orders "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/execution_manager_execute.py"
click node_stream_handler "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/handlers/stream_handler.py"
click node_websocket "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/api/websocket_manager.py"
click node_market_data "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/models/market_data.py"
click node_indicator_service "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/indicator/service.py"
click node_indicator_model "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/indicator/model.py"
click node_research_pipeline "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/indicator/research_pipeline.py"
click node_deep_learning "https://github.com/victorh-silveira/aether-quantum-engine/tree/main/src/application/services/deep_learning"
click node_consensus "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/indicator_consensus.py"
click node_risk_manager "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/risk/risk_manager.py"
click node_stake_sizing "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/risk/stake_sizing.py"
click node_trade_handler "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/handlers/trade_handler.py"
click node_quote_guard "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/rise_fall_quote_guard.py"
click node_trade_model "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/models/trade.py"
click node_rest_client "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/api/deriv_rest_client.py"
click node_state_manager "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/state/state_manager.py"
click node_persistence "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/state/persistence_manager.py"
click node_redis_pipeline "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/state/redis_state_pipeline.py"
click node_timescale "https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/market/timescale_writer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine_session,node_auth,node_engine_mode,node_execution_manager toneBlue
class node_stream_handler,node_websocket,node_market_data,node_redis,node_timescale_db toneAmber
class node_indicator_service,node_indicator_model,node_research_pipeline,node_deep_learning,node_consensus,node_deriv toneMint
class node_execution_orders,node_risk_manager,node_stake_sizing,node_trade_handler,node_quote_guard,node_trade_model toneRose
class node_rest_client,node_state_manager,node_persistence,node_redis_pipeline,node_timescale,node_operator toneIndigo
```

## Components

### Engine Control

- [Engine Bootstrap](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/engine_session.py): `src/application/services/orchestrator/engine_session.py`
- [Deriv Authentication](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/auth_manager.py): `src/application/services/auth_manager.py`
- [Engine Modes](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/engine_mode.py): `src/application/services/orchestrator/engine_mode.py`
- [Execution Manager](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/execution_manager.py): `src/application/services/orchestrator/execution_manager.py`

### Market Data

- [Market Stream](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/handlers/stream_handler.py): `src/infrastructure/handlers/stream_handler.py`
- [WebSocket Client](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/api/websocket_manager.py): `src/infrastructure/api/websocket_manager.py`
- [Market Models](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/models/market_data.py): `src/domain/models/market_data.py`

### Signals and Models

- [Indicator Service](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/indicator/service.py): `src/indicator/service.py`
- [Indicator Model](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/indicator/model.py): `src/indicator/model.py`
- [Pullback Research](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/indicator/research_pipeline.py): `src/indicator/research_pipeline.py`
- [Deep Learning](https://github.com/victorh-silveira/aether-quantum-engine/tree/main/src/application/services/deep_learning): `src/application/services/deep_learning`
- [Indicator Consensus](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/indicator_consensus.py): `src/application/services/indicator_consensus.py`

### Trading and Risk

- [Order Sizing](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/orchestrator/execution_manager_execute.py): `src/application/services/orchestrator/execution_manager_execute.py`
- [Risk Manager](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/risk/risk_manager.py): `src/domain/risk/risk_manager.py`
- [Stake Sizing](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/risk/stake_sizing.py): `src/domain/risk/stake_sizing.py`
- [Trade Handler](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/handlers/trade_handler.py): `src/infrastructure/handlers/trade_handler.py`
- [Quote EV Guard](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/application/services/rise_fall_quote_guard.py): `src/application/services/rise_fall_quote_guard.py`
- [Trade Contracts](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/domain/models/trade.py): `src/domain/models/trade.py`

### State and Infrastructure

- [Deriv REST Client](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/api/deriv_rest_client.py): `src/infrastructure/api/deriv_rest_client.py`
- [State Manager](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/state/state_manager.py): `src/infrastructure/state/state_manager.py`
- [Persistence Manager](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/state/persistence_manager.py): `src/infrastructure/state/persistence_manager.py`
- [Redis State Pipeline](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/state/redis_state_pipeline.py): `src/infrastructure/state/redis_state_pipeline.py`
- [Timescale Writer](https://github.com/victorh-silveira/aether-quantum-engine/blob/main/src/infrastructure/market/timescale_writer.py): `src/infrastructure/market/timescale_writer.py`

### Other components

- **Operator**
- **Deriv API**
- **Redis**
- **TimescaleDB**

## Connections

- Operator → Engine Bootstrap: starts (evidence: `README.md`)
- Engine Bootstrap → Deriv Authentication: creates auth (evidence: `src/application/services/orchestrator/engine_session.py`)
- Engine Bootstrap → Engine Modes: applies mode (evidence: `src/application/services/orchestrator/engine_session.py`)
- Engine Bootstrap → Risk Manager: validates config (evidence: `src/application/services/orchestrator/engine_session.py`)
- Deriv Authentication → Deriv REST Client: creates client (evidence: `src/application/services/auth_manager.py`)
- Deriv REST Client → Deriv API: requests account (evidence: `README.md`)
- Execution Manager → Order Sizing: delegates orders (evidence: `src/application/services/orchestrator/execution_manager.py`)
- Order Sizing → Indicator Consensus: reads consensus (evidence: `src/application/services/orchestrator/execution_manager_execute.py`)
- Order Sizing → Stake Sizing: sizes stake (evidence: `src/application/services/orchestrator/execution_manager_execute.py`)
- Order Sizing → Quote EV Guard: checks quote (evidence: `src/application/services/orchestrator/execution_manager_execute.py`)
- Order Sizing → Trade Contracts: uses trade types (evidence: `src/application/services/orchestrator/execution_manager_execute.py`)
- Market Stream → WebSocket Client: receives stream (evidence: `src/infrastructure/handlers/stream_handler.py`)
- Market Stream → Market Models: builds market data (evidence: `src/infrastructure/handlers/stream_handler.py`)
- WebSocket Client → Deriv API: connects (evidence: `README.md`)
- Indicator Service → Indicator Model: uses model (evidence: `src/indicator/service.py`)
- Indicator Model → Pullback Research: supports research (evidence: `src/indicator/research_pipeline.py`)
- Indicator Consensus → Timescale Writer: writes evidence (evidence: `src/application/services/indicator_consensus.py`)
- Execution Manager → Risk Manager: uses risk state (evidence: `src/application/services/orchestrator/execution_manager.py`)
- Trade Handler → WebSocket Client: submits trades (evidence: `src/infrastructure/handlers/trade_handler.py`)
- Trade Handler → Quote EV Guard: checks quote EV (evidence: `src/infrastructure/handlers/trade_handler.py`)
- Trade Handler → Trade Contracts: returns contract (evidence: `src/infrastructure/handlers/trade_handler.py`)
- Trade Handler → Deriv API: may use REST (evidence: `README.md`)
- State Manager → Persistence Manager: delegates persistence (evidence: `src/infrastructure/state/state_manager.py`)
- Redis State Pipeline → Redis: writes state (evidence: `README.md`)
- Timescale Writer → TimescaleDB: persists market data (evidence: `README.md`)
