FPGA for High Frequency Trading
Overview
FPGA based HFT Accelerator's consist of the following components.
- A feed parser which
- Understands the Exchange packet formats and protocols.
- Has a Exchange specific, user defined, filter for stocks and transactions of interest.
- Extracts the fields of interest from the Packet and
- Sends the packet along with the extracted data for processing to the next layer
- A Trading Algorithm which
- Looks for patterns,
- Monitors the price table and
- Triggers Trades
- An Orderbook which
- Keeps track of every Open Order for the selected Stocks.
- Maintains the Price/Quantity Table.
- A Trading Executor which on getting a trade trigger:
- Creates a Trade message as per the exchange format.
- Sends the packet to the exchange
Packet Parser
Most Exchanges use their own propritery message formats e.g. MTBT (NSE), OUCH (Nasdaq, SGX), ITCH (Nasdaq), FIX
These packets are delivered using different encapsulation formats like SoupBinTCP and MoldUDP64
On Receiving a packet from the exchange the packet parser performs the following action,
- Decapsulates the messages grouped together in the packet.
- Checks for missing packets and raises an exception if a packet is received.
- Extracts the fields from the packet.
- Checks whether the fields matches the criteria set by the user.
- Deletes the unwanted packets
- Sends the filtered packets for processing by the Algorithmic Trading Block
- Updates the order book for the Token
Algorithmic Trading.
These are statistical functions, which Make Buy Sell decisions based on multiple factors.
Order Executor.
The order Executor takes a set of parameters(Token, Price, Quantity, Trade Type etc...) from the Algorithmic Trading Unit, created an order in the format required by the Exchange and sends the Order packet on the Network.
Commodity and specialized components of an FGPA Based High Frequency Algorithmic Trading system
Dyumnin Semiconductors, library of components for FPGA Based High Frequency Algorithmic trading system consists of Commodity and Specialized components.
Commodity components
Commodity components are components built using public domain information like Exchange Specification, FPGA Vendor Documentation, Ethernet and Networking Standards etc. Commodity components are leveraged across multiple customer projects.
Example commodity components are:
- The Packet Parser, and Order Executor blocks are Exchange and market specific components, with little or no need for customiation.
- The network interface logic are specific to the FPGA Card and are common across all exchanges for a given Card.
- FPGA Implementation of standard stastical functions.
Specialized components
Specialized components are components build based on customer specification. There is zero reuse of Specialized components across customer projects.
Example:
- The trading algorithm is custom built as per customer requirement.
The Orderbook Manager and Price table are components present in all customer projects They may be derived from the same code base. They may need fine tuning as per the customer requirements
Checklist for FPGA based HFT Accleration.
- Identify the Exchange and Market of interest.
- Define your trading algorithm and other Requirements
- Get feed specification document and Sample feed for your Market.
- Call Dyumnin Semiconductors to implement your FPGA HFT Accleration solution.
- Buy and install an appropriate FPGA Card(Alveo, Exanic, Aldec etc...) on the development machine
- Test and Deploy the solution provided by Dyumnin Semiconductors.