# zagmi/qxbroker architecture

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

- Interactive diagram: https://gitdiagram.com/zagmi/qxbroker
- Repository: https://github.com/zagmi/qxbroker

## Overview

QuotexPy is a Python client library for qxbroker. An application calls the Quotex facade, which coordinates authentication, session reuse, WebSocket startup, market-data subscriptions, and binary-option operations. Authentication obtains cookies and an SSID; the WebSocket client dispatches channel requests and parses asynchronous platform messages into account, candle, signal, and trade state. The sampled files show core runtime wiring, while some HTTP resource details remain unsampled.

Main entry points: [`quotexpy/ws/client.py`](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/client.py) (WebSocket client), [`quotexpy/api.py`](https://github.com/zagmi/qxbroker/blob/main/quotexpy/api.py) (Quotex API), [`quotexpy/__init__.py`](https://github.com/zagmi/qxbroker/blob/main/quotexpy/__init__.py) (Quotex facade), [`quotexpy/http/qxbroker.py`](https://github.com/zagmi/qxbroker/blob/main/quotexpy/http/qxbroker.py) (Browser login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public API"]
  node_quotex_facade["Quotex facade<br/>[__init__.py]"]
  node_quotex_api["Quotex API<br/>[api.py]"]
end

subgraph group_auth["Authentication"]
  node_browser_login["Browser login<br/>[qxbroker.py]"]
  node_http_resources["HTTP resources"]
  node_session_cache[("Session cache<br/>[__init__.py]")]
end

subgraph group_transport["Realtime Transport"]
  node_ws_client["WebSocket client<br/>[client.py]"]
  node_ssid_channel["SSID channel<br/>[ssid.py]"]
  node_trade_channel["Trade channel<br/>[trade.py]"]
  node_candle_channel["Candle channel<br/>[candles.py]"]
  node_sell_channel["Sell option channel<br/>[sell_option.py]"]
end

subgraph group_domain["Domain State"]
  node_account_state["Account state<br/>[profile.py]"]
  node_candle_state["Candle state<br/>[candles.py]"]
  node_time_sync["Time synchronization<br/>[timesync.py]"]
  node_trade_state["Trade result state<br/>[listinfodata.py]"]
  node_signal_state["Signal state<br/>[api.py]"]
end

node_user_app(("User application"))
node_http_platform{{"qxbroker HTTP"}}
node_ws_platform{{"qxbroker WebSocket"}}

node_user_app -->|"calls API"| node_quotex_facade
node_quotex_facade -->|"coordinates"| node_quotex_api
node_quotex_api -->|"reads sessions"| node_session_cache
node_quotex_api -->|"refreshes SSID"| node_http_resources
node_http_resources -->|"starts login"| node_browser_login
node_browser_login -->|"logs in"| node_http_platform
node_browser_login -->|"writes session"| node_session_cache
node_quotex_api -->|"starts socket"| node_ws_client
node_ws_client -->|"exchanges messages"| node_ws_platform
node_quotex_api -->|"authorizes socket"| node_ssid_channel
node_quotex_api -->|"opens trades"| node_trade_channel
node_quotex_api -->|"requests candles"| node_candle_channel
node_quotex_api -->|"sells options"| node_sell_channel
node_ssid_channel -->|"sends SSID"| node_ws_client
node_trade_channel -->|"sends orders"| node_ws_client
node_candle_channel -->|"sends subscriptions"| node_ws_client
node_sell_channel -->|"sends sale"| node_ws_client
node_ws_client -->|"updates balances"| node_account_state
node_ws_client -->|"stores candles"| node_candle_state
node_ws_client -->|"updates clock"| node_time_sync
node_ws_client -->|"stores outcomes"| node_trade_state
node_ws_client -->|"stores signals"| node_signal_state
node_quotex_facade -->|"reads balance"| node_account_state
node_quotex_facade -->|"returns candles"| node_candle_state
node_quotex_facade -->|"reads results"| node_trade_state

click node_quotex_facade "https://github.com/zagmi/qxbroker/blob/main/quotexpy/__init__.py"
click node_quotex_api "https://github.com/zagmi/qxbroker/blob/main/quotexpy/api.py"
click node_browser_login "https://github.com/zagmi/qxbroker/blob/main/quotexpy/http/qxbroker.py"
click node_http_resources "https://github.com/zagmi/qxbroker/tree/main/quotexpy/http"
click node_session_cache "https://github.com/zagmi/qxbroker/blob/main/quotexpy/utils/__init__.py"
click node_ws_client "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/client.py"
click node_ssid_channel "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/ssid.py"
click node_trade_channel "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/trade.py"
click node_candle_channel "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/candles.py"
click node_sell_channel "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/sell_option.py"
click node_account_state "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/profile.py"
click node_candle_state "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/candles.py"
click node_time_sync "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/timesync.py"
click node_trade_state "https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/listinfodata.py"
click node_signal_state "https://github.com/zagmi/qxbroker/blob/main/quotexpy/api.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_quotex_facade,node_quotex_api,node_user_app toneBlue
class node_browser_login,node_http_resources,node_session_cache toneAmber
class node_ws_client,node_ssid_channel,node_trade_channel,node_candle_channel,node_sell_channel toneMint
class node_account_state,node_candle_state,node_time_sync,node_trade_state,node_signal_state toneRose
class node_http_platform,node_ws_platform toneIndigo
```

## Components

### Public API

- [Quotex facade](https://github.com/zagmi/qxbroker/blob/main/quotexpy/__init__.py): `quotexpy/__init__.py`
- [Quotex API](https://github.com/zagmi/qxbroker/blob/main/quotexpy/api.py): `quotexpy/api.py`

### Authentication

- [Browser login](https://github.com/zagmi/qxbroker/blob/main/quotexpy/http/qxbroker.py): `quotexpy/http/qxbroker.py`
- [HTTP resources](https://github.com/zagmi/qxbroker/tree/main/quotexpy/http): `quotexpy/http`
- [Session cache](https://github.com/zagmi/qxbroker/blob/main/quotexpy/utils/__init__.py): `quotexpy/utils/__init__.py`

### Realtime Transport

- [WebSocket client](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/client.py): `quotexpy/ws/client.py`
- [SSID channel](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/ssid.py): `quotexpy/ws/channels/ssid.py`
- [Trade channel](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/trade.py): `quotexpy/ws/channels/trade.py`
- [Candle channel](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/candles.py): `quotexpy/ws/channels/candles.py`
- [Sell option channel](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/channels/sell_option.py): `quotexpy/ws/channels/sell_option.py`

### Domain State

- [Account state](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/profile.py): `quotexpy/ws/objects/profile.py`
- [Candle state](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/candles.py): `quotexpy/ws/objects/candles.py`
- [Time synchronization](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/timesync.py): `quotexpy/ws/objects/timesync.py`
- [Trade result state](https://github.com/zagmi/qxbroker/blob/main/quotexpy/ws/objects/listinfodata.py): `quotexpy/ws/objects/listinfodata.py`
- [Signal state](https://github.com/zagmi/qxbroker/blob/main/quotexpy/api.py): `quotexpy/api.py`

### Other components

- **User application**
- **qxbroker HTTP**
- **qxbroker WebSocket**

## Connections

- User application → Quotex facade: calls API
- Quotex facade → Quotex API: coordinates
- Quotex API → Session cache: reads sessions
- Quotex API → HTTP resources: refreshes SSID
- HTTP resources → Browser login: starts login
- Browser login → qxbroker HTTP: logs in
- Browser login → Session cache: writes session
- Quotex API → WebSocket client: starts socket
- WebSocket client → qxbroker WebSocket: exchanges messages
- Quotex API → SSID channel: authorizes socket
- Quotex API → Trade channel: opens trades
- Quotex API → Candle channel: requests candles
- Quotex API → Sell option channel: sells options
- SSID channel → WebSocket client: sends SSID
- Trade channel → WebSocket client: sends orders
- Candle channel → WebSocket client: sends subscriptions
- Sell option channel → WebSocket client: sends sale
- WebSocket client → Account state: updates balances
- WebSocket client → Candle state: stores candles
- WebSocket client → Time synchronization: updates clock
- WebSocket client → Trade result state: stores outcomes
- WebSocket client → Signal state: stores signals
- Quotex facade → Account state: reads balance
- Quotex facade → Candle state: returns candles
- Quotex facade → Trade result state: reads results
