This guide explains how to set up and run the Crypto Grid & Arbitrage Bot. Follow the steps below to get started.
-
Python Version:
- Ensure you have Python 3.8 or higher installed on your system.
-
Install Required Libraries:
- Install the necessary Python libraries by running the following command:
pip install -r requirements.txt
- Install the necessary Python libraries by running the following command:
-
Set Up API Keys:
- Create a
.envfile in the project directory and add your Binance and KuCoin API keys as follows:BINANCE_API_KEY=your_binance_api_key BINANCE_API_SECRET=your_binance_api_secret KUCOIN_API_KEY=your_kucoin_api_key KUCOIN_API_SECRET=your_kucoin_api_secret KUCOIN_PASSPHRASE=your_kucoin_passphrase
- Create a
- The dashboard provides a web interface to monitor trade history and opportunities in real-time.
- Start the dashboard by running:
python [dashboard.py](http://_vscodecontentref_/0)
- Open your browser and navigate to
http://localhost:8000to access the dashboard.
- The main script executes the arbitrage strategies and listens to real-time price data.
- Start the main script by running:
python [main.py](http://_vscodecontentref_/1)
- This script will:
- Fetch real-time price data from Binance and KuCoin.
- Execute Grid Trading and Statistical Arbitrage strategies.
- Log trades and send updates to the dashboard.
-
Test the WebSocket connections for Binance and KuCoin to ensure real-time data fetching works correctly.
-
To test Binance WebSocket:
python [test_websocket.py](http://_vscodecontentref_/2)
-
To test KuCoin WebSocket:
python [test_kucoin_websocket.py](http://_vscodecontentref_/3)
- Ensure that your
.envfile contains valid API keys for Binance and KuCoin. - The bot can run in simulation mode by setting
TEST_MODE = Trueinmain.py. - Logs are saved in
binance_websocket.logandkucoin_websocket.log. - Trade history is saved in
trade_log.csvfor future analysis.
This project is licensed under the MIT License.