An algorithmic, autonomous liquidation mitigation protocol built for developers
The protocol behind compound.finance was designed to withstand even the toughest market conditions.
This is especially apparent in its liquidation mechanism, which always settles balances atomically and offers liquidators a 108% reward to compensate for the depreciation of seized collateral. These choices have stood the test of time and changing them could jeopardize the trust that so many people have put in Compound.
That said, we at Haven have noticed that under many market conditions, liquidations could be performed in a way that’s more forgiving to users and helps mitigate oracle mishaps like the DAI Liquidation Event.
How does Haven work?
You configure a threshold on Haven. If your account health drops below that threshold, Haven will borrow assets from Uniswap (via a flash swap) to pay off some of your loans. Then we use some of your collateral to complete the flash swap and make Uniswap whole. This means that liquidation mitigation costs only as much as a trade on Uniswap. In fact, it’s cheaper for you, since you don’t have to pay for gas. You can think of Haven as a stop-loss order on your aggregate collateral:loans ratio.
Liquidation mitigation costs only as much as a trade on Uniswap
We would love to stop there and give everyone super cheap liquidation mitigation for life. Unfortunately someone does need to pay for gas on those flash swaps, and we still need to convince bots to monitor accounts 24/7. To make that happen, we withhold a little extra collateral for 4 hours after the swap. But don’t worry! Haven only seizes it permanently if it detects that the stop-loss swap actually saved you from liquidation on Compound.
Put another way, if your hypothetical health (the health you would have if Haven hadn’t stepped in) drops below 1.0 within 4 hours of the swap, then we seize some withheld funds — as a fee for the service. The fee starts small and grows over time when hypothetical health < 1.0. It’s always smaller than Compound’s liquidation incentive.
After the confirmation window ends, users can retrieve any withheld funds that weren’t permanently seized. Note that this design lessens the effect of momentary price spikes, as less time with health < 1.0 means more retrievable funds.
Where do these seized funds go?
After the confirmation window, we want to make it as easy as possible for users to retrieve their un-seized funds, so some seized funds will be used to buy CHI and reimburse gas costs on retrieval transactions.
As mentioned earlier, we also need to convince liquidators to participate in the process (we are forcing them to learn delayed gratification, but it can’t be delayed forever). Therefore, some seized funds will be put in a pool from which each liquidator can withdraw, proportional to their ownership of HVN. HVN will also function as the governance token of the protocol.
Okay that was a lot. If you read this far, thanks!! We’ll be releasing a more technical report in the coming weeks which will also explain the initial distribution of HVN. In the mean time, if you have questions or suggestions, we’d love to hear from you in our Discord or at email@example.com.
 Your threshold should be as high as is convenient for you at your level of borrowing. If you set it too close to 1.0, you may get liquidated on Compound before we have a chance to save you.
 In total, our version of the liquidation incentive is 106%. Depending on market conditions and the size of your account, something like 101% will be used to pay Uniswap (base + slippage + LP fee). The “extra collateral” we discuss here is whatever remains — something like 5%.
 There is no guarantee that the pool will have sufficient funds to reimburse retrieval transactions, especially when the protocol is young. If this is the case, users are free to wait it out or pay for their own gas to retrieve their funds.