Production-ready trading terminal for crypto futures across 6 exchanges. Real-time data, spread arbitrage, auto-trading from Telegram signals, and a modern dashboard.
Showcase: sssaturX.github.io/farm · Code license: All Rights Reserved
Source is visible for portfolio review. You may not copy, modify, deploy, or reuse this code without written permission.
Product tour (autoplay): sssaturX.github.io/farm/#demo · GIF: portfolio/assets/product-tour.gif
| Overview | Trade | Spread |
|---|---|---|
![]() |
![]() |
![]() |
- 6 exchanges: MEXC, Gate.io, Bitget, BingX, Bybit, Binance
- Multi-account — add multiple accounts per exchange
- Unified dashboard — balances, positions, PnL in one place
- Manual trading — open/close positions from the dashboard with margin or volume control
- Auto-trading — execute spread signals from Telegram channels (
#TICKER Long MEXC Short GATE,#TICKER aligned) - Spread signals — real-time arbitrage opportunities across exchanges
- WebSocket prices — MEXC, Gate for low-latency quotes
- WebSocket positions — MEXC, Gate, Bitget for live PnL
- Volume Spike — unusual activity detection (rvol, z-score, imbalance, microburst)
- 6 exchange connectors — Binance, Bybit, MEXC, Gate, Bitget, BingX
- O(n) min/max spread — ultra-low latency, array-based price cache
- Threshold & signal engines — open/close signals via NATS
- Enterprise arbitrage — real-time DEX vs CEX across multiple blockchains
- Token registry, risk engine, spread & signal engines
- Enable with:
docker compose --profile dexcex up -d
┌─────────────┐ HTTPS ┌─────────┐
│ Browser │◄──────────────►│ nginx │
│ (Dashboard)│ └────┬────┘
└──────┬──────┘ │
│ WebSocket │
│ (prices, positions, │
│ trade results, alerts) │
▼ │
┌─────────────┐ ┌──────▼──────┐
│ ws-service │◄─── NATS ───►│ api │
└─────────────┘ │ (node-service)│
▲ └──────┬──────┘
│ │
│ positions, prices, │ orders, positions,
│ results, alerts │ accounts, auth
│ │
┌──────┴──────┐ ┌──────▼──────┐
│ NATS │ │ key-service │
│ (cluster) │ │ (KMS) │
└──────┬──────┘ └──────┬──────┘
│ │
│ order requests │ decrypt credentials
▼ ▼
┌─────────────┐ ┌─────────────┐
│trading-worker│ │ PostgreSQL │
│ (executes) │ │ Redis │
└─────────────┘ └─────────────┘
| Service | Purpose |
|---|---|
| api | REST API, auth, accounts, positions, orders, WebSocket to exchanges |
| key-service | Decrypts exchange credentials (API keys) for trading-worker |
| trading-worker | Consumes orders from NATS, executes on exchanges |
| ws-service | Proxies NATS (prices, positions, results, alerts) to dashboard WebSocket |
| pnl-engine | Trades + user stats (win rate, net PnL) |
| tg-listener | Telegram signals → open/close via NATS |
| spread-engine | HFT spread detection across 6 exchanges |
| frontend | React/Vite dashboard (Cactus Edge UI) |
| Exchange | REST | WebSocket (prices) | WebSocket (positions) |
|---|---|---|---|
| MEXC | ✅ | ✅ | ✅ |
| Gate.io | ✅ | ✅ | ✅ |
| Bitget | ✅ | — | ✅ |
| BingX | ✅ | — | — |
| Bybit | ✅ | — | — |
| Binance | ✅ | — | — |
- Docker & Docker Compose
- Node.js 18+ (for local dev)
Copy examples (never commit real secrets):
cp .env.example .env
cp node-service/.env.example node-service/.env
cp node-service/accounts.example.json node-service/accounts.jsonFill required values in .env:
JWT_SECRET=<32-byte hex>
MASTER_ENCRYPTION_KEY=<32-byte hex>
KMS_INTERNAL_TOKEN=<64-char hex>Generate secrets:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"docker compose up -d --build- Dashboard: http://localhost
- API health: http://localhost/api/health
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3030
docker compose --profile dexcex up -dDashboard at /api/dexcex/ via nginx proxy.
- Ticker —
#TICKERorTICKER_USDT - Long —
Long+ exchange (e.g.Long MEXC) - Short —
Short+ exchange (e.g.Short GATE)
Example:
#PEPE | Spread: 5%
🟢Long MEXC
🔴Short GATE
Message: #TICKER aligned
farm/
├── farm-spa/ # React/Vite dashboard (Docker frontend)
├── node-service/ # API + legacy dashboard + tg-listener
├── services/ # key-service, trading-worker, ws-service, …
├── spread-engine-hft/ # Spread HFT pipeline
├── dexcex-scanner/ # DEX-CEX arbitrage (optional)
├── portfolio/ # GitHub Pages showcase site
├── nats-eventbus/ # NATS cluster config
├── nginx/ # Reverse proxy
├── monitoring/ # Prometheus, Grafana
└── docs/ # Architecture, audits, publish checklist
- Portfolio publish checklist — public repo + X/Twitter
- WebSocket connections — MEXC, Gate, Bitget flows
- Spread HFT Architecture — low-latency design
- Volume Spike verification — unusual activity
- Production audit — checklist before deploy
All Rights Reserved. See LICENSE.
This is a source-available portfolio showcase — not an open-source license. Viewing on GitHub does not grant rights to use, copy, modify, distribute, or deploy the software.


