28
Field Programmable Gate Arrays in Finance 14/Oct/2014 ntonio Roldao, Ph.D.

FPGA Applications in Finance

Embed Size (px)

Citation preview

Page 1: FPGA Applications in Finance

Field Programmable Gate Arrays in Finance

14/Oct/2014Antonio Roldao, Ph.D.

Page 2: FPGA Applications in Finance

Presentation Overview

• What are FPGAs• How do FPGAs work• Why are FPGAs in-hype• Where are FPGAs being used• FPGAs in Finance• Summary • Future Vision

Antonio Roldao, Ph.D. 2

Page 3: FPGA Applications in Finance

What are FPGAs?

• Invented in 1985 by Ross Freeman• Re-programmable Digital Device• Equivalent to employing millions of logic

gates• Can be configured in the outside in the “field”

• Able to implement • very simple logic; or • fully featured systems like multi-core-

microprocessors w/ RAM, video, and sound, neural networks, trading systems, …

Antonio Roldao, Ph.D. 3

Page 4: FPGA Applications in Finance

How do FPGAs work?

Antonio Roldao, Ph.D. 4

Page 5: FPGA Applications in Finance

How do FPGAs work: Look-Up-Tables - 1/2

Antonio Roldao, Ph.D. 5

Page 6: FPGA Applications in Finance

How do FPGAs work: Look-Up-Tables - 2/2

LUT

FF Synchronous

Asynchronous

Clock

A

B

Antonio Roldao, Ph.D. 6

Page 7: FPGA Applications in Finance

How do FPGAs work: Routing Fabric

LogicBlock

LogicBlock

LogicBlock

Antonio Roldao, Ph.D. 7

Page 8: FPGA Applications in Finance

How do FPGAs work: Embedded Cores

Antonio Roldao, Ph.D. 8

Page 9: FPGA Applications in Finance

Why are FPGAs in-hype?

Antonio Roldao, Ph.D. 9

Page 10: FPGA Applications in Finance

Why are FPGA in-hype: CPU’s Trends

Antonio Roldao, Ph.D. 10

Page 11: FPGA Applications in Finance

Why are FPGA in-hype: FPGA’s Density

Antonio Roldao, Ph.D. 11

Page 12: FPGA Applications in Finance

Why are FPGA in-hype: FPGA’s FP Capability

Antonio Roldao, Ph.D. 12

Page 13: FPGA Applications in Finance

Why are FPGA in-hype: Better Tools

• Better Integrated Development Environmentsthat detect and flag most common mistakes

• Integrated simulationincluding embeddable probes that can read live FPGA signals

• Faster synthesis and bitstream generationthat can infer standard embedded blocks (e.g.

RAMs/Multipliers)

• Comprehensive libs of commonly used logic blockswith highly optimized designs targeting the specific FPGA

• Hybrid software and hardware methodologiesusing embedded microprocessors (e.g. ARM)Antonio Roldao, Ph.D. 1

3

Page 14: FPGA Applications in Finance

Why are FPGA in-hype: Gartner Hype Cycle

Antonio Roldao, Ph.D. 14

Page 15: FPGA Applications in Finance

Where are FPGAs being used?

Antonio Roldao, Ph.D. 15

Page 16: FPGA Applications in Finance

• Spatial Parallelizable - Monte Carlo, Map-Reduce,

Neural Nets

• Temporal Parallelizable - Monte Carlo, Streaming,

Encryption

• Deterministic - Precise Measurements and

Actuators

• Low Power - Space Probes, Cameras, Hard-

disks

• High Integration - Satellite Systems, F1 Steering

Wheel

• High Throughput - Video Encoding/Decoding,

Filtering

• Customizable - Data-paths, Number Systems, ISAs

• Wire-Speed / Low-Latency - Software Defined Networks,

HFTs

• Architecture Independence

General FPGA Applications

Antonio Roldao, Ph.D. 16

Page 17: FPGA Applications in Finance

FPGAs in Finance

Antonio Roldao, Ph.D. 17

Page 18: FPGA Applications in Finance

Why is speed so important?

• Winner eventually takes it all due to: Positive Network EffectsAntonio Roldao, Ph.D. 1

8

Page 19: FPGA Applications in Finance

Simplified Client-side HFT Platform

Antonio Roldao, Ph.D. 19

Page 20: FPGA Applications in Finance

Simplified Exchange-side Platform

Antonio Roldao, Ph.D. 20

Page 21: FPGA Applications in Finance

1/5 - FPGA Applications in Finance

• Off-loading Network Computations• Checksum calculations• ARP Requests/Replies• UDP packet crafting• TCP packet crafting, sliding window, re-request, throttling

• Protocol Normalization / Transliteration / Tagging / Stamping• Time stamping• Tagging with Unique Identifier• Transliteration from {b}FIX/ProtoBuffers/SBE/ASCII into

binary and vice-versa• Façade for different protocols

Antonio Roldao, Ph.D. 21

Page 22: FPGA Applications in Finance

• Wire Speed Logging• Capture traffic in real-time• Non-intrusive logging• Reactive alerts• Network traffic replay and compare

• Market Data Processing• Manage connections to various data sources• Transliterate and compact data• A/B arbitration• Aggregate multiple feeds into a unified stream• Filter non-subscribed names

Antonio Roldao, Ph.D. 22

2/5 - FPGA Applications in Finance

Page 23: FPGA Applications in Finance

• Rules and Limit Checks• Verify an order is within market ranges• Track and limit exposure in real-time• Verify order complies with regulatory requirements

• Smart Order Routing• Route by lowest latency• Route by best price• Route by increased liquidity• Route by lowest transaction fees• Route by highest historical success rate• Route by a combination of above or any other factor

Antonio Roldao, Ph.D. 23

3/5 - FPGA Applications in Finance

Page 24: FPGA Applications in Finance

• Risk Calculation• Instrument pricing• Scenario building and evaluation• Monte-Carlo simulations• Real-time portfolio / PnL calculations

• Risk Mitigation and Hedging Strategies• Generate alerts for certain risky conditions• React to certain risky conditions• Generate alerts when opportunities for hedging arise• Automatically rebalance portfolios to minimize exposure

Antonio Roldao, Ph.D. 24

4/5 - FPGA Applications in Finance

Page 25: FPGA Applications in Finance

• Matching and Crossing Engines• Sort orders in parallel• Match many and rank trades in parallel• Preemptively calculate crossing results • Generate market data feeds• Reply to both sides of the trade in parallel

• Money Making Engines• Arbitrage strategies• Momentum strategies• Market making strategies• Statistical and pattern-based strategies

Antonio Roldao, Ph.D. 25

5/5 - FPGA Applications in Finance

Page 26: FPGA Applications in Finance

Summary

BASIC INTERMEDIATE COMPLEX

Packet Filtering Various Checks Real-time PnL

Protocol Transliteration Market Data Consolidation Trading Strategies

A/B Arbitration Order Routing Matching Engines

UDP/TCP Off-Loading Risk Calculation

• There are a wide range of applications

• Winner eventually takes it all due to: Positive Network EffectsAntonio Roldao, Ph.D. 2

6

Page 27: FPGA Applications in Finance

Future Vision

Trading-System-on-a-Chip

Antonio Roldao, Ph.D. 27

Page 28: FPGA Applications in Finance

Thank You

http://anton.io @roldao