# veighna-global/vnpy_evo architecture

> Architecture diagram of the GitHub repository veighna-global/vnpy_evo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/veighna-global/vnpy_evo
- Repository: https://github.com/veighna-global/vnpy_evo

## Overview

##### Project Type and Purpose
- The project is a full-featured quantitative trading platform built for traders with a focus on algorithmic trading in crypto (and forex) markets.
- The README indicates key functionalities such as market data ingestion (gateways), an event engine for handling trading events, a trader engine for order management and execution, integrated charting tools, database interfaces, RPC for distributed systems, and a QT-based GUI.
- The project is clearly modular, enabling integration of external gateway modules (e.g., Binance, OKX, Bybit, etc.) and strategy applications (such as Nova Strategy).

##### File Structure
- Top-level directories/files: Apart from standard project configuration files (e.g., setup.py, requirements.txt, LICENSE), you have:
- The “vnpy_evo” package that holds all core modules.
- A set of example directories demonstrating different use cases (candle_chart, evo_trader, simple_rpc).
- Inside “vnpy_evo”, the following modules are evident:
- Chart (for high-performance charting),
- Event (the central event engine for dispatching market/trading events),
- REST (likely for REST API client functionality),
- RPC (for the standardized remote procedure call system),
- Trader (the heart of the trading engine that includes UI, database, and engine components),
- Websocket (for streaming data and communication with market data providers).
- Within “vnpy_evo/trader”, you see multiple components: the main engine, UI components (like MainWindow, monitor, widget, etc.), gateways, datafeeds, and utility modules, suggesting a clear separation of the trading logic from presentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    MD["Market Data Source"]:::external
    REST["REST Communication Module<br/>(API)"]:::integration
    WS["Websocket Communication Module<br/>(Real-time)"]:::integration
    EE["Event Engine<br/>(Central Dispatcher)"]:::core
    TE["Trader Engine<br/>(Order Management, Gateway, DB, Datafeed)"]:::core
    UI["UI Module<br/>(QT-based GUI)"]:::ui
    CH["Charting Module<br/>(Market Visualization)"]:::ui
    RPC["RPC Communication Module<br/>(Distributed)"]:::integration

    MD -->|"supplies"| REST
    MD -->|"supplies"| WS
    REST -->|"delivers"| EE
    WS -->|"delivers"| EE
    EE -->|"triggers"| TE
    EE -->|"updates"| UI
    TE -->|"coordinates"| RPC
    TE -->|"sends data"| CH
    TE -->|"notifies"| UI

    click EE "https://github.com/veighna-global/vnpy_evo/tree/main/vnpy_evo/event/"
    click TE "https://github.com/veighna-global/vnpy_evo/tree/main/vnpy_evo/trader/"
    click UI "https://github.com/veighna-global/vnpy_evo/tree/main/vnpy_evo/trader/ui/"
    click CH "https://github.com/veighna-global/vnpy_evo/tree/main/vnpy_evo/chart/"
    click REST "https://github.com/veighna-global/vnpy_evo/blob/main/vnpy_evo/rest/rest_client.py"
    click RPC "https://github.com/veighna-global/vnpy_evo/tree/main/vnpy_evo/rpc/"
    click WS "https://github.com/veighna-global/vnpy_evo/blob/main/vnpy_evo/websocket/websocket_client.py"

    classDef external fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef integration fill:#FCF3CF,stroke:#F1C40F,stroke-width:2px;
    classDef core fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef ui fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
```
