Skip to content

A C++ program for parsing PCAP files from exchanges to reconstruct MBO order books and identify trading signals or arbitrage opportunities.

Notifications You must be signed in to change notification settings

pysojic/MBOOrderBookParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MBO PCAP Parser

MBO PCAP Parser is a high-performance C++ application designed to parse PCAP files from the Exchange (current implementation is based on the CBOE Future Exchange), reconstruct MBO order books, and can be used to identify arbitrage opportunities and trading signals. It is optimized for macOS and Unix-like systems and uses CMake for build management.

Features

  • Parses PCAP data captured from the exchange network.
  • Reconstructs MBO (L3) order books.
  • BBO Tracking.
  • Order book visualizer.
  • Arbitrage finder (still WIP).
  • Can exports reconstructed data for further analysis.
  • Highly optimized for performance with -O3 and -march=native compiler flags.

Requirements

  • macOS or Unix-like system.
  • GCC or Clang (optional).
  • libpcap (PCAP library for parsing packet data).
  • CMake (minimum version 3.14).
  • BOOST Libraries (version 1.85+)

Build Instructions

Prerequisites

  1. Install GCC or Clang.

    • GCC example:
      brew install gcc
    • Clang example (optional):
      brew install llvm
  2. Install CMake:

    brew install cmake
  3. Install libpcap (if not already installed):

    brew install libpcap
  4. Install Boost C++ Libraries (https://www.boost.org/):

    brew install boost

Compilation

  1. Clone the repository
git clone https://github.com/your-username/MBOOrderBookParser.git
cd MBOOrderBookParser
  1. Create a build directory:
mkdir build
cd build
  1. Configure the project with CMake:
cmake ..
  1. Build the project:
cmake --build build

Run the Program

After a successful build, the executable will be generated in the build directory. Run the following line to get the program usage:

build/MBOOrderBookParser --help

Project Structure

MBOOrderBookParser/

├── build/ Build directory (generated after CMake)

├── include/

│   ├── CBOEPcapParser.hpp       # Pcap Parser 

│   ├── cfepitch.h               # CFE pitch specs

│   ├── Config.hpp               # Configuration of program options

│   ├── cxxopts.hpp              # Program options parser lib

│   ├── DataExporter.hpp         # Exporter of data (csv, bin, etc)

│   ├── MessageInfo.hpp          # Information struct

│   ├── Order.hpp                # Individual order class 

│   ├── OrderBook.hpp            # Individual order book class 

│   ├── OrderBookManager.hpp     # Order books manager class

│   ├── OrderStore.hpp           # Order objects store class

│   ├── StopWatch.hpp            # Timer

│   ├── Symbol.hpp               # Ticker symbol struct

│   └── ThreadPool.hpp           # Thread pool class (not being used in current implementation)

├── ref/ 

│   └── CFE Multicast PITCH Spec v1.2.8 2024-08-09.pdf        # CFE Pitch specs 

├── src/

│   ├── CBOEPcapParser.cpp       # Pcap Parser implementation

│   ├── DataExporter.cpp         # Exporter of data (csv, bin, etc) implementation

│   ├── main.cpp                 # Program entry point

│   ├── Order.cpp                # Individual order class implementation

│   ├── OrderBook.cpp            # Individual order book class implementation

│   ├── OrderBookManager.cpp     # Order books manager class implementation

│   ├── OrderStore.cpp           # Order objects store class implementation

│   ├── StopWatch.cpp            # Timer implementation

│   └── ThreadPool.cpp           # Thread pool class implementation

About

A C++ program for parsing PCAP files from exchanges to reconstruct MBO order books and identify trading signals or arbitrage opportunities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published