+ All Categories
Home > Documents > Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA...

Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA...

Date post: 30-Aug-2018
Category:
Upload: phamcong
View: 217 times
Download: 0 times
Share this document with a friend
16
Milan Dvorak Systems for Algorithmic Trading in FPGA [email protected] Petr Kastovsky [email protected]
Transcript
Page 1: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

Milan Dvorak

Systems for Algorithmic Trading in FPGA

[email protected] [email protected]

Page 2: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• Czech university spin-off company

• FPGA team formed in 2000

• Company established in 2007

• 40+ employees

• Key focus Hardware acceleration

Electronic trading

FPGA solutions

Network monitoring and security

Company

Page 3: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• Evolution of trading

Open out cry

Electronic

High frequency

Ultra low latency

First come first serve

• High Performance Computing

Derivatives trading

Monte Carlo simulations

Motivation

Page 4: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• Programmable hardware

Flexibility of software

Performance of hardware

• Key features Field programmable

Massive parallelism

Deterministic

Low latency (sub us)

• Drawbacks

Hardware designer expertise required

Time to market longer compared to software

FPGA technology

Page 5: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• NIC (Network Interface Card) + FPGA chip

• Plugged in to a commodity box

• Provided as a whole solution

• 1G/10G/40G/100G interfaces

FPGA cards

Page 6: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

How can financial applications and

trading systems benefit from the FPGA

technology?

FPGA & trading

Page 7: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• Message Filtering

According to message type

• Symbol filtering

According to symbol ID

• Data Distribution

Multiple CPU cores, multiple

network interfaces

• Data decoding&normalization

Unified message format

• Book handling

Convert order updates to price level updates

• Reduced CPU load on machines

Content aware filtering

Page 8: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• Complex price computation in SW (Options pricing)

• Fast order execution engine in FPGA

SW feeds current desired prices to the FPGA

FPGA sends order as soon as matching price is on the book

• Complete tick-to-trade in hardware

• Wire-to-wire sub-microsecond latency

Fast order execution

ticks

FPGA order execution

SW – price computation

Exchange

prices

orders

trade reports

Page 9: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• Goal: evaluate all derivatives upon change in underlying price (stock → options)

• In SW – sequential task (few cpu cores)

• In FPGA – hundreds of symbols evaluated in parallel

Parallel evaluation

Stockprice

update

ticks

Option evaluation

Option evaluation

Order sending

.

.

.

orders

Option evaluation

Option evaluation

Page 10: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• FPGA can be used to accelerate generic computation

• Monte Carlo simulation:

1. Load desired function to the FPGA

2. Let FPGA evaluate hundreds of points in parallel

3. Get the results

• Parallel execution – faster than CPU

• Lower power consumption

FPGA acceleration

Page 11: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

How to program the FPGA with

user-defined function?

FPGA programming

Page 12: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• SW code – HLL (High Level Language)

C/C++, Java, Python …

Flexible, easy to use

• HW code – HDL (Hardware Description Language)

VHDL, Verilog

Difficult to learn, longer time-to-market

FPGA programming

Page 13: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• New ways to work with FPGAs

• HLS – High Level synthesis

Use HLL to write code for FPGA

Convert C/C++ to VHDL

Several commercial tools

• MathWorks tool chain

Convert your Matlab function to FPGA design

Simulink, Fixed-Point Designer, HDL Coder and HDL Verifier

• Complete solution with FPGA

FPGA is abstracted from the user

SW API calls to configure&use the FPGA

FPGA programming

Page 14: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• All-FPGA trading solution

Lowest latency possible

Easy-to-use

• Deliverables

FPGA card, box

Software API, firmware framework

• Complete tick-to-trade processing

• User defined trading strategy

MathWorks tools or HLS

TradeCOPE

Page 15: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

• FPGA

Flexible, high performance, deterministic low latency

• Use cases of FPGA + algorithmic trading

Content aware filtering

Low-latency order execution

Highly parallel symbol evaluation (options)

Computation acceleration (Monte Carlo)

• FPGA programmability

HLS – High level synthesis (C/C++ → FPGA)

MathWorks (Matlab → FPGA)

Whole solution (TradeCOPE)

Summary

Page 16: Systems for Algorithmic Trading in FPGA · Milan Dvorak Systems for Algorithmic Trading in FPGA dvorak@invea.com Petr Kastovsky kastovsky@invea.com

INVEA-TECH a.s. U Vodárny 2965/2616 00 Brno, Czech Republicwww.invea.com

High-Speed Networking Technology Partner

Milan Dvořák

[email protected]


Recommended