ScaleTrade platform¶
High‑performance CFD trading engine with plugins, hooks, and multi‑protocol APIs (REST / TCP / WS / FIX).
This documentation explains concepts, structures, and integration paths.
Main schema:¶
What is ScaleTrade?¶
ScaleTrade is a modular CFD engine designed to be embedded or deployed as a service. The platform exposes: - Server API (in‑process, plugins interface) - External APIs: REST, TCP, WebSocket, FIX - Extensibility via Plugins, Hooks, and Events - Deterministic structures and Return Codes for machine‑friendly automation
Audience
- Integration engineers (CRM, BI, risk, payments)
- Quant/dev teams (strategy execution, monitoring)
- Support and ops (deployments, observability, SLOs)
Quick start¶
- Follow Installation.
- Configure Domain parking → guide/domain.md.
- Enable SSO/CRM if needed → guide/sso.md, guide/crm.md.
- Verify with health / time endpoints in Server API → System.
- Spin up a sandbox (local / VM / container).
- Use minimal configuration from Usage.
- Try REST:
signin,Open Trade,Modify Trade,Close Trade. - Explore TCP API methods for bulk operations.
Copy-ready commands
# docs are built with MkDocs Material
mkdocs serve
# (deploy: `mkdocs build` and publish /srv/www/docs)
Documentation map¶
-
Guides
Getting started, domains, SSO/CRM.
→ Instructions -
Data structures
Canonical DTOs used across APIs.
→ Structures -
Variables
Enums, return codes, connection types.
→ Variables -
Plugins
Features, processing pipeline, debugging.
→ Plugins -
Events & Hooks
Subscribe or intercept engine flow.
→ Events · Hooks -
Server API
In‑process endpoints exposed to plugins.
→ Server API -
External APIs
REST · TCP · WS · FIX for integrations.
→ REST · TCP · WS · FIX
Icons above use the Material icon set that ships with the theme.
API overview¶
REST (HTTP)¶
- Auth: Sign In / Sign Up / Check session
- Trade: Open / Modify / Close
- See REST → Trading
TCP¶
- High‑throughput management: Open/Close/Update, bulk operations, queries
- See TCP → Trading
WS / FIX¶
HTTP verbs in navigation
In the nav you’ll see labels like
<span class="post badge">POST</span> / <span class="get badge">GET</span> —
those are rendered via custom CSS in assets/style.css.
Extensibility model¶
Plugins provide features and processing steps.
Events notify about engine state changes (e.g. OnTradeRequestOpen, OnAccountAdd).
Hooks allow interception / enrichment of the flow (e.g. HookTradeProcessCommission).
flowchart LR
A[Incoming Request] --> B{Hooks?}
B -->|pre| C[Processing]
C --> D{Events}
D -->|emit| E[Plugins]
E --> F[Result/Return Code]
If Mermaid is not enabled in your build, keep this as reference diagram only.
Conventions¶
- Idempotency: prefer PUT/PATCH for updates, avoid side‑effects on GET.
- Time: server time endpoints available in Server API → System.
- Return Codes: see Variables → Return Codes.
- DTOs: request/response schemas live under Structures.
Deprecations
Items marked ❌ in the navigation are deprecated and kept for backward‑compatibility.
Troubleshooting & support¶
Build / deploy
- Local preview:
mkdocs serve - Static build:
mkdocs build→ publish to /srv/www/docs
Where to start?
- New setup → Installation
- Integrate CRM / SSO → CRM · SSO
Links¶
- GitHub: https://github.com/ScaleTrade