TaiwanQuant's Newsletter

TaiwanQuant's Newsletter

Share this post

TaiwanQuant's Newsletter
TaiwanQuant's Newsletter
Quant Infrastructure #5 - Order Executor
Copy link
Facebook
Email
Notes
More

Quant Infrastructure #5 - Order Executor

A guide to robust order tracking in a trading infrastructure.

TaiwanQuant's avatar
TaiwanQuant
Jun 24, 2023
∙ Paid
9

Share this post

TaiwanQuant's Newsletter
TaiwanQuant's Newsletter
Quant Infrastructure #5 - Order Executor
Copy link
Facebook
Email
Notes
More
Share

In the previous article of the main series, we looked at robustly tracking our trading inventory and built an Inventory component for our Quant Infrastructure.

In this article, we look at tracking and managing orders and build an OrderExecutor for this purpose. Orders require a different approach from the Inventory because we actively control them as opposed to passively taking information from the exchange.

The technique we will show is commonly known as orders-in-flight. The implementation we will build will be simple and robust to errors, both theoretical and those encountered in practice during real trading.

We will address common problems such as duplicate orders and ghost orders and ensure that our order tracking is consistent with our inventory — which we covered in the previous article from the Inventory component’s side.

For consistency, I assume the Inventory component is similar to what we described in the previous part of the series.

Today’s article is free to read. As per usual, the complete source code is attached at the end of the article for paying subscribers.

We will use straightforward Rust to allow readers using other languages to follow and adapt the code to their language of choice relatively easily if they wish.

The article is exchange-agnostic and the techniques shown work on most if not all CEX exchanges such as Binance, Bybit, etc. I have not tested them with any DEXes, however — though I suspect they work there just as well.

Let’s begin.12

TaiwanQuant’s Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

Keep reading with a 7-day free trial

Subscribe to TaiwanQuant's Newsletter to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 TaiwanQuant
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More