Cross-exchange lead-lag trading system: Binance USD-M Futures as the lead book,
target exchange (MEXC by default) as the lag book. Generates long/short
signals when mid prices diverge beyond configured thresholds.
Default mode: paper trading. Live execution requires explicit multi-step arming.
.
├── LICENSE MIT license
├── SECURITY.md Secret handling and pre-push checklist
├── pyproject.toml pytest configuration
├── trading_bot/ Main application
│ ├── .env.example Copy to .env — never commit .env
│ ├── config.yaml.example Copy to config.yaml — never commit local config
│ ├── main.py Entry point
│ ├── core/ Config, models, risk
│ ├── engine/ Signal, spread, execution engines
│ ├── exchanges/ WebSocket feeds and MEXC executors
│ ├── dashboard/ Local web UI
│ ├── storage/ SQLite tick recorder
│ ├── telegram/ Optional notifications
│ └── tests/ Unit tests
└── todo.md Strategy notes (optional reading)
Requirements: Python 3.11+
git clone git@github.com:sssaturX/hft.git
cd hft
python -m venv .venv
source .venv/bin/activate
pip install -r trading_bot/requirements.txt
cp trading_bot/.env.example trading_bot/.env
cp trading_bot/config.yaml.example trading_bot/config.yaml
python -m trading_bot.mainDashboard: http://127.0.0.1:8080
Smoke test (30 seconds):
python -m trading_bot.main --duration-seconds 30| File | Purpose |
|---|---|
trading_bot/config.yaml |
Symbols, filters, paper/live settings (local, gitignored) |
trading_bot/.env |
Secrets and runtime mode overrides (local, gitignored) |
See trading_bot/README.md for full documentation on signal filters, paper trading, and live MEXC arming.
pytestNo live exchange connectivity required.
The following are gitignored but may exist locally — do not force-add them:
trading_bot/.env— MEXC API keys, WEB tokens, Telegram tokenstrading_bot/config.yaml— your personal trading parameterslogs/,data/,exports/— runtime artifactshft_project_no_db/— local working copycross_exchange_paper/— separate sub-project
Read SECURITY.md before your first push.
MIT — see LICENSE.
This software is for educational and research purposes. Cryptocurrency futures trading involves substantial risk. The MEXC WEB-token execution path uses unofficial reverse-engineered endpoints. Authors are not responsible for financial losses, exchange bans, or API changes.