Skip to content

bolgac/arbitrage-alert-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Crypto Arbitrage Alert Bot

A Python‑powered cryptocurrency arbitrage system that asynchronously fetches live prices from multiple exchanges, compares them against user‑defined thresholds, and detects profitable opportunities in real time. The bot logs all activity, stores detailed data for analysis, and can optionally send instant alerts via Telegram and Discord. It features a user‑friendly CLI menu for control and monitoring, plus an integrated Flask dashboard for web‑based visualization.


πŸ“Œ Features

  • Asynchronous Arbitrage Engine
    • Collects prices from multiple exchange APIs concurrently using aiohttp.
    • Provides fast, non‑blocking data flow with an asyncio loop.
  • Configurable & Modular Architecture
    • All settings are managed through the config.ini file.
    • Symbols, thresholds, intervals, and notification options can be easily customized.
  • Data Persistence & Logging
    • Arbitrage opportunities, price data, and successful trades are stored in JSON files.
    • Errors and events are logged in ./logs/arbitrage.log.
  • Notification System
    • Real‑time alerts via Telegram and Discord integration.
    • Test messages and Chat ID retrieval available through the CLI menu.
  • Interactive CLI Menu
    • User‑friendly menu to start/stop arbitrage, view data, update settings, and test notifications.
    • Dashboard control directly accessible from the CLI.
  • Flask Dashboard Integration
    • Web‑based panel runs in the background as a separate process.
    • Start, stop, and status checks can be managed via the CLI menu.
  • Graceful Shutdown & Control
    • Threads and processes can be safely terminated.
    • Arbitrage loop is controlled with the thread_start flag.

πŸš€ How It Works

The bot continuously retrieves live cryptocurrency prices from multiple supported exchanges using asynchronous requests. Each symbol is compared against user‑defined thresholds to detect arbitrage opportunities. When a valid opportunity is found, the system logs the event, saves detailed price data, and optionally sends real‑time notifications via Telegram or Discord. All activity is stored for later analysis, while a CLI menu and optional Flask dashboard allow users to start, stop, and monitor the bot without interrupting ongoing background tasks.


πŸ§ͺ Menu Options

Upon running, you'll see a CLI menu:

Option Description
1 Start Arbitrage Check
2 Check Status / Stop Bot
3 View Arbitrage Data (Opportunities, Success Logs, Price Logs)
4 Telegram / Discord Operations
5 Config Operations
6 Dashboard (Flask Web Panel)
7 Exit the Program

πŸ“Š Dashboard Preview

Arbitrage Monitor

Arbitrage Monitor Screenshot
Tracks arbitrage percentage over time with interactive chart and symbol filtering.

Latest Opportunities

Latest Opportunities Table
Displays the most recent arbitrage opportunities with exchange details and timestamps.


βš™οΈ Configuration (config.ini)

[Exchange Details]
Binance = https://api.binance.com/api/v3/ticker/price?symbol=SYMBOL
Binance_Status = 1
Mexc = https://api.mexc.com/api/v3/ticker/price?symbol=SYMBOL
Mexc_Status = 1
KuCoin = https://api.kucoin.com/api/v1/market/orderbook/level1?symbol=SYMBOL
KuCoin_Status = 1
Coinbase = https://api.exchange.coinbase.com/products/SYMBOL/ticker
Coinbase_Status = 1
OKX = https://www.okx.com/api/v5/market/ticker?instId=SYMBOL
OKX_Status = 1
Gate.io = https://api.gateio.ws/api/v4/spot/tickers?currency_pair=SYMBOL
Gate.io_Status = 1
BingX = https://open-api.bingx.com/openApi/swap/v2/quote/bookTicker?symbol=SYMBOL
BingX_Status = 1
Bitget = https://api.bitget.com/api/v2/spot/market/tickers?symbol=SYMBOL
Bitget_Status = 1

[Arbitrage Settings]
SYMBOLS = DOGE-USDT,ETH-USDT,BTC-USDT
ARBITRAGE_THRESHOLD = 1.0, 0.5, 1.5
TIMER_INTERVAL = 5
PRICES_SAVE = 1
ARBITRAGE_SAVE = 1
ARBITRAGE_SUCCESS_SAVE = 1
MULTI_PROCESSING = 1

[Database]
MAIN_FOLDER = database
ARBITRAGE_JSON = arbitrage.json
ARBITRAGE_SUCCESS = arbitrage_success.json
PRICES = prices.json

[Telegram]
TELEGRAM_BOT_TOKEN = <your_token>
TELEGRAM_CHAT_ID = <your_chat_id>
NOTIFICATION_STATUS = 0

[Discord]
DISCORD_WEBHOOK = <your_webhook_url>
NOTIFICATION_STATUS = 0

🌐 Supported Exchanges

  • Binance
  • Mexc
  • KuCoin
  • Coinbase
  • OKX
  • Gate.io
  • BingX
  • Bitget

Enable or disable any exchange in the [Exchange Details] section of config.ini.


πŸ“¦ Requirements

  • Python 3.7 or higher
  • Dependencies:
    • requests
    • configparser
    • Flask
    • Flask-SocketIO
    • aiohttp

Install all dependencies with:

pip install -r requirements.txt

πŸ“ Folder Structure

β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── config.ini
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ arbitrage.json
β”‚   β”œβ”€β”€ arbitrage_success.json
β”‚   └── prices.json
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── index.html
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ arbitrage_handler.py
β”‚   β”œβ”€β”€ dashboard_handler.py
β”‚   β”œβ”€β”€ data_handler.py
β”‚   β”œβ”€β”€ data_handler_SQL.py [DISABLED]
β”‚   β”œβ”€β”€ noti_handler.py
β”‚   β”œβ”€β”€ exchange_handler.py
β”‚   └── telegramChatID_handler.py
β”œβ”€β”€ logs/
β”‚   └── arbitrage.log            
β”œβ”€β”€ requirements.txt
└── main.py

🧠 Planned Features

  • Data conversion to different formats
  • More support for cryptocurrency exchanges.
  • Real‑time price streaming via WebSocket APIs (lower latency, continuous updates)

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


🀝 Contributing

Feel free to fork this project, submit PRs, or suggest features via GitHub Issues!


πŸ™ Support This Project

If this bot helps you save time or profit from arbitrage, consider showing some ❀️ to support its further development:

πŸ’– Donate

  • USDT (TRC20): T9zmkRHR49PKNgi2GvFReWzoX6mxvXwCwQ
  • BTC: 3FiGD5moqSctBY93h11H3TvPncWLCe5up5
  • Ethereum (ERC20): 0xac25c934e64a95ba38a5ca2c8ca149c8bf13eaa3
  • TRX (TRC20): T9zmkRHR49PKNgi2GvFReWzoX6mxvXwCwQ

🧑 Become a Sponsor

Get early access to premium features and sponsor-only tools.
πŸ“¬ Contact via GitHub or email below for sponsor tiers.


πŸ“¬ Contact

  • GitHub Issues – for bugs and feedback
  • Email – bytearchsoft@gmail.com (for business inquiries or sponsorships)

About

A Python-based cryptocurrency arbitrage bot that compares prices across multiple exchanges to detect and log arbitrage opportunities in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors