Skip to main content
Menu

In Network ML project: LOBIN

LOBIN: In-Network Machine Learning for Limit Order Books

Work by Xinpeng Hong, Changgang Zheng, Stefan Zohren and Noa Zilberman 

In the algorithmic trading industry, there are two types of market participants. One specializes in high-frequency trading (HFT) approaches while using quick and simple decision logic. The other utilizes powerful machine learning (ML) algorithms, while paying with increased decision's latency. In-network ML provides algorithmic trading a midway solution: using machine learning, while at the same time providing low latency. 

A common problem in algorithmic trading is predicting future price movements from market microstructure signals. While directly using order-based market messages (MBO) doesn't achieve satisfactory forecasting performance, electronic limit order books (LOBs) were shown to provide good prediction performance based on ML models. For a particular stock, a real-time LOB is constructed from unmatched limit orders that are predetermined with specific prices.  

LOBIN studies the application of in-network ML to market prediction using LOBs. It is a proof of concept for future price movement prediction by maintaining and updating LOBs in the programmable data plane based on high-frequency market data feeds. 

 LOBIN was implemented in P4 on BMv2 and on Intel Tofino/Tofino2 switch-ASIC, with its workflow shown in the figure below. Historical market data feeds are used to train an ML model on a server, using LOB-based features. Using Planter, the trained model is mapped to the data plane, and table entries are generated. For a given stock, when a new order is received, LOBIN updates the LOB and extracts features from it for ML inference.

LOBIN provides high prediction accuracy (compared with a server-based benchmark), while achieving microsecond-scale latency.