# vladgnedko0x0/pulse-trader architecture

> Architecture diagram of the GitHub repository vladgnedko0x0/pulse-trader, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vladgnedko0x0/pulse-trader
- Repository: https://github.com/vladgnedko0x0/pulse-trader

## Overview

Pulse Nexus is a Telegram-operated trade management and automation platform. A trader enters a trade through the bot’s trade wizard and order flow; the application maintains trade and user state, applies trade and strategy rules, and uses exchange workers for order execution and position monitoring. Persisted trade and position data also supports history and statistics. The README documents Binance and Bybit, analytics, journaling, and security; excerpts show Binance-backed execution and database operations, but do not expose the full startup wiring or all feature implementations.

Main entry points: [`Pulse-Trader/classes/TelegramAPI/TGBotWorker.cs`](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/TGBotWorker.cs) (Bot worker), [`Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.TradeWizard.cs`](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.TradeWizard.cs) (Trade wizard and order flow), [`Pulse-Trader/classes/Exchanges APIs/BINANCE/BinanceWorker.cs`](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/BINANCE/BinanceWorker.cs) (Binance worker), [`Pulse-Trader/classes/Database/DatabaseService.cs`](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Database/DatabaseService.cs) (Database service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Telegram interface"]
  node_program["Application startup<br/>[Program.cs]"]
  node_bot["Bot worker<br/>[TGBotWorker.cs]"]
  node_trade_flow["Trade wizard and order flow"]
  node_order_flow["Order interaction"]
  node_config_ui["User configuration"]
  node_admin_ui["Admin panel"]
end

subgraph group_trade["Trade management"]
  node_trade_model["Trade model<br/>[TradeInfo.cs]"]
  node_trade_math["Trade calculations<br/>[TradeMath.cs]"]
  node_strategies["Strategies and prerequisites<br/>[TradeStrategy.cs]"]
  node_trade_stats["Trade statistics"]
end

subgraph group_exchange["Exchange execution"]
  node_exchange_client["Exchange client interface<br/>[IExchangeClient.cs]"]
  node_binance_worker["Binance worker<br/>[BinanceWorker.cs]"]
  node_bybit_worker["Bybit worker<br/>[ByBitWorker.cs]"]
end

subgraph group_state["Persistence and services"]
  node_exchange_state["Exchange and session state"]
  node_database["Database service<br/>[DatabaseService.cs]"]
  node_user_state["User state<br/>[UserState.cs]"]
  node_crypto["Crypto utilities<br/>[CryptoUtils.cs]"]
  node_localization["Localization"]
end

node_trader(("Trader"))
node_telegram{{"Telegram"}}
node_binance_api{{"Binance API"}}
node_bybit_api{{"Bybit API"}}
node_mysql[("MySQL")]

node_trader -->|"sends updates"| node_telegram
node_telegram -->|"delivers updates"| node_bot
node_program -->|"initializes"| node_bot
node_program -->|"initializes"| node_crypto
node_program -->|"initializes"| node_localization
node_bot -->|"dispatches trade actions"| node_trade_flow
node_bot -->|"dispatches order actions"| node_order_flow
node_bot -->|"dispatches settings"| node_config_ui
node_bot -->|"dispatches admin actions"| node_admin_ui
node_trade_flow -->|"creates trades"| node_trade_model
node_trade_flow -->|"uses calculations"| node_trade_math
node_trade_flow -->|"uses trade rules"| node_strategies
node_order_flow -->|"updates trades"| node_trade_model
node_order_flow -->|"gets exchange client"| node_exchange_client
node_exchange_client -->|"implemented by"| node_binance_worker
node_binance_worker -->|"requests exchange operations"| node_binance_api
node_binance_worker -->|"saves positions"| node_database
node_database -->|"reads and writes"| node_mysql
node_trade_stats -->|"reads trade data"| node_database
node_admin_ui -->|"queries users"| node_database
node_admin_ui -->|"restores worker state"| node_exchange_state
node_bot -->|"maintains sessions"| node_user_state
node_trade_stats -->|"sends reports"| node_telegram
node_binance_worker -->|"sends notifications"| node_telegram
node_localization -->|"supplies text"| node_trade_flow
node_localization -->|"supplies text"| node_trade_stats
node_exchange_client -.->|"optional implementation"| node_bybit_worker
node_bybit_worker -.->|"documented integration"| node_bybit_api

click node_program "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/Program.cs"
click node_bot "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/TGBotWorker.cs"
click node_trade_flow "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.TradeWizard.cs"
click node_order_flow "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.OrderFlow.cs"
click node_config_ui "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Configuration/CacheOrdersWorker.ConfigRoot.cs"
click node_admin_ui "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Admin/CacheOrdersWorker.AdminPanel.cs"
click node_trade_model "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Trading/TradeInfo.cs"
click node_trade_math "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Trading/TradeMath.cs"
click node_strategies "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Trading/TradeStrategy.cs"
click node_trade_stats "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Statistics/CacheOrdersWorker.Statistics.cs"
click node_exchange_client "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/IExchangeClient.cs"
click node_binance_worker "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/BINANCE/BinanceWorker.cs"
click node_bybit_worker "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/BYBIT/ByBitWorker.cs"
click node_exchange_state "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/ExchangeWorkerState.cs"
click node_database "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Database/DatabaseService.cs"
click node_user_state "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/UserState.cs"
click node_crypto "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/CryptoUtilsF/CryptoUtils.cs"
click node_localization "https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Localization/LocalizationService.cs"

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_program,node_bot,node_trade_flow,node_order_flow,node_config_ui,node_admin_ui toneBlue
class node_trade_model,node_trade_math,node_strategies,node_trade_stats,node_mysql toneAmber
class node_exchange_client,node_binance_worker,node_bybit_worker,node_binance_api,node_bybit_api toneMint
class node_exchange_state,node_database,node_user_state,node_crypto,node_localization toneRose
class node_trader,node_telegram toneIndigo
```

## Components

### Telegram interface

- [Application startup](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/Program.cs): `Pulse-Trader/Program.cs`
- [Bot worker](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/TGBotWorker.cs): `Pulse-Trader/classes/TelegramAPI/TGBotWorker.cs`
- [Trade wizard and order flow](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.TradeWizard.cs): `Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.TradeWizard.cs`
- [Order interaction](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.OrderFlow.cs): `Pulse-Trader/classes/TelegramAPI/Trading/CacheOrdersWorker.OrderFlow.cs`
- [User configuration](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Configuration/CacheOrdersWorker.ConfigRoot.cs): `Pulse-Trader/classes/TelegramAPI/Configuration/CacheOrdersWorker.ConfigRoot.cs`
- [Admin panel](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Admin/CacheOrdersWorker.AdminPanel.cs): `Pulse-Trader/classes/TelegramAPI/Admin/CacheOrdersWorker.AdminPanel.cs`

### Trade management

- [Trade model](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Trading/TradeInfo.cs): `Pulse-Trader/classes/Trading/TradeInfo.cs`
- [Trade calculations](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Trading/TradeMath.cs): `Pulse-Trader/classes/Trading/TradeMath.cs`
- [Strategies and prerequisites](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Trading/TradeStrategy.cs): `Pulse-Trader/classes/Trading/TradeStrategy.cs`
- [Trade statistics](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/Statistics/CacheOrdersWorker.Statistics.cs): `Pulse-Trader/classes/TelegramAPI/Statistics/CacheOrdersWorker.Statistics.cs`

### Exchange execution

- [Exchange client interface](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/IExchangeClient.cs): `Pulse-Trader/classes/Exchanges APIs/IExchangeClient.cs`
- [Binance worker](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/BINANCE/BinanceWorker.cs): `Pulse-Trader/classes/Exchanges APIs/BINANCE/BinanceWorker.cs`
- [Bybit worker](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/BYBIT/ByBitWorker.cs): `Pulse-Trader/classes/Exchanges APIs/BYBIT/ByBitWorker.cs`

### Persistence and services

- [Exchange and session state](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Exchanges%20APIs/ExchangeWorkerState.cs): `Pulse-Trader/classes/Exchanges APIs/ExchangeWorkerState.cs`
- [Database service](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Database/DatabaseService.cs): `Pulse-Trader/classes/Database/DatabaseService.cs`
- [User state](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/TelegramAPI/UserState.cs): `Pulse-Trader/classes/TelegramAPI/UserState.cs`
- [Crypto utilities](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/CryptoUtilsF/CryptoUtils.cs): `Pulse-Trader/classes/CryptoUtilsF/CryptoUtils.cs`
- [Localization](https://github.com/vladgnedko0x0/pulse-trader/blob/master/Pulse-Trader/classes/Localization/LocalizationService.cs): `Pulse-Trader/classes/Localization/LocalizationService.cs`

### Other components

- **Trader**
- **Telegram**
- **Binance API**
- **Bybit API**
- **MySQL**

## Connections

- Trader → Telegram: sends updates
- Telegram → Bot worker: delivers updates
- Application startup → Bot worker: initializes
- Application startup → Crypto utilities: initializes
- Application startup → Localization: initializes
- Bot worker → Trade wizard and order flow: dispatches trade actions
- Bot worker → Order interaction: dispatches order actions
- Bot worker → User configuration: dispatches settings
- Bot worker → Admin panel: dispatches admin actions
- Trade wizard and order flow → Trade model: creates trades
- Trade wizard and order flow → Trade calculations: uses calculations
- Trade wizard and order flow → Strategies and prerequisites: uses trade rules
- Order interaction → Trade model: updates trades
- Order interaction → Exchange client interface: gets exchange client
- Exchange client interface → Binance worker: implemented by
- Binance worker → Binance API: requests exchange operations
- Binance worker → Database service: saves positions
- Database service → MySQL: reads and writes
- Trade statistics → Database service: reads trade data
- Admin panel → Database service: queries users
- Admin panel → Exchange and session state: restores worker state
- Bot worker → User state: maintains sessions
- Trade statistics → Telegram: sends reports
- Binance worker → Telegram: sends notifications
- Localization → Trade wizard and order flow: supplies text
- Localization → Trade statistics: supplies text
- Exchange client interface → Bybit worker: optional implementation
- Bybit worker → Bybit API: documented integration
