A fast, high performance, low latency automated trading system built using C++, C and some x86 assembly.
Explore the docs »
Table of Contents
A high performance, low latency high frequency trading system written in C++. Utilizes custom, lock free data structures, custom TCP networking lib, memory allocators, concurrency and several low latency techniques to execute a large amount of concurrent trades, each with a minimal amount of round trip latency.
Built for Linux x86 systems only (some inline x86 ASM is used, and some POSIX system calls and APIs are used too). You can try to run it on WSL if you are on x86 Windows, but I've not tested this.
- C++ (vast majority)
- C (networking code and certain Linux system calls)
- x86 assembly (certain inline portions)
Build with cmake, run tests with ctest to test if everything works. If all good, set env vars and run the binary.
- An x86 based, Linux system. The project will only build and run on this, as I mentioned before due to proprietary system calls and inline ASM. I will try to make this project more portable in the future if I can.
- Trading account on TODO platform with either real funds or mock funds (todo how?)
- cmake
sudo apt-get install cmake
- C++20 capable compiler (use GCC for maximal compatibility). This should be pre installed on Ubuntu, but if not, find the instructions to install it for your distro.
- TODO: steps on setting up a trading account and getting/setting API keys/credentials, haven't decided on a provider yet.
- Clone the repo
git clone https://github.com/nyarosu/hft.git
- cd into the repository, then cd into extern.
cd hft/extern
- Clone the vcpkg repository (package manager used by the project)
git clone https://github.com/Microsoft/vcpkg.git
- Go back to the root repository and create a build directory
cd .. && mkdir build
- Build with cmake (go into the new build directory, generate build files, then use build files to compile the project)
cd build && cmake -S .. -B . && cmake --build .
- Run tests to make sure everything works (be inside build, after running the prior commands)
ctest
- Start the trading system (from inside build)
./bin/HFT
Distributed under the MIT License. See LICENSE.txt
for more information.