Skip to content

You Can't Fake Liquidity

A cardboard-and-tape figure labelled DeFi Liquidity, sweating, faces a mirror whose reflection is a powerful liquid-metal physique flexing over a bucket of gold coins marked TVL; on the cardboard figure's own side, only a cobweb and an empty pail.

Another Tuesday, another exploit. You can get the details on what happened with reUSD elsewhere. 0scar has the transaction sequence, robdogeth the economic timeline, and this HackMD walks the oracle down block by block. And I’m going to show how to actually make it stop, and why those solutions work.

For context, I worked on Bank of America’s proprietary asset monetization model, where we were required by regulators to develop a realistic estimate of the cost (both in time and money) to liquidate the bank’s asset portfolio (then ~$500B). I know a thing or 2 about liquidations.

A super TLDR on the PT-reUSD exploit: one wallet pushed the price of the PT token down using a bit of money, triggering liquidations of a lot of money. They were also the liquidator.

That trade came out flat, by the way. Roughly $320,000 of SY went in and $321,131 of reUSD came back out. They walked away with $945,796, and every dollar of it came out of the liquidation bonus. In other words the protocol paid them.

Some blame the oracle, some blame the manipulator. The real culprit, though, is liquidity.

We want to give liquidity to PT/YT tokens, great. That could be an AMM pool, an order book, or any other thing that serves to determine the price of the asset.

We also want to use PT as collateral to generate internal leverage. Also great, the lenders decide the value of the collateral and how much they are willing to lend.

These are two independent things. Let me say it again. The price of something and what it’s worth (as collateral) are 2 separate things. The gap between the two is exactly this thing we call liquidity.

When we mix the two up, we get into trouble.

During a liquidation you have a market-clearing problem. There’s a bulk order to sell asset X. Who is willing to take on the capital risk? How much of a discount are they willing to take? How much more is behind that trade? Who is the seller? Do they have private information? How long do I have to hold onto the asset? What’s the calendar look like (yes this matters)? Can I hedge with something else? What’s the correlation? And so on…

These are the questions that my counterpart at Goldman Sachs or Morgan Stanley would ask whenever we asked for a quote. While it’s unlikely that they could have gotten all their questions answered, it’s clear from this that assessing this risk is a HIGHLY complex and contextual activity.

But in DeFi… it’s just a bonus parameter, and an LTV threshold. And you wonder why this never works out.

Look at what actually cleared that morning. Seized PT went straight back onto Morpho and stayed there as collateral, carrying $308,406 of marked profit that was still unrealized when the analysis cut off. No asset went out to cash and no capital came back. One leveraged holder handed a position to another, at a discount a parameter picked in advance.

Borrowers were out about $1.20 million on the day, and the lenders took no bad debt at all.

Providing Liquidity is like selling options

Section titled “Providing Liquidity is like selling options”

Go back to that list of questions. Answer them and you are writing an option, whether you call it that or not.

Think about what a liquidator actually does. They stand ready to take a bulk order off a seller’s hands, at a price they quoted before they knew which day it was coming. That’s a put. That seller holds the right to hand them an asset at a strike, and the liquidator has to be there with cash.

Academics have been looking into this a long time. Kyle (1985) separates price from depth: his lambda measures how far a given size pushes the price, so two pools can quote you the identical number and sit an order of magnitude apart on lambda, and lambda is where the answer to “can I actually get out”.

In our PT-reUSD case, $320,000 of flow walked the oracle down 277 basis points, off a 0.9710 baseline. Pool held about $9 million. That was the depth of the venue pricing collateral behind $36 million of debt.

Standing ready to buy is selling an option. Three panels: a ladder of resting bids, the fork between a rebound and a fall, and the short put payoff those two outcomes add up to.

Merton (1974) closes the loop. He models risky debt as riskless debt minus a put on the borrower’s assets, which leaves the lender short that put and the borrower long it. Limited liability is just the borrower’s right to hand over the keys instead of repaying.

Over-collateralized lending exists to take that option away. Liquidate at 91.5% and the lender’s short put never goes in the money, because the position closes while the collateral still covers the debt.

