Re:Show HN: A first project in Rust – in-memory order book
by logicchains on Saturday February 22, 2020 @06:00AM
(#22390386)
Not the OP, but presumably to minimise the amount of jumping around in memory. Best orderbook is a small matrix, if you can get away with it (for trading you often don't need the whole orderbook, or at least don't need the whole thing on the hot path, but for an exchange obviously there's less scope for approximations).
[ Parent
| on HN ]
Re:Show HN: A first project in Rust – in-memory order book
by evdubs on Saturday February 22, 2020 @06:29AM
(#22390476)
Assuming you're doing some sort of strategy where the order book is important, like market making or hedging another position, it seems kind of dangerous not to keep a full book, no? If the market starts to move and your limited book starts to represent a lack of bids or offers, that doesn't seem to be a great idea at first glance.
Re:Show HN: A first project in Rust – in-memory order book
by logicchains on Saturday February 22, 2020 @06:40AM
(#22390511)
In a product with a big tick size, to react to any single event you'll probably only need to know what's happening on the top two or three price levels (as it's super unlikely to move more than that in a single market data update). Then after reacting you can update your big, slow book and generate a new fast, approximate book from that, in preparation for the next market data update.
Re:Show HN: A first project in Rust – in-memory order book
by evdubs on Saturday February 22, 2020 @06:57AM
(#22390568)
I agree that can make sense for something like ES, but what about crypto? ;)
Edit: maybe non-penny-pilot options trading > $3 are a better example of a product with a large tick size.
Re:Show HN: A first project in Rust – in-memory order book
by logicchains on Saturday February 22, 2020 @07:03AM
(#22390585)
For crypto the network overhead and variance in the exchange probably makes the performance of the order book implementation irrelevant, unless it's horribly slow, haha.
Re:Show HN: A first project in Rust – in-memory order book
by evdubs on Saturday February 22, 2020 @07:08AM
(#22390597)
Some exchanges are doing colocation and are investing resources to greatly improve matching engine performance. It's become a little better than when they were all written in Ruby and hosted on a cheap cloud service.
Re:Show HN: A first project in Rust – in-memory order book
by logicchains on Saturday February 22, 2020 @07:21AM
(#22390640)
Ah that's cool. Still I'd be surprised if there's many that are deterministic enough that a microsecond or two of response latency makes a big difference.