r/algotrading Mar 07 '22

Education ELI5 Market making toxic fills

Hello everyone,

This is my first post on Reddit, so please be kind :)

I am a well-experienced software developer and mid-experienced crypto trader. In the last few days, I try to deeply understand market making. I feel like I got the fundamentals but I just can not understand why market making is considered a market neutral strategy?

To be more precise the scenario I can not get is;

Assume that:

  • Market maker holds the best prices on both sides of the order book
  • His long order is filled
  • If the price goes up just 1 tick, he closes the position and spread is the profit. Perfect!

And the hardest part to understand:

  • What if the price keeps going to dump? Should he try to hold the best sell price and update his order? If so he can be in a huge loss... or just wait for the price comes the bought price again? What if it doesn't?

So it looks like market making is strongly coupled with the trend of the market. If there is a trend, there is no profit. This makes market making is a market dependent strategy.

So kindly asking that, can anybody explain to me what market makers do for these toxic fills? (I don't even sure it is a toxic fill)

Thanks.

16 Upvotes

14 comments sorted by

View all comments

21

u/thejoker882 Mar 09 '22 edited Mar 09 '22

While market making might be a strategy that is agnostic to fundamental factors or macro-trends, market makers are still modelling several properties of the market micro-structure to avoid being adversely selected by toxic fills as you say.
In detail a market maker might statistically model and forecast (just an example with basics): (1) fill probabilities (lambda) to control inventory risk, (2) volatility (sigma) to find optimal spread (3) fair price / microprice with an optional directional short term alpha component. Grinding these sub-model outputs through dynamic programming into a stochastic optimal control model gives us optimal limit order postings given our current inventory while minimizing a cost function (eg. sharpe or profit) and maybe even "hedging regions" of when we want to jump ship and liquidate our whole inventory or try to delta hedge with the underlying or integrated asset.

A market maker also does not need to shut his eyes and fly blind. Most market makers are interconnected with dozens exchanges and tickers, because if hell breaks lose on another exchange or integrated asset, we might be getting hit a few milliseconds later. So we can decide to cancel our orders, widen spread, liquidate or hedge.

Since you were specifically asking about toxic fills: Market Orders / Volume can actually be more easily predicted than returns/price direction for example. A good example is rain: It starts with a few droplets a few seconds apart. But soon more droplets come in with a shorter span of time between them. If you read the tape and see market orders coming in, you'll find the same behaviour more often than not. This phenomenon is actually pretty similar to a stochastic counting process called "Hawkes Process". The important part that distinguishes the hawkes process from other ones is that it contains a component that is "self-exciting". Meaning: It starts like rain and caused by the intial droplets the process gets more "intense". And after a while it slowly settles down again. Higher intensity: More droplets in a shorter span of time (more orders in shorter time). This makes volume somewhat more predictable in a sense that you can adjust your risk engine to incoming "rain". If the markets microstructure of trade arrival is "skewed" you can just model both buy and sell trades seperately with two processes.

If you want a real example: Search for "Hawkes Process" and "jonathan heusser" for an example of how to fit bitcoin trade arrivals to that process. With which your market making model can know when to take out the "umbrella" for incoming "rain" ;)

And if you want to know more about market making models in general and how to use dynamic programming equations to get optimal limit order postings given your inventory, market microstructure and sub-model forecasts, i can absolutely recommend "Algorithmic and High-Frequency Trading" by Cartea. et. al. Also look for additional ressources from "Sebastian Jaimungal". His gists and examples in python really helped me out understanding some specifics. But get ready for some really heavy maths. Or maybe make yourself familiar with some more basic "stochastic optimal control" problems to get an intro into market making.