XTriBot is a Python-based automated trading bot that scans multiple cryptocurrency exchanges for triangular arbitrage opportunities using the CCXT library.
It detects profitable trading cycles starting and ending in USDT, taking into account fees, tick sizes, and order book depth. Designed for real-time execution, XTriBot can also notify you via Telegram and keeps detailed logs of its operations.
This bot automatically detects and executes triangular arbitrage trades across exchanges like Binance, Kucoin, Okex, and Huobi. It searches for profitable cycles starting with USDT as the quote currency and considers fees, tick sizes, and order book impact.
XTriBot continuously monitors exchanges such as Binance, KuCoin, OKX, and Huobi to:
-
Identify arbitrage loops (e.g., USDT → BTC → ETH → USDT)
-
Calculate potential profits after accounting for fees, slippage, and market constraints
-
Execute trades automatically when thresholds are met
-
Send real-time alerts via Telegram
-
⚡ Multi-Exchange Arbitrage Detection
Scans and compares markets across multiple crypto exchanges -
🔁 Automated Trade Execution
Places orders sequentially for profitable arbitrage cycles -
💸 Fee & Slippage Awareness
Considers trading fees, order book depth, and price rounding -
📈 Real-Time Market Monitoring
Uses live order book data from each configured exchange -
📩 Telegram Notifications
Get alerts for profitable trades and system status -
📝 Comprehensive Logging
Records all trade activity and diagnostics to a local log file
Make sure you have the following installed:
- Python 3.7 or higher
- CCXT library
- python-dotenv
- pandas
- numpy
- python-telegram-bot
-
Clone the repository
git clone https://github.com/yourusername/XTriBot.git cd XTriBot -
Install dependencies: `
pip install -r requirements.txt
-
Copy
config.env.exampletoconfig.env -
Configure your API keys and settings in
config.env
Open config.env and add your API keys, Telegram credentials, and custom settings.
To run the bot:
python tri_arb_bot.pyOnce started,the bot will:
- Scan for arbitrage opportunities across configured exchanges
- Execute trades when profitable opportunities are found
- Send Telegram notifications for successful trades
- Log all activities to
arbitrage.log
Customize behavior in config.env :
- Set minimum profit thresholds
- Define exchange-specific trading fees
- Adjust order update/message intervals
- Configure initial trading capital per exchange
- Enable or disable test mode
XTriBot supports Telegram alerts. To enable:
- Create a Telegram bot via @BotFather
- Get your bot token and chat ID
- Add them to your
config.envfile
This bot is intended for educational and research purposes only. Use at your own risk.
Cryptocurrency trading involves significant financial risk, and you are solely responsible for your trades and API usage.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the license terms.
We welcome contributions to enhance this project! Whether it's improving the model, adding new features, or fixing bugs, your help is greatly appreciated.
To contribute:
-
Fork the repository.
-
Create a new branch.
-
Submit a pull request with your changes.
For inquiries, feedback, or collaboration, feel free to open an issue or reach out via 📧 SANCHIT.