@AutoVentureGr If an order is partially filled, it stays as Maker. Any cancel/replace of an order changes it arrival window.
An order can be reduced in size and it retains the same arrival window.
I recently published Tidemark (https://t.co/opRjANApW9), a cool new batch auction market design.
Prior to finishing Tidemark, I went quite deep into thinking about batch auctions and market design. Along the way, I put out one other mechanism and had two batch auction designs that had to be left on the cutting room floor.
Of the ones that didn't make it, there were some pretty cool and interesting ideas to them so I thought it'd be worthwhile to walk through a bit of that journey.
For all of the mechanisms I worked on, a lot of the work along the way centered around a few questions:
- How can a market tell who the market makers are based upon their behavior? Is it possible to do so without past account data and only the current state of the orderbook?
- How can a trader's behavior be priced/rewarded based upon the value it is adding/taking from a given market?
- Is there some sort of market design that would lead to tighter spreads and more size as compared to alternatives?
Mechanism #1: Snapshot Fees (link: https://t.co/laEBC9rVB9)
This was a fee design for batch auctions. It was inspired by this line from Jump Crypto's DFBA post: "Makers pay fees but instead of being fixed bps, is a fixed fraction of how far their order price is from midpoint"
I wanted to explore what that might look like. The core constraint that I made for myself was this: only look at the current state of order book for setting fees, do not look at past account data or volume. Instead of using a pure midpoint, I used a double-side liquidity weighted midpoint called the Measured Price (M). Any trader that had double sided liquidity on book would have that weight contribute to setting what this M was (which should be more accurate than simple midpoint regarding what the theoretical price was). Then the fee you paid was based upon how far you were from it (factoring in distance of your orders on other side of book as well). Any order that was purely one sided paid full rate.
Snapshot Fees was ok as a mechanism, not amazing, but a good start for this process. After creating it, the main issue I ran into was this: How to actually reward makers? Is there a way to have them earn fees? This wasn't really possible in Snapshot Fees and so this line of thinking led me to the next mechanism.
Mechanism #2: Urgency Priced Batch Auction aka UPBA, never published
UPBA was a full brand new batch auction design. It even had its own distinct order types and matching logic.
All of the thinking was around: how to make a market that is conducive for providing liquidity/market makers. The main rub I had with batch auctions was this: makers lose out on flow when incoming taker flow nets against each other. Could there be a way to compensate this lost potential earnings?
To get there, I did the following:
- Split the book into two specific order types: Market Makers and Priority.
- A Market Maker order is only active on the book when it has equal notional value on opposite side of book. Thus, Market Makers are specifically for those that provide double sided liquidity.
- The second order type is Priority order.
- Priority orders can match each other and Market Maker orders. Market Maker orders can only match priority orders and not each other.
- At a given price level, priority orders fill first.
- Since MM orders cede priority at a given level, they get compensated for this based upon their contribution to M (Measured Price).
- To qualify, a MM needs to quote tight and with size. This is what improves their contribution to M. Then when netting occurs or an order fills ahead of you, you get a kickback.
- MM orders also get some fee share for direct matching vs. Priority orders.
This model switched up the idea a bit of what a market maker's role is. In this model, it was to provide the foundational liquidity for a market and then have normal trading activity flow on top of it.
A lot of work went into making sure there were no loopholes where someone could post a MM order and earn shares while only being a directional trader.
On the Priority order side, there was also a decaying order fee: an urgency fee. Priority orders would have a fee that would decay over time while resting on book and then flip negative (and then they would earn fee share). It was meant to represent the decay of informational value of an order over time. And the decaying fee (and flipping negative) was meant to create an opportunity cost to re-pricing and make liquidity sticky. To get these fee shares, you just had to be patient. It wasn't required to quote both sides of the book unlike for the Market Maker order type.
Conceptually, a lot of what UPBA was thinking about centered around the idea of markets as being a place where information and urgency are traded. Some orders have more urgency. Some have less. A maker with perfect double side liquidity has very low urgency. An order resting on the book for a while has proven to have low urgency. An order that just entered and filled had high urgency. What the design was doing was trying to price urgency and reward non-urgency.
UPBA had some pretty good ideas to it. But the main issue I ran into was this: orders really need to be encrypted for this to work. If a maker can see another maker's orders, it can place its orders at slightly better prices so as to ensure it has more M influence and thus get more rewards.
For all of these designs, the work had been for the purposes of an L1 I was building that would have a native exchange on it. Requiring encrypted orders would severely limit throughput (probably 10% of throughput as compared to unencrypted based on my estimates), so this made the whole design a no go.
I was quite bummed about this tbh, but I let the design go and went back to the drawing board.
Mechanism #3: Flow Priced Batch Auction aka FPBA (also unpublished)
For this design, I dropped the idea of only looking at the current state of the book for determining fees. Instead, I opened up to the possibility of having some form of stateful tracking. So no Measured Price (M) this time.
So stepping back and thinking about makers, I realized there are two stateful features of them:
- They trade both sides of the book
- They absorb flow
Both can be tracked. A few sub-mechanisms came about from this:
- Escrowed fees. In FPBA, if you have an order that fills, your fee goes into escrow and you can earn it back if you fill on the other side of book within a certain time frame. Every time you pay a fee on a fill, you gain some time on your escrow clock up to a limit. Let's say your buy order fills and you pay $5 in fees. That goes into escrow and it has a timer on it. Do another buy fill, more goes into escrow and it adds more time to it (up to a limit). Then if let's say your ask fills and you pay $5 in fees, that and the other $5 fee (from the bid) come back. So the basics of it are, if you are filling on both sides of the book for a given market, your net fee rate comes pretty close to zero.
Then there were some other sub-mechanisms that were definitely work in progress. Basics of them were:
- All orders paid a small fee.
- If your order pushed the price more, that fee scaled up a bit.
- All these fees went into a pot for the market.
- If you absorbed flow, you got points.
- Points were converted to these fee rewards at end of day. It had some logic on cutoffs and thresholds for distribution.
Most of the ideas in FPBA weren't fully fleshed out. I realized there were better possible alternatives along the way, but it got me thinking about having some sort of stateful element to a market. This opened me up to the possibility of considering last window's closing state as a reference point for fees in this window.
Then came Tidemark.
I actually called it Maker Rewarded Batch Auction initially but dropped that name. Tidemark is simpler in design than the other batch auction designs. Still has some slight added complexity relative to standard batch auction design, but I think it's well earned.
Tidemark is stateful, but much less stateful than FPBA, as it only looks at the last window's best bid and best ask to figure out where to draw the line in the sand for who is maker or taker. It inherits a bit of the idea of paying for urgency, but an order can only pay a fee on its first window. After that, it's free and earns a share of the fee against any order it matches against. Paying a fee on first window is not universally applied to all orders, it depends where the order is placed on the book.
While the other mechanisms were more of me figuring things out and trying out different ideas, Tidemark feels more settled. It mostly seems like there is just parameters to optimize but the core overall seems solid.
Some things I learned:
- LLMs can be helpful for this but there are limits. Let's say you have an initial idea for a design, we'll call it version 1. Version 1 has elements A, B, C in it and you're working out this idea D. You discuss with LLM, it gives you back version 2. It has: A, C, D, E in it. So you lost something in the design and gained something you didn't intend. This can happen a lot and sneak in in subtle ways and then you got to back the whole thing up and put E aside and then figure out where things stand. Other times, you won't fully notice these shifts, particularly as a design gets complex. Other times, E is now super interesting and so you start to work through it now, and then a few turns later, you realize, wait, B is gone, wtf, and have to rework your entire mental model.
- It's easier for me to work through a design by just building it as if it were a production thing and coming against real issues. This is what I did with Tidemark. Had very clear defined specs in markdown with the rules, then just built it in rust, committing along the way. Changes to spec got actual commit, not just some state mutation via chat with LLM. Much easier to track for me.
- It's generally pretty fun to just tease out these designs and try things from all sorts of different angles and see what's good and what's not.
Right now, I have some other mechanism designs in the works, but they're all quite low priority, so I'm mostly doing other stuff. Next published one might be a while.
Alright, that's all for now. Thanks for reading.
I just wrote a follow-up post to Tidemark.
It explores how to price/reward Between orders by factoring in how far across the order book they reach.
https://t.co/ZYBiFpJErE
The plan?
Release the Anthropic S1 and have everyone put it into Claude to summarize and generate charts from it to increase token spend leading to higher ARR, thereby improving the financial data
I just released Tidemark, a new batch auction design.
Most batch auctions can’t easily tell makers from takers when orders arrive in the same window. That matters when setting taker fees and maker rewards.
Tidemark solves this by using the prior window’s best bid and ask to assign each order a role: Maker, Taker, or a new one, Between. From there, fees and rewards can be set, opening some interesting design possibilities.
https://t.co/opRjANApW9
I'm at the gym in SF, go into the locker room to shower and there's a dude sitting there just prompting away in Cursor.
Bunch of guys around in towels, getting changed, etc.
Dude's unbothered. in his lane. focused. vibe coding.
Recently arrived in SF. Yesterday, some guy moving out of my building sold me $17 in laundry quarters for $15.
Already more profit than my blockchain startup. Now considering a pivot to laundry quarter market making.
@coloradotravis I'd suggest a caveat that under a capital flight condition, BTC on Coinbase will be less valuable than BTC on other real dollar exchanges such as Kraken since Coinbase servers will most certainly go down (as they consistently do during periods of high volatility).
@alexellisuk No, #octomaps only does it at the repo level currently. I'm not actively developing the project so I don't foresee myself building that feature. If anyone submits a PR that adds it though, I'll definitely review it and merge it.