Libtrading, an ultra low-latency trading connectivity library for C and C++.
C Makefile C++
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with libtrading:master.
Latest commit ba2500a Aug 18, 2016 @penberg Merge "FAST: 64-bit signed integers may consume up to 10 bytes in a s…
…tream" from Marat

"A signed integer that takes N bytes in a stream is at least
7 * (N - 1) bits long. Therefore it must not take more than
10 bytes in the FAST stream. There are cases when an integer
may take exactly 10 bytes.

mandatory int64 field = -9223372036854775807 is decoded as
0x7F 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x81"
Failed to load latest commit information.
data/micex Moscow Exchange FAST test data Aug 14, 2013
include/libtrading Merge "Option to keep FIX sequence numbers" from Denis Oct 21, 2015
lib FAST: 64-bit signed integers may consume up to 10 bytes in a stream Aug 17, 2016
tools Add compatibility header to 'fix_common.c' Feb 25, 2016
.gitignore ICE ( FIX 4.2 Order Server dialect Jun 19, 2015
.travis.yml Add python-yaml to Travis CI environment Nov 11, 2013 Update FIX known issues list Nov 7, 2012
LICENSE Switch to the 2-clause BSD license Jan 6, 2014
Makefile Fix typo Feb 25, 2016 Merge remote-tracking branch 'upstream/master' Jul 19, 2015
TODO Update TODO May 16, 2013
libtrading-config.c Use EXIT_SUCCESS and EXIT_FAILURE where possible. May 23, 2015
requirements.txt Add 'requirements.txt' for Python packages Jan 17, 2014


Build Status

Libtrading is an open source API for high-performance, low-latency trading applications. It implements network protocols used for communicating with exchanges, dark pools, and other trading venues. The API supports FIX, FIX/FAST, and many proprietary protocols such as ITCH and OUCH used by NASDAQ.


  • C API
  • High performance, low latency
  • FIX dialect support
  • SystemTap/DTrace probes


Install prerequisite packages:


$ apt-get install pkg-config libxml2-dev libglib2.0-dev libncurses5-dev \
    python-yaml libevent-dev


$ yum install zlib-devel libxml2-devel glib2-devel vim-common ncurses-devel \
    python-yaml libevent-devel


$ brew install libevent glib pkgconfig
$ pip install pyyaml

Then run:

$ make install

You can also run the test harness:

$ make check


To measure FIX engine performance locally, start a FIX server:

$ ./tools/fix/fix_server -m 1 -p 7070
Server is listening to port 7070...

and then run the FIX client latency tester against it:

$ ./tools/fix/fix_client -n 100000 -m order -p 7070 -h localhost
Client Logon OK
Messages sent: 100000
Round-trip time: min/avg/max = 15.0/16.8/129.0 μs
Client Logout OK



Protocol RTT (μs)

The following above were obtained by running Libtrading messaging ping-pong tests on a 4-way Intel Haswell 3.60 GHz CPU running Fedora 21 with Linux 3.19.7-200. The processes were pinned to separate physical cores and the numbers include time spent in the Linux TCP/IP stack.

FIX engine round-trip time frequency plot for the above looks as follows:


Copyright (C) 2011-2014 Pekka Enberg and contributors

Libtrading is distributed under the 2-clause BSD license.


  • Denis Ivaykin
  • Marat Stanichenko
  • Jussi Virtanen