A high-performance cryptocurrency trading bot written in C++20, featuring real-time WebSocket integration, flexible strategy implementation, and hybrid paper/real trading execution modes. It leverages Zig for specific performance-critical components.
- Hybrid Execution: Seamlessly switch between Paper Trading (simulated) and Real Trading.
- Exchange Integration: Native support for Coinbase Advanced Trade WebSockets.
- Strategies:
- HODL: Configurable buy/sell logic based on percentage dips and gains.
- Extensible
Strategyinterface for custom logic.
- Performance:
- C++20 codebase.
- Zig integration for optimized math and order book operations.
- Asynchronous I/O using Boost.Asio.
- Data Management: Local storage of market data sequence and ticker history.
adaptors/: Exchange connectivity (WebSocket clients).common/: Shared utilities (Math, JSON, Time, Serialization).executors/: Order execution logic (Paper vs. Real).strategies/: Trading algorithms (HODL, Simple).traders/: Core orchestration connecting adaptors, strategies, and executors.zig/: Zig modules for performance-critical math and data structures.
This project uses Nix for a reproducible development environment.
nix developInside the Nix shell:
- Configure:
prepare(runs CMake). - Build:
build(compiles the project). - Test:
make test(runs GoogleTest suite). Note: Runbuildbefore testing if source changed.
Comprehensive API documentation for the project is generated using Doxygen directly from the C++ source code comments and deployed to GitHub Pages.
The latest API Reference documentation is available on GitHub Pages.
To generate and view the Doxygen documentation locally:
- Build Doxygen Documentation:
This command will run Doxygen and generate HTML files in the
make docs
cmake.bld/Linux/full/doc_doxygen/htmldirectory. - Serve Locally:
Open your web browser and navigate to
make serve-docs
http://127.0.0.1:8000(or the address shown in the terminal) to view.
See TODO.md for the phased development plan and doc/NEXT_STEPS.md for the longer-term vision.
This project has a companion Python trading bot — trading-bot-flake — which implements the strategy research, backtesting, and risk management layers. The long-term goal is for Python to handle strategy/research and C++ to handle execution (see NEXT_STEPS for details on this architecture).
Documentation on technical concepts, design decisions, and contribution standards:
- Build System: Architecture of our CMake setup (Unity Builds, Mold/LLD, C++20 Modules).
- Coding Style: Enforced naming conventions, formatting, and static analysis rules.
- Floating Point Comparisons: Why and how we use hybrid epsilon comparisons for currency math.