Skip to content

About

real-time cryptocurrency market microstructure analysis and paper-trading engine with C++ signal processing and a Java control plane.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

Microstructure Alpha Engine

A real-time cryptocurrency market microstructure analysis and paper-trading project. The C++ core consumes public order-book and trade streams, derives flow, regime, and price-structure signals, evaluates a breakout-confirmation strategy, and records simulated trade outcomes and diagnostics. A Java/Spring Boot control-plane service is included for ongoing development.

Status: Research and development software. The trading engine currently uses paper trading; it is not a production brokerage or exchange execution system.

What it does

  • Connects to public market-data WebSocket streams from Binance and Bybit.
  • Builds market snapshots from best bid/ask prices and quantities and tracks trade flow.
  • Computes market features such as spread, order-book imbalance, recent price movement, market regime, and breakout state.
  • Evaluates a breakout-confirmation strategy and applies persistence and execution-quality filters.
  • Simulates positions in a paper-trading engine, including exits and configurable risk parameters.
  • Publishes trade events over ZeroMQ and writes trade results, test summaries, and signal diagnostics to CSV files.

The repository is organized into core-engine/ (C++17, CMake) and control-plane/ (Java 21, Spring Boot, Maven). The control-plane module uses PostgreSQL/JPA and ZeroMQ dependencies; its runtime setup and API are evolving, so consult its source before integrating it.

Requirements

  • CMake 3.20 or newer and a C++17 compiler
  • vcpkg or another way to provide the C++ dependencies: ixwebsocket, nlohmann-json, and cppzmq/ZeroMQ
  • The platform-specific bcrypt library required by the current CMake configuration
  • For the control plane: JDK 21, Maven (or the included Maven Wrapper), and PostgreSQL if using its persistence features
  • Network access to the configured public market-data endpoints

Build and run the core engine

From the repository root, configure the C++ engine using the package manager/toolchain appropriate for your platform. For example, with vcpkg installed and its toolchain file available:

cmake -S core-engine -B build \
  -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Release

Run the resulting core_engine executable from the repository root (or configure your working directory appropriately). The current implementation runs a time-bounded market-data test, writes output under core-engine/test_runs/, and publishes paper-trade events on ZeroMQ TCP port 5555.

The exact dependency installation and linker configuration vary by operating system. Check core-engine/CMakeLists.txt and the vcpkg manifest/configuration in core-engine/ for the current project setup. Do not expose the ZeroMQ publisher to untrusted networks without adding suitable network controls.

Build and run the control plane

cd control-plane
./mvnw test
./mvnw spring-boot:run

On Windows, use mvnw.cmd instead. Configure database connection settings through Spring Boot configuration/environment variables before using database-backed functionality. See control-plane/src/main/resources/ for the current configuration.

Output

The core engine produces per-run CSV files for trade results, test summaries, and signal diagnostics. The executable logs generated paths and summary metrics at the end of a run. Treat this output as experimental research data, not evidence of future performance.

Development

  • C++ engine sources: core-engine/com.krd/src/
  • C++ build definition: core-engine/CMakeLists.txt
  • Java control plane: control-plane/src/
  • Maven project definition: control-plane/pom.xml

See CONTRIBUTING.md for contribution guidance and CODE_OF_CONDUCT.md for community expectations. Please report security issues privately as described in SECURITY.md.

Risk disclaimer

This project is for educational, research, and software-development purposes only. It does not provide investment, financial, legal, or tax advice, and it does not guarantee the accuracy or profitability of any signal, strategy, simulation, or result. Cryptocurrency markets are volatile and may result in substantial or total loss. Paper-trading results do not represent actual execution, and may not account for all fees, slippage, liquidity constraints, latency, or exchange behavior. Do not connect this software to a live account or use it to make financial decisions without independent review, testing, and appropriate safeguards. You are responsible for your use of the software and compliance with applicable laws and exchange terms.

License

Distributed under the MIT License.

About

real-time cryptocurrency market microstructure analysis and paper-trading engine with C++ signal processing and a Java control plane.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages