A real-time monitoring system for tracking price spreads and funding rates between Centralized Exchanges (CEX) and Decentralized Exchanges (DEX).
The system consists of three core modules:
- Frontend Web - React + TypeScript web application
- Backend API - FastAPI backend service with uv dependency management
- Background Worker - Celery background task system
- Frontend: React 18, TypeScript, Vite, Ant Design, ECharts
- Backend: Python 3.11+, FastAPI, Pydantic, uv (dependency management)
- Worker: Celery, Redis, ccxt, hyperliquid-python-sdk, uv (dependency management)
- Database: ClickHouse (time-series data), Redis (caching)
- Deployment: Docker, Docker Compose
- ✅ Real-time price monitoring across multiple CEX and DEX platforms
- ✅ Automatic spread calculation (CEX-CEX, CEX-DEX, DEX-DEX)
- ✅ Funding rate monitoring
- ✅ Arbitrage opportunity detection
- ✅ Historical data querying and visualization
- ✅ WebSocket real-time data streaming
- ✅ Customizable alert configuration
- Docker & Docker Compose
- Python 3.11+ (for local development)
- Node.js 18+ (for local development)
- uv (for backend development)
# Clone the project
git clone <repository-url>
cd trade-bot
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Access services
# Frontend: http://localhost:5173
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docscd backend
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
# Run the server
uv run uvicorn src.main:app --reload --host 0.0.0.0 --port 8000cd worker
# Install uv if not already installed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
# Run Celery worker
uv run celery -A src.celery_app worker --loglevel=info
# Run Celery beat (in another terminal)
uv run celery -A src.celery_app beat --loglevel=infocd frontend
npm install
npm run dev- Binance
- OKX
- Bybit
- Gate.io
- Bitget
- Uniswap V3
- PancakeSwap
- SushiSwap
- Hyperliquid - Decentralized perpetual exchange with on-chain order book
- BTC/USDT
- ETH/USDT
- BNB/USDT
- SOL/USDT
- ARB/USDT
After starting the services, access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
trade-bot/
├── backend/ # FastAPI backend service (uv managed)
├── worker/ # Celery background tasks (uv managed)
├── frontend/ # React web application
├── shared/ # Shared code and types
├── database/ # Database configuration and migrations
└── docker-compose.yml
Copy .env.example to .env and configure:
# ClickHouse
CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=9000
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# API
API_HOST=0.0.0.0
API_PORT=8000MIT