CryptoQuant AI is a local-first quantitative cryptocurrency trading dashboard for research, monitoring, backtesting, and optional OKX execution. It combines a React/Vite frontend with an Express/TypeScript backend, local SQLite persistence, OKX market/account integrations, Zhipu GLM-assisted summaries, and risk controls for strategy evaluation.
This project is for research and personal operations. It is not financial advice. Use demo trading first, keep API permissions limited, and never expose this service directly to the public internet without proper hardening.
- OKX market data, account balance, positions, order history, and order submission support.
- Demo and live OKX credential paths with a local encrypted credential store.
- Regime-based strategy engine with trend breakout, mean reversion, macro risk gating, TP/SL construction, and risk kill switch behavior.
- Shadow trading, walk-forward backtesting, portfolio return analytics, execution diagnostics, reliability views, and audit trails.
- Local SQLite and JSON persistence for trades, state, risk events, and research snapshots.
- React dashboard with legacy embedded panels for existing operational workflows.
- Node.js 24 or newer.
- npm 10 or newer.
- Git.
- Optional OKX API credentials for live or demo trading.
- Optional Zhipu GLM API key for AI-assisted summaries.
- Optional FRED API key for macro data.
- Optional local HTTP/SOCKS proxy if your network cannot reach OKX directly.
git clone https://github.com/YOUR_GITHUB_USERNAME/cryptoquant-ai.git
cd cryptoquant-ai
npm ci
copy .env.example .envOn macOS or Linux, use:
cp .env.example .envEdit .env and replace every YOUR_..._HERE value with your own local credentials. Leave optional services blank if you do not use them.
Start the local development server:
npm run devThen open:
http://localhost:3000
Build for production:
npm run build
npm run start:prodRun validation:
npm run lint
npm test
npm run buildWindows users can also run 一键启动.bat from the project root. The script checks Node/npm, installs dependencies, creates .env from .env.example when needed, runs type checks, and starts the app.
The app reads configuration from .env. Important variables include:
ADMIN_USERNAME,ADMIN_PASSWORD,SESSION_TTL_HOURSfor local operator login.APP_SECRETfor local encrypted credential storage.OKX_API_KEY,OKX_SECRET_KEY,OKX_PASSPHRASEfor OKX live mode.OKX_DEMO_API_KEY,OKX_DEMO_SECRET_KEY,OKX_DEMO_PASSPHRASEfor OKX demo mode.EXCHANGE_PROXY_URLfor optional proxy routing, for examplehttp://127.0.0.1:10808.ZHIPU_API_KEYand model settings for AI-assisted summaries.FRED_API_KEYfor macro data.SMTP_USER,SMTP_PASS,SMTP_TOfor optional email notifications.
Never commit .env, data/, logs, SQLite files, screenshots containing account information, or encrypted credential stores.
- Start with OKX demo trading before live trading.
- Restrict exchange API keys to the minimum permissions needed.
- Do not put API keys in frontend code.
- Use a long random
APP_SECRETbefore saving credentials in the local vault. - Keep this service behind local authentication and do not publish it as an unauthenticated public web app.
- Review generated orders, leverage, take-profit, and stop-loss behavior before enabling live execution.
MIT. See LICENSE.