Skip to content

NikithaKunapareddy/Cryptocurrency-Arbitrage-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Cryptocurrency Arbitrage Bot (C++)

A comprehensive C++ application that simulates a cryptocurrency arbitrage trading environment with portfolio management, trade logging, and real-time simulated market operations.


✨ Key Features

  • 🔄 Multi-Exchange Simulation: Trade across Binance, Coinbase, Kraken, and more
  • 💰 Portfolio Management: Track your cash and crypto balances (start with $10,000 virtual cash)
  • 📈 Arbitrage Detection: Finds and executes profitable buy/sell opportunities between exchanges
  • 🧾 Trade Logging: Every trade is recorded and can be exported to CSV
  • 📊 Performance Statistics: See your best, worst, and average trades, plus your current portfolio
  • ⚙️ Configurable Fees & Thresholds: Set your own trading fee rates and minimum profit requirements
  • 🖥️ Interactive CLI: Menu-driven console application for easy navigation
  • 🛡️ Error Handling: Prevents invalid trades, negative balances, and invalid input

📋 Project Structure

Cryptocurrency-Arbitrage-Bot/
├── main.cpp            # Program entry and CLI
├── Exchange.h          # Exchange class declaration
├── Exchange.cpp        # Exchange class implementation
├── ArbitrageBot.h      # ArbitrageBot class declaration
├── ArbitrageBot.cpp    # ArbitrageBot class implementation
├── .github/
│   └── copilot-instructions.md  # Copilot custom instructions
├── .vscode/
│   └── tasks.json      # VS Code build/run tasks
├── LICENSE             # Project license
└── README.md           # Project documentation

🏗️ Architecture

Core Classes

  1. Exchange Class
    • Manages individual exchange information (name, prices)
    • Supports price updates and retrieval
  2. ArbitrageBot Class
    • Detects arbitrage opportunities
    • Manages portfolio (cash, coin balances)
    • Handles trade execution, logging, and statistics

🛠️ Requirements

  • C++ Compiler: GCC 4.8+ or Visual Studio 2015+
  • C++ Standard: C++17 or later
  • Operating System: Windows, Linux, or macOS

🚀 Getting Started

Compilation

Windows (using g++)

g++ -std=c++17 main.cpp Exchange.cpp ArbitrageBot.cpp -o arbitrage_bot.exe

Linux/macOS

g++ -std=c++17 main.cpp Exchange.cpp ArbitrageBot.cpp -o arbitrage_bot
./arbitrage_bot

Visual Studio

  • Create a new C++ console project
  • Add all source/header files
  • Build and run (Ctrl+F5)

Running the Application

  • Execute the compiled program
  • Navigate using the menu options:
    • Run arbitrage round
    • Show trade log
    • Set min profit threshold
    • Set fee percent
    • Reset bot
    • Export trade log to CSV
    • Show statistics
    • Exit

💡 Example Output Structure

--- Cryptocurrency Arbitrage Bot Simulation ---
Options:
1. Run arbitrage round
2. Show trade log
3. Set min profit threshold
4. Set fee percent
5. Reset bot
6. Export trade log to CSV
7. Show statistics
8. Exit
Choose: 1
Arbitrage: Buy BTC on Binance at $123.45, sell on Kraken at $125.67. Net Profit (after fees): $2.10
Total simulated profit: $2.10

⚡ Key Features

  • Portfolio Simulation: Realistic cash and coin tracking
  • Trade Logging: Exportable to CSV for analysis
  • Statistics: Best/worst/average trade, balances
  • Configurable: Fees and thresholds
  • Robust Error Handling: Prevents invalid trades

🎯 Future Enhancements

  • Add more coins and exchanges
  • Simulate network latency
  • Implement order types (market, limit)
  • Add historical price tracking and charts
  • Multi-user support
  • GUI interface
  • Technical analysis indicators

🚀 Advanced Feature Ideas

  • 🌐 Live Data Integration: Connect to real crypto APIs for live price feeds (e.g., Binance, Coinbase)
  • 🧠 AI/ML Trading Strategies: Integrate simple machine learning models to predict price trends or optimize arbitrage
  • 📊 Graphical Portfolio Dashboard: Add a simple GUI or generate charts (using libraries like matplotlib-cpp or exporting to CSV for Excel)
  • 🏦 Multi-User Support: Allow multiple simulated users with their own portfolios and trading histories
  • ⏱️ Real-Time Simulation: Use threads to simulate real-time price changes and trading
  • 📝 Order Book Simulation: Simulate order books for each exchange for more realistic trading
  • 🔔 Notification System: Alert when a big arbitrage opportunity is found
  • 🏅 Achievements/Badges: Gamify the experience with achievements for profit milestones

📚 Documentation & Presentation Ideas

  • Add more visuals (ASCII art, diagrams, or screenshots of output)
  • Include a “Demo” section with a GIF or video (if possible)
  • Write a “Why This Project is Unique” section in your README

🤝 Contributing

  • Fork the repository
  • Create a feature branch (git checkout -b feature/AmazingFeature)
  • Commit your changes (git commit -m 'Add some AmazingFeature')
  • Push to the branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

📄 License

This project is open source and available under the MIT License.


👨‍💻 Author

Created as a demonstration of object-oriented programming concepts in C++ for cryptocurrency trading simulation.

Author: NikithaKunapareddy
GitHub: @NikithaKunapareddy


🌟 Get Involved & Happy Trading!

If you enjoyed this project or found it useful, give it a ⭐ on GitHub, share your feedback, and feel free to contribute new features! 🚀💡

Stay curious, keep coding, and may your (simulated) trades always be profitable! 📈🪙

Releases

No releases published

Packages

No packages published

Languages