That works right up until you ask who buys. Lender’s risk didn’t evaporate, it moved to the liquidator standing at the bid on the morning it fires, and standing at the bid is selling an option. These markets have handed their downside to a volunteer.

What the borrower gives up for that protection is an option too: the right to take their collateral at a discount, the moment the threshold trips. Granted free, at a rate fixed when the market was created.

Now ask what that put is worth. It moves with volatility. With time to expiry. With how far you sit from the strike, and with how deep the market is on the morning the seller exercises. All of those change daily, and some of them change between blocks.

What do we charge for it? 2.6167%, times whatever gets liquidated, against an LTV threshold of 91.5%. Both set once when the market was created, and revisited whenever governance next opens the file.

That’s one constant priced against four variables. It’s wrong nearly all the time. Sometimes it’s wrong in the lender’s favor, and on August 25 it was wrong in the borrower’s.

Carr and Jarrow (1990) wrote up the version of this I like best. Put a stop-loss under a leveraged position and a buy order above it, and the payoff looks exactly like a call option you got for free. It isn’t free. Their result is that the strategy can’t fund itself once prices move continuously and gap, and the shortfall works out to precisely the option’s time value. Liquidation is a stop-loss that a liquidator executes for you, in discrete blocks, at whatever the oracle last said. One side of the trade eats the time value. In this design you do, and then you pay the bonus on top.

It also leans the wrong way at the worst moment, because depth is thinnest on exactly the day every threshold gets hit at once.

That brings me to the oracle, and why I don’t think there’s much to fix there. No matter how transparent the oracle is, it’s not the right tool for this job.

Oracles report a price, and in this case, it’s just a short history of what was traded. It’s NOT the liquidation price for $36 million of PTs in the next ten minutes. It’s like reading the thermometer to find out whether the house is on fire. Related, sure, but you’re going to be late.

People will tell you to lengthen the TWAP. Mackinga, Nadahalli and Wattenhofer looked at that in 2022 and found manipulation cost doesn’t scale the way the linear intuition says it should. You buy a bit of time and you pay for it in staleness, which exacerbates the problem if the collateral is genuinely impaired.

Back at BofA the regulators made us produce two numbers (a lot more actually, just simplifying), not one. How much we’d recover, and how long it would take. Time was half the answer, because you can sell anything today if you’re willing to eat enough market impact (not quite true at that scale, but you get the idea), and you’d get a much better price if you waited a bit. It’s not free money though, because the longer you wait, the more market risk you endure. That’s the crux of the trade-off.

In DeFi, we fixed the price dimension, called it the bonus, and set the time dimension to “instantaneous”. If you look at the chart, that pretty much means the most punitive haircuts on liquidation in exchange for certainty. This “might” make sense if the collateral is volatile like Bitcoin, but for yield-based instruments it really doesn’t.

Three panels: recovery rising with the time you are given, the same curve steeper for a thin venue than a deep one, and DeFi reading a single point at zero against a fixed discount.

Bond the liquidator before you need one

How else can you get more liquidity?

One example is to have a liquidator’s pool. Liquity has been doing this since 2021. Their Stability Pool holds LUSD that depositors committed in advance, liquidations settle straight against it, and those depositors take the collateral at roughly a 10% discount. No auction, no bot race, no timer.

Had this mechanism been in play on August 25, the liquidator would have had to compete with the whole pool. Settlement would happen against a standing bid. Even if it ran off the TWAP price, the attacker’s profit would have been pro-rata, shared with the rest of the pool. Nearly all of what the attacker made was that bonus. Hand the slot to a bonded pool and the incentive just goes away.

Bonded pools have a size, though, and past that size you’re back to hoping. “Committed” also has to mean bonded capital under an enforceable obligation, not a bot with a gas setting in a config file. On Black Thursday MakerDAO ran auctions with a timer, gas spiked, the keepers stalled in the mempool, and one bot took $8.32 million of ETH for zero DAI.

Charge for the option in the rate

Borrow rates come off a utilization curve, which tells you how much of the pool is lent out. It says the same thing whether your collateral trades in size or not.

Another strategy is to price the put instead: distance to the threshold, volatility of the oracle’s own reference, time to maturity, and your size measured against the pool’s depth. Charge it as a running fee for each borrower and put it into a reserve that absorbs the shortfalls.

