+ All Categories
Home > Documents > In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. •...

In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. •...

Date post: 05-Oct-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
16
In - Memory Techniques Low - Latency Trading Kevin A. Goldstein R.
Transcript
Page 1: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

In-Memory Techniques Low-Latency Trading

Kevin A. Goldstein R.

Page 2: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

2

Kevin Goldstein

• Live in NYC• +18 years on Wall St.• Extensive low latency development for market makers, LL trading

shops, Banks…• Extensive performance tuning for distributed trading applications-Head G2 architecture Hedgefund Management System -Head of dev USA at FlowTraders

• Sr. Solutions Architect at Neeve Research • Frequent speaker at Industry Events - (10/25 NYC IMC Meetup)- (11/14 NYC IMC Meetup HTAP)

Page 3: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

3

Agenda

• Introduce trading systems• Top concerns for trading systems• IMC applied to trading systems• Q & A

Page 4: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

4

Trading System at a Glance:

Pre-Trade Risk

Positions

Post-trade

Hedger

P&L Calc

Best Ex.

Pricing Engine

LOPER

Config engine

OATS

Pricing engine

Arbitrage engine

Drop copierTrade reconciliator

Page 5: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

5

Order router

Basic Order Manager

Client-IN Market-OUT

Market-INClient-OUT

Page 6: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

6

Top Three Requirements for Trading Systems

Performance -Low 5-20 microseconds

Consistency-Perform the same with 10K mps as with 100K mps-1mic std deviation for I2E

Reliability-Message Reliability-Survive process and machine failure

Complexity

Priority

OR

Ingress Egress

Page 7: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

7

IMC Applied to Data Management for Performance

BEFORE:

Data

Compute

Data

Transactions

Does not Scale

Does not Perform

Complex to Author

Store

Query

Process

Capture, Refine

Choke point

Complex queries

Multiple queries

Very large volumes of data required

Complex components

Page 8: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

8

Memory Latency

L1 Cache ~1ns

L2 Cache ~3ns

L3 Cache ~12ns

Remote NUMA Node ~40ns

Main Memory ~100ns

Random SSD Read 4K 150μs

Data Center Read 500μs*

Mechanical Disk Seek 10ms

Non Starters For Performance We’re Talking About!

Sources: https://gist.github.com/jboner/2841832http://mechanical-sympathy.blogspot.com/2013/02/cpu-cache-flushing-fallacy.html

All State in Memory All The Time!

MEMORY ORIENTED COMPUTING!

IMC Applied to Data Management for Performance

Page 9: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

9

Ownership

Publication

Consumption How do you consume the data in the most efficient manner possibly

Data gravity

Responsible for updating any consumers

IMC Applied to Data Management for Performance

Page 10: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

10

Function(Stateful)

Data

Data(In-Motion)

Refine (aggregate, transform) and route data in motion

Transactions

Store full data in-memory.

Function co-located with its private state.

Capture Data from Source

Store

Process

Capture, Refine, Route

Capture, Refine

Data at rest

Data in motion

AFTER

IMC Applied to Data Management for Performance

Page 11: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

11

Mkt data

Algo [A-M]

Algo [N-Z]

OR [A-M]

OR [N-Z]’

OR [A-M]’

OR [N-Z]

Ref Data (A)Owner Publishes

Data Ownership – when things change, I’m responsible for updating registered clients

à No pull for reference data

• Reduce the amount of noise to deal with

• Opens the door for efficient HA

• Much smaller memory foot print

• faster access times & smaller machines

IM Applied for Reliability

Page 12: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

12OR-[N-Z]

OR-[A-M]

OR-QQQ,NVDA

OR-AAPL

OR-GOOG

OR-AMZN

OR-AMZN

OR-GOOG

OR-AAPL

OR-QQQ,NVDA

OR-[A-M]

OR-[N-Z]

High volume

groups

Low volum

e groups

Benefits:• Symbology

flexibility

• Hardware risk

• Scaling flexibilit

IM Applied for Reliability, Performance and Consistency

Primary OR’s Backup OR’s

Page 13: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

13

IM Applied for Performance

AVOID GC

• Pooling is the way to go• Leverage Off-heap memory• Actively manage live objects• Warmups are key

CPU is bound to memory cleanup

Page 14: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

14

Warmups & POOLINGWarmups are a must:

Not warmed up

warmed up

Page 15: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

15

IM Benefits We Capitalize On

üMessage DrivenüStatefulüMulti-AgentüZero Garbage

üZero LossüFully Fault TolerantüHorizontally ScalableüUltra Performance

15

Page 16: In-Memory Techniques Low-Latency Trading - PD… · • Live in NYC • +18 years on Wall St. • Extensive low latency development for market makers, LL trading shops, Banks… •

Questions?

[email protected] @neeveresearch@kevgol0

www.neeveresearch.com


Recommended