Labubu Orderbook
An interactive orderbook simulator
### Intro
As I was reading some macro papers and rubber duckying my understanding of order books, I realized I could not explain them simply.
So the goal of this is to give a simple and clear mental model of orderbooks. Paired with this is a quick simulator to aid in understanding: clob.vercel.app
We'll be using Labubus to illustrate market and limit orders, then explore how order books might shape price action.
### Context:
In crypto, the success of Hyperliquid has increasingly popularized Central Limit Order Books (CLOBs). What was once impractical because of latency and gas, on-chain CLOBs became viable with innovations high throughput chains, and popular with high volumes of traders. And with some advances in ZK and clever backend architecture, we can have completely off-chain CLOBs (that's part of what we do at infinityvm.xyz!)
But CLOBs aren't new they're the de facto standard in traditional finance. It's been around since early markets and is how most centralized exchanges (including crypto exchanges) operate.
### Simulator
For experiential learning, try playing with the simulator to see how active market orders eat through layers of liquidity in the order book. Eventually could build this out to include Coinbase data but this is good for now.
### Labubu Orderbook Setup
We can think of an order book as a Labubu marketplace.
- On the left is a line of Labubu-hungry girlfriends
- On the right is a line of opportunistic high school resellers.
In the picture let's pretend that the first girl in line is willing to buy 2 Labubus at $90, the second girl wants to buy 4 Labubus at $80, and the third girl wants to buy 6 Labubus at $70.
The opposite is true for the line on the right. The first reseller is willing to sell 1 Labubu at $110, the second reseller for 3 @ $120, and the third reseller for 5 @ $130.
### Market Buy
Let's say you're looking to buy your fourth Labubu because you love your girlfriend so much. You would go to the resell line (right) and buy it from them at the lowest price - say $110. Congrats, you've placed your first market buy order!
Now looking at the available market, the next available Labubu is listed at $120. Since no one is willing to buy at $110 anymore, you'd need to buy at the next price level, pushing the price upwards. By buying Labubus, you've removed limit sell orders from the book, consuming liquidity and pushing the price up. This is called "hitting the ask" with aggressive buy orders.
### Market Sell
Now let's say you got into an argument because she found out you still have a box of letters from your ex and now wants you to sell 3 Labubus. You'd approach the line of girls (left) and sell at the highest price.
You sell 2 Labubus to the first girl at $90 and the last Labubu at $80. Your average "fill price" is thus (2 * 90 + 1 * 80) / 3 = $86.67. Didn't make as much as you were hoping, you experienced some price slippage.
Similar to the last example, your market order has impacted the price - this time downwards. By hitting the bid, and eating the top level of liquidity buyer liquidity, you've shifted the price downwards.
### Limit Sell
As a final straw, your girlfriend finds out that the last Labubu was actually from your ex! She gives you an ultimatum, "If you really love me, you'd throw it out the window!"
You promise to toss it the next morning. But just for fun, join at the end of the line of resellers, listing the Labubu for a ridiculous price of $10,000.
Overnight a whale enters the market.
The Labubu gets bought. She dumps you.
But now you're rich.
You acted as a liquidity provider, placing a passive limit sell.
### Interesting Notes
While I'm still a novice of the markets, I have seen some pretty interesting ideas around order books. Namely how it seems to drive price action.
In a Youtube video @Krafer built a market simulator purely off of an orderbook and random trades around the mid-price. And somehow he found that well-known technical analysis patterns (like a bull flag or cup-and-handle) emerged even in this randomized environment.
Strongly analogous to male astrology, no idea why it works but maybe it actually works. Honestly, I'm not sure what to make of this, maybe just that randomness is a good model for the market though not exactly.
Supporting this idea is the paper "Re-Appraising Intraday Trading Patterns" which suggests that many intraday behaviors can be explained not by information asymmetry, but by endogenous liquidity provision. Basically claiming that price moves because of actions in the book, not actual informational edge.
If this is true it might explain the findings in the YouTube video, but still feels like just a convenient oversimplification of the complex workings of global finance
### Conclusion
Hopefully, this helped or challenged your understanding of order books. Appreciate any feedback as I'm still developing my understanding.