Clearing houses have done exactly this for decades. Risk-based margin plus a default fund contribution, and they charge you more when your position is large relative to the market clearing it.

Nice part is that the fee does the capping for you, and it’s paid upfront. Price it correctly and it rises faster than your size does, so the rule about how big a lending market may get relative to its pool writes itself. It just gets expensive.

This method has a downside though: it is fairly complicated, and it still requires a lot of capital put up as reserve. It’s just more sophisticated than a flat haircut.

Buy time

Every margin call I’ve seen in traditional finance comes with a cure period. Your broker rings, and you have until the close. That grace is an option the broker is granting you, and it’s priced into what you pay them.

DeFi replaced it with instant execution and acted like the option went away. It didn’t.

Prepaid version: pay a running fee for a cure window, say an hour, in which you can top up and third parties can bid. Your lender carries the gap risk across that hour and gets paid for carrying it. Longer you take, less the impact costs you, more price risk you carry while you wait. Same trade-off the regulators wanted us to quantify.

Academic version already exists. Qin, Ernstberger, Zhou, Jovanovic and Gervais built Miqado on what they call a reversible call option, where supporters get paid to top a position up and buy the borrower more time instead of selling their collateral out from under them. Worst case in their simulation cuts liquidated collateral by 89.82%.

Had this been the design on August 25, it would have gone like this: give it an hour and a bidder picks up the phone sends a DM on Telegram to Re, finds out the NAV never moved, that the cash buffer is sitting right there, that PT redeems 1:1 in December, and bids well above the print. All of it boring, all of it public, all of it knowable inside an hour. In that case maybe the liquidator loses money as the YT position drops like a rock.

Put the option inside the collateral

This is an alternative I have yet to see in the wild: wrap levered PT together with a floor and post the wrapper instead. It’s a non-liquidatable structured note. It moves the pricing problem onto the desk writing the floor, which does this sort of thing for a living. You buy the wrapper and stop worrying about it. Sure the yield is lower, but you can sleep at night? Take your pick.

Everything above is protocol design. This is what you can do to avoid being liquidated.

Take the pool that prices your collateral. Take the lending market borrowing against it. Divide. On August 25 that came out at roughly $9 million of pool underneath $36 million of debt, and the debt got liquidated in fourteen minutes.

Pendle’s reUSD market page has that pool carrying $10.2 million of liquidity, PT at 0.9703 and implied yield back at 10.99%, both within a nudge of where they sat before the first YT trade went through. Price round-tripped inside two days. Positions that crossed 91.5% on the way down stayed liquidated.

Small pool against a big lending market means manipulation is cheap. Cheap manipulation means market impact is high. High market impact means your collateral is volatile. Volatile collateral means your odds of liquidation go up. Make a judgment, and lighten up on the leverage.

DeFi needs to take liquidity more seriously, and we should use the technology we have to make liquidation work properly, instead of shrinking the problem down to a corner case with a parameter bolted on.

Options desks have a law for this and it is a very old one. You cannot have the payoff without paying the premium, and when the premium looks free you have misread who is paying it. Carr and Jarrow proved the simple version back in 1990: a stop-loss that appears to replicate a call for nothing is short exactly its time value, and that bill gets settled via trading activity.

Liquidity obeys the same law. Every design in this piece is an answer to one question: who eats the cost of immediacy. Take the lower of two oracle prices and the borrower eats it. Take the discount curve on its own and the lender does. Bond a pool ahead of time and the pool eats it, and gets paid for the privilege. Grant a cure period and the lender carries the gap. Wrap the collateral and the desk writing the floor carries it.

Those are real choices and different markets want different ones. Deep venues can afford to close a position inside one block. Thin ones cannot, and August 25 happens when we can’t tell the difference between the two.

Liquidity should be the centerpiece of a DeFi marketplace, not an afterthought. If we want to scale to deca-trillions in adoption, we need to make clear who takes on the liquidity risk upfront. We are building financial instruments after all, there’s no excuse for skipping the deep literature that already exists in this space. Let’s build on the shoulders of giants and make DeFi the clear successor to traditional finance, not a shoddy copy of it.