Differences
This shows you the differences between two versions of the page.
| trade-term:design [02.11.2026 14:10] – Trading terminal: concept design (stack, architecture, security, phases) aria | trade-term:design [09.11.2026 11:38] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <WRAP centeralign> | ||
| - | ====== Trading terminal – design ====== | ||
| - | |||
| - | **Concept design for the trade-term application.** | ||
| - | |||
| - | How Trading terminal would be built, if the project is carried out. Part of the [[stratum: | ||
| - | </ | ||
| - | |||
| - | <WRAP center round important 80%> | ||
| - | **Concept stage.** This is a design sketch, not a finished product and not a commitment. The project may still be retired. Nothing here is built yet; it guides development if and when the project is carried out. | ||
| - | </ | ||
| - | |||
| - | ===== Goal ===== | ||
| - | |||
| - | A web application for trading on crypto exchanges: live charts with indicators, several exchanges connected through their APIs, user-defined indicators and strategies, and multi-session trading – several concurrent trading sessions, each running a chosen strategy. Commercial, licensed per subscription through stratum-license. Delivered as a self-contained appliance on a Debian host running Stratum, in the same spirit as [[vm-reactor: | ||
| - | |||
| - | ===== Chosen stack ===== | ||
| - | |||
| - | ^ Layer | Choice | | ||
| - | ^ Backend | Go – a single self-contained service, embedded web assets, own HTTPS port, systemd, users/roles + 2FA | | ||
| - | ^ Frontend | Vue.js | | ||
| - | ^ Charts | TradingView Lightweight Charts (Apache-2.0) with an own indicator layer | | ||
| - | ^ Exchanges | CCXT, run as a sidecar (Node) | | ||
| - | ^ Strategies / indicators | User scripting in Lua (embedded, gopher-lua) and JavaScript (sidecar), one shared API | | ||
| - | ^ Licensing | stratum-license, | ||
| - | ^ Storage | Light and self-contained (SQLite and a compact candle store) | | ||
| - | |||
| - | ===== Architecture ===== | ||
| - | |||
| - | * **Go backend** – orchestrates everything: market data, sessions, indicators, the licence check ('' | ||
| - | * **CCXT sidecar (Node)** – exchange connectivity (market data now, order routing later). The same Node process can host the JavaScript strategy runtime, so JavaScript and exchange access share one component; Lua runs embedded in Go. | ||
| - | * **Market data** – WebSocket streams from the exchanges, normalised, kept in a compact candle store and pushed to the frontend over WebSocket; REST for history and backfill. | ||
| - | * **Indicators** – computed in the backend (MA, RSI, MACD, Bollinger, …) and passed to Lightweight Charts as extra series. The same calculation serves charting, backtesting and live sessions – one code path, three contexts. | ||
| - | * **Strategy engine** – user indicators and strategies in Lua or JavaScript, through one shared API ('' | ||
| - | * **Multi-session trading** – a session manager; each session is a supervised worker (strategy + account/ | ||
| - | |||
| - | ===== Security principles ===== | ||
| - | |||
| - | * Exchange API keys are the most sensitive part – they can move funds: encrypted at rest, trade-only keys without the right to withdraw, exchange-side IP allowlisting, | ||
| - | * **Phase 1 is paper trading only** – only public market data is needed, so there are no private trading keys at all in the first phase; private keys and live order routing come later. | ||
| - | * The licence is checked at start and periodically; | ||
| - | |||
| - | ===== Phases ===== | ||
| - | |||
| - | - **Phase 1** – charts and one exchange (read-only), | ||
| - | - **Phase 2** – live trading with risk limits and a kill-switch. | ||
| - | - **Phase 3** – multi-session trading. | ||
| - | - **Phase 4** – user scripting of indicators and strategies (Lua and JavaScript). | ||
| - | |||
| - | ===== Risk and compliance ===== | ||
| - | |||
| - | Automated trading with real funds carries financial risk; this is not financial advice. Strategies must comply with the exchanges' | ||
| - | |||
| - | ===== Decisions (confirmed) ===== | ||
| - | |||
| - | * Charts: Lightweight Charts with an own indicator layer. | ||
| - | * Exchanges: CCXT sidecar. | ||
| - | * Strategy scripting: Lua and JavaScript. | ||
| - | * First phase: paper trading only. | ||