Market making is when you run an algo that posts limit orders. Technically, 23/7, 95% of the time, exchanges will post these sort of requirements to access the elite fee tiers. The market structure you patronize is the market structure you get. But technically any algo that uses limit orders as a part of legged execution (spread treading wind-up/unwind) is market making some of the time. A great many strategies and even taking directional positions with TWAP patience, involve making liquidity into the book to improve your realized cost basis over time. When you are dealing in millions of dollars in size, or even mid-6 figures on some exchanges, it does greatly behoove an operator to post-only at first, to take half off with a taker order against what’s on the book opportunistically, and to distribute orders over time.
When you create a product that is for trading, you need to get liquidity posted. Default liquidity tends to look like a ghost town, and the next step up is getting 1 or 2 dedicated MMs to post a wall or a set of orders that behave a bit like the “bonded curves” of AMMs. Automated Market Makers were revolutionary in terms of simplifying complex finance, instead of running a 23/5 operation monitoring your bot and making sure no crazy operational problems happen, or that there are no emergent bugs, you just commit capital to a pool governed by a smart contract.
In TradeLayer we’re not doing that, our market structure is lower level. We do have some simple automation of distributing limit orders through both sides of the synthetic orderbook. We have an open source matching system that acts like a switch board and allows trades to be executed on a p2p basis through multisig. Ideally we or someone would package this as an NPM to make it very easy to set up a vanilla server and create more decentralization among relayers. People can also hack the code and do wild stuff like create MeV for themselves as relayer operators, or play with Counterparty Value Adjustment and basically grief the optionality of these 2-step signed transactions. The other goal we have is to keep that relatively clean while maintaining minimal governance or influence on the future of TradeLayer and its spooned subversions. To achieve that, simply post an index of live addresses for servers that are reputed to follow the vanilla standard. No admin rights just blog posting, basically, as de minimus an exercise of 1st amendment rights as one can have.
The idea of the index as this minimal town square way of keeping a decentralized commons clean of pick-pocketing, a very minimally social way of enforcing common decency, self-regulation you might say, this is a good idea. Because it moves us away from the old model of bankrupt exchanges in a more profound way.
Also, anyone could config their home router to have an open port (if they want to log in to the command console and remember the password and do the config) and run their full node with Layer Wallet like their own decentralized API server, possibly also an order relayer, and in the future also a ZK prover! We don’t have robust telephony logic implemented around decentralizing these functions but are optimistic the open source community may implement improvements.
We can have a tiered system where lots of participants can freely try to be power users, power liquidity providers, or not. You could download the client, fund the wallet and make a trade without ever syncing a full node, and you can ping a robust network of heavy nodes to tell you the truth. Later, this can be prooved and verified. Web version and WASM ZK verification are possible in the future. Given the progress this year on the Khepri and then ZeroSync projects to prove Bitcoin state details in a STARK, there’s also reason to be optimistic about open source progress in such infrastructure.
Getting back to BitMex! BitMex was infamous for admitting to running an MM. Running an MM was good business for them. “You’re trading against your customers!” yes BitMex had a debtor relationship to its depositors/users, as well as an exchange clearing relationship (technically the one that made the revenue) and a counterparty relationship sometimes. Being a counterparty is revenue positive if your customers are, on average, kinda dumb at leveraged gambling/investing, which turns out to be a common metric in brokerage history. Hence, signing up to soak most of their orders is likely to be expected-value-positive.
It turns out the BitMex market maker wasn’t so bad after all because it never created a crazy long position in some alt contract that ended up vaporizing the entire BitMex treasury, and then 80 or 90 cents worth of all customer BTC. I mean, that would be crazy right?
But this is roughly what happened with FTX. What we did not fully appreciate, is that borrowing USD secured by BTC and going long more, is identical to being long the Perp (interest rates aside) with BTC collateral, or, being long an inverse quoted contract. 1 USD’s value in BTC behaves the way a $1 inverse contract does, and $1 of linear contract exposure at price X is still the same % loss when the market goes down.
Having established all this, BitMex very nearly did go under one day. The Market Maker did take mark-to-market loss (probably right?!) during the 18-Sigma or whatever it was 60% move over 72 hours - the exchange was in a dire situation where there was no liquidity left for its BTC flagship perp. This meant, idk, the market flash crashes? Or they have circuit breakers and the mark price drags lower more slowly? Inverse quoted contracts or recoverability of spot sale on a USD secured loan, they both suffer at 50% drop, at 75% drop it’s 4x the suffering, at 87.5% it’s worse, and so on. Going to 0 is bad because it means the synthetic dollar security of the creditor’s position, they thing they have dollars, then it will turn out they do not. Just not enough spot bids to unwind the whole thing.
And it almost, almost happened with BTC backed dollars as the gold standard up to March 2020 was arguably BitMex (with Deribit and maybe CryptoFacilities in the wings). But the bank of BitMex almost failed along with BTC market stability at all.
So they cut off the server.
And magically, the market immediately bounced. It was my One Good Trade for 2020 that got me through 5 months. From $3600 to $5700 in an hour and some change. BitMex came back on.
It makes sense for a corporate treasury to invest in what has the most IRR (internal rate of return). Posting corp cash to treasury bills doesn’t quite do it (unless rates are being hiked relentlessly and you’re one of the lucky corps with lots of cash). You ideally have a business that returns a better %. Market making then tastes like peanut butter M&Ms. You know the stats on your users so you know your edge, you can hunt their stops, send them the overload message or do jitters.
Now it turns out FTX was a bigger sinner. FTX did jitters and overloads and scammy failed cancels but the notification said canceled? And you lose money on FTX all the time due to the bs. But people would sometimes complain about that on Mex.
All of this is immaterial to the bigger picture. Of course being ethical and less sharky is more virtuous. Thanks for the tautology Aristotle. What really matters is systemic risk!
Why did the Bank of England need a bail-out by wealthy merchants every 20 or 25 years in the 1800s? Because you get leverage cycles, people lever up, get high on the possibilities, get manic, lever too much, blow up, things unwind, you need to restructure, bad debt gets converted to equity along with fresh cash injection. All the profits coming later as the next cycle gets going, and it works. Because finance is about moving real things around the world. People like to eat paprika on their imported rice.
Critics of Bitcoin would say it’s all made up. Bitcoin Maxis take a modernist view that Bitcoin is the True King and get with it. The post-modern take is an alt-coin/NFT frenzy of shameless grifting and flipping. The post-post-modern take is of course it’s all made up, so is the exciting Wheel Technology that took us from the bronze age to Rome, what’s cool about wheels is they are systems, the geometry of the wheel is mathematically clean, resulting in consistent physics that you can ride. A well functioning financial system is like that.
DeFi didn’t fail, DeFi didn’t fail because there were fewer frauds. There were a lot of exploits though. That’s when the originators of the project don’t profit from the fraud-like catastrophic losses, it was some random guy who is more of a nerd, and nobody committed fraud! Hooray. Less shady. Still a big loss though.
And what these all have in common is systemic risk. Being a market maker on your own exchange is ok when you’re soaking deltas and trying to loss-lead volumes, it’s authentic volume, risk, and bona-fide trades all of them. Protocol-owned liquidity as an automation of that is logical for the compound growth rate of a Dex, it’s good for marketing alone! It’s good CFO’ing in code. Ideally the posture however, is not of a corporate treasury or a hedge fund, but rather, an insurance fund, systemic bulwark reserve capital that gets the most conservative yields and is mostly there for a rainy day. The Insurance Fund can be a light AMM, all the liquidation orders are de facto automated maker-order-posting systems, an AMM in other words. Their various mechanics of TWAP’ing or dragging orders lower to concede some systemic loss in exchange for better odds of recovery, or not, these are AMM variations. The AMM profits if the liquidation is clean enough to have some leftovers to be consumed as the insurance fee, which is fundamentally a premium on the binary option that is a no-recourse crypto derivative.
The Insurance Fund’s AMM mechanics should be… minimal? Maximal? They’re not front-running orders or using CoLo or doing jitters to trick you, it’s just buying up your liquidations when nobody else will, and ideally earning enough revenue in the form of these Liquidation Fee premiums, to offset its losses.
So the Insurance AMM is fundamentally a short Vega system. What if you had a more sophisticated one that would buy ATM options and sell wings (calls covered by the long inventory of the insurance fund). I’ve thought at length about implementing such, but it’s a huge PITA to operate in C++ I’d rather implement the Maximalist (not Bitcoin Maximalist, just in a design sense) version of an Insurance AMM in Cairo. Get composability with Starknet derivatives. In another world I’d have gotten more funding and implemented options on top of a live Dex already, and maybe then I’d still do the minimalist Insurance AMM.
The minimalist Insurance AMM just posts orders to hedge half of its assets in the native contract, into sLTC basically (long spot ALL, short ALL/LTC native) as the ALL comes in. If I donate a bunch, it’ll post an order. It’s the dumbest, simplest implementation. A slightly smarter one spreads orders through all prices on the on-chain Dex to maintain a 50/50 hedge value. We’ll see if adding that is feasible as we test.
Then, the minimalist Insurance AMM has a lot of inventory to cover the long liquidations. It buys them back by lowering its inventory of short contracts. Eventually it runs out and you just have ALL, and that’s more problematic. Maybe the simplest v1 of an Insurance AMM just gets into hedges on 100% or 80% of the inventory.
A consequence of using perpetual swaps to do this (but could also be true of rolling futures) is that negative funding over prolonged periods slowly drains the insurance fund. You’d want decent fee cashflow to auto-bid the token enough that it’s not dragging down-only for prolonged periods of time and create this lucrative barnacling. Also to do the barnacle trade, you need to spot bid at least a bit of ALL to buy the native swap and get the neg. funding, with the Insurance Fund being a major counterparty. This was sort of a problem for UXD which is another project that wanted to crush the holy grail of a really good decentralized dollar, they ended up covering for neg. funding out of their DAO insurance fund and it’s a brutal theta bleed.
But for that cost, it’s also a stabilizing effect.
It was a bad idea for Alameda to keep getting longer and longer FTT. If Sam really hadn’t though about how, oh, we don’t have an insurance fund for the USD lending, that’s unfortunate. The USD funding could have also been kept safer by marking FTT at an LTV of like 0.1 for Alameda. So we collapse from $25 to $2.5 and Liq. price is at $2.4, that’s manageable leverage. Or if Alameda was like, ok, we’re endangering the whole complex, we have to start laying off FTT as much as possible, buy puts on ETH and BTC for correlation profits to offset the damage, and try to short a lot on FTX to reduce the possible credit impact. They could have thought about that. The financial danger of cross-margining lots of uncorrelated-until-they-so-correlated! collaterals, that’s real danger. In a sense, the way the 2008 financial crisis happened is analogous. Junk assets got marked wrong and by the time they got marked right, trillions had to evaporate. Malfeasance, greed, perks, lux real estate, yada yada, millions of people lose their savings, it’s brutal. People die, by their own hand or later, after spiralling off into poverty, family break-up, drinking, homelessness, you’ve got so many years ahead of you! Don’t high five each other too much about your FTT or LUNA levered shorts.
In conclusion, exchanges making markets is bad because, it invites opportunities for malfeasance. In DeFi we don’t have the creditor relationship and we clean up the operation to be inhumanly consistent and untricky (operational risks and solidity typos aside). Having an internal market maker is still bad when, it contributes to systemic risk, and it’s still good when, like the Bank of England that winners gladly bought into each cycle, it uses the breadstuffs of harvests past to buffer the famines of tomorrow.
That’s a reasonably valuable insight worth probably Trillions of dollars. Maybe Tens.