Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Latest commit

 

History

History
86 lines (44 loc) · 4.98 KB

README.md

File metadata and controls

86 lines (44 loc) · 4.98 KB

Examples

Here is a gallery of hand-crafted examples to illustrate the value of such a tool.

Disclaimer: This data was painstakingly created by hand 🤌 to appear quasi-realistic. I am not an artist 🧑‍🎨 nor is this real 🌎 data.

You may want to first check out the legend and perhaps the 30 second primer on microstructure prior.

Example

This example contains 3 different "events" of interest commonly found in the wild:

  1. Event 1: 💸 Erratic valuation
  2. Event 2: 😔 Didn't send order
  3. Event 3: 🚀 Trade-through-the-stack event

examples

Event 1: 💸 Erratic valuation

Here is an example of a valuation gone amuck and leading to bad trades.

erratic valuation 1

The valuation jumped through the best offer and bid and sent crossing/taking/aggressive orders that were filled. This all happened in <2 seconds.

⚠️ IMPORTANT Note ⚠️: You won't get filled at those prices in reality. The matchine engine will provide "price improvement". I didn't feel like re-working the example. Let us both pretend those fills happened at the best bid and offer instead.

Zoom in further via right clicking 🖱️ to see further details 🔎.

erratic valuation 2

Here we zoom in further to the milliseconds timescale to see what is happening.

Zoom in further via right clicking 🖱️ to see further details 🔎.

erratic valuation 3

On the ⏰ microsecond ⏰ timescale, we can start to appreciate what happened....

  1. Our 🤖 trading algo's theoretical value spiked through the offer 3 ticks/levels, causing the algo to send cancels for those 3 levels.

  2. There clearly is also logic for aggressive/taking orders based on this theoretical price. The system sent such a new order and got immediately filled. (Note again it's pratically impossible to get filled at that level and you would have bought a level below.)

  3. The exchange acks from these requests came back serially, probably due to being sent to the same exchange order router or having an order gateway priority queue internally (this varies by exchange architecture).

Now looking at the other blip, we see that the same thing happened where the trading algo sold due to a spike down in valuation.

erratic valuation 4

For a refresher on plot items, check out the legend.

Event 2: 😔 Didn't send order

didn't send 1

In the second event, we see that the trading algo 🤖 was "run over" during a series of trades where both correlated products ticked down. In this situation, a market trade pushed the market down by making the "bid turn offer". This is a common occurence in price point transitions.

The question is: could have the trading algo 🤖 avoided the fill? Did it try to?

Zoom in further via right clicking 🖱️ to see further details 🔎.

didn't send 2

We can also see that the 🤖 trading algo's theoretical valuation for Coin B is responding to something and seems informative (most likely Coin A's pricepoint changes).

Zoom in further via right clicking 🖱️ to see further details 🔎.

didn't send 3

Finally, the picture becomes a little clearer. Coin A's market ticked down ("bid turned offer"). We see that the trading algo's valuation in Coin B did in fact reflect this information, yet... the system did not even attempt to send a cancel/modify request (let alone attempt to tag along and cross Coin B).

This is suspicious, and needs to be investigated further to see if it is a bug 🐛.

Event 3: 🚀 Trade-through-the-stack event

Finally, we examine the 3rd event, where a very large trade occurs in the market. The trade is so large, it exhausts multiple levels in the order book. This is known as a "trade through the stack" or "sweep" depending on who you ask.

trade through the stack

We see that the TTS was first reported in Coin A. The 🤖 trading algo's valuation immediately reflects this information in Coin B's theoretical valuation.

Responding to this change in valuation, the system attempts to cancel it's offer at the Best Offer and send a New Order several levels through the book (likely, an aggressive order). Notice that the exchange rejected both of these requests and later showed that the system was filled in Coin B. We can see later that a TTS also happened in Coin B, likely by the same aggressor as Coin A.

Reporting of events can sometimes come in an on odd order depending on the exchange design. However, it looks like the trading algo's behavior was optimal in this situation - it just wasn't able to successfully act. This is just the cost of doing business.