Ripe’s Liquidation System

The lines of defense to help bolster solvency

Mick Hagen
Published in
8 min readMar 30, 2023

--

Ripe is designed to support a wide variety of assets (whether monkey pictures, your sneakers, or your house). Its liquidation system can’t be like other DeFi protocols — it’s just too different. Designing this system has required fresh perspectives and new thinking. And because of the nature of Ripe’s assets (sometimes exotic and illiquid), its liquidation system demands a level of robustness that hasn’t been seen yet in DeFi.

During our Banana Call yesterday, I walked thru these concepts live with our community. Here’s that video:

Because this is such a crucial part of Ripe’s mechanism design, we thought it’d also be helpful to lay out the key concepts here on Medium. So here we are.

Quick Primer

What’s a liquidation in DeFi? When the value of a user’s collateral assets gets dangerously close to the value of their debt, a liquidation occurs. A protocol will typically seize and sell the user’s collateral assets to recover as much value as possible (ideally enough to cover the value of the user’s debt). The purpose of liquidation is to avoid bad debt, maintain system solvency, and in our case, ensure jUSD is always fully collateralized.

Liquidation Sequence

The liquidation process can be broken down into two phases:

  1. Collections Phase: Seize user assets (bring them under the control of the protocol)
  2. Sales Phase: Sell the liquidated assets as efficiently as possible (ideally offsetting the user’s outstanding debt)

Collections Phase

We start with the Collections phase. During this phase, the protocol seizes all assets that have been deposited by the user who is being liquidated. If the asset being liquidated is a stablecoin, it’s immediately sent to the Endaoment. The stablecoin must be one that the Endaoment accepts as payment (the DAO can configure this). Where possible, the protocol seeks to take any and all profits that it can from the liquidation process.

Keepers

How does this process get started? Users who are keeping a close eye on what’s happening in the protocol can call the liquidate()function. These eagle-eye observers are called Keepers. Their transaction initiates the entire process (which includes both collections and sales phases). They can liquidate as many or as few users as they wish in a single transaction.

Why would a Keeper perform these actions? They are incentivized to do so. They get paid in $jUSD for their work.

  • Base Amount: At a minimum, Keepers will get paid a base amount of jUSD for each user that they liquidate. This is a configurable amount of jUSD that each borrower must leave inside the protocol at the time they take out a loan. It’s sort of like a “security deposit” that is given back to the borrower if they are never liquidated. But if they are liquidated, then that jUSD is given to the Keeper. This Base Amount is configurable by the DAO.
  • Bonus Reward: This represents a % that the Keeper will keep of the “gains” achieved in a given liquidation (collateral value minus the debt value). The faster the Keeper calls the liquidate() function, the more of a bonus they will receive. This Bonus Reward is configurable by the DAO.

Example:
Let’s say the Base Amount is set at 100 jUSD and the Bonus Reward is set at 10%. Kim the Keeper calls the liquidate() function on Bob. At the moment of liquidation, Bob’s collateral value is worth $110k and his debt is $100k. The total compensation for Kim The Keeper will be 1100 jUSD. She received 100 jUSD as the Base Amount and 1000 jUSD as the Bonus Reward ($110k collateral value minus $100k debt is $10k “gains”, and 10% of $10k is $1k).

Sales Phase: Lines of Defense

Okay, now that the Collection phase is complete, we need to move on to Sales. We need to offload/sell the collected assets so that the protocol can remain solvent. The protocol needs to recover enough value to offset the liquidated user’s debt.

I believe the liquidation process can and should have many Lines of Defense. There should be multiple strategies and fallback options if previous methods are insufficient.

A few concepts before we dive into the Lines of Defense:

  • Discount: Users who participate in buying liquidated assets will always receive a discount. The DAO can configure a minimum and maximum discount for all assets being liquidated. A buyer’s Juice Score is a factor in the discount.
  • Allowlist: There may be some assets on Ripe that require an Allowlist. For example, a fintech company may want to partner with Ripe DAO (get their asset supported on Ripe, unlock more utility for their tokenized assets). However, they are unlikely to work with Ripe DAO if we cannot support their compliance requirements. One of the common needs we’ve heard from these types of companies: their assets (often RWA) cannot end up in the hands of strangers (via liquidations).
  • Passive Buying: Most of the lines of defense do not require buyers to be actively participating. They do not need to be online — they could even be asleep. All that is required is that they have stablecoin deposits in Ripe. Their stablecoin deposits will be automatically used as payment for liquidated assets.

Okay, let’s now walk thru Ripe’s Lines of Defense for liquidation. These are all modular and can be re-arranged if necessary (and more can be added).

Underwriter

The first line of defense (first buyer) is the Underwriter. Each asset can optionally have a single Underwriter. The use-case here would be if a DAO out in the web3 world really wants their asset supported by Ripe Finance (unlock more utility for their NFT or gov token). Perhaps it’s a riskier asset that we would otherwise never consider. One way they could convince our DAO to onboard their asset would be if they agree to serve as an Underwriter. They would agree to deposit a specific amount of stable value into Ripe, and that value would be locked up and available during liquidation sales.

Example
Ripe is reluctant to onboard the Noun NFT as an asset on Ripe (low liquidity). However, Nouns DAO has a healthy treasury. Nouns DAO agrees to deposit $1M of stablecoins into Ripe, lock it up, and serve as an Underwriter for their NFT asset. Ripe DAO onboards the Noun NFT as an acceptable collateral asset, with a max debt ceiling of $1M.

Basic Defenders

The next line of defense is Basic Defenders. These are stablecoin depositors in Ripe who opt in to buy specific assets during liquidations. Basic Defenders can specify which assets they are willing to buy, and how much they are willing to spend. They have complete control.

During the liquidation process, the protocol will go one by one thru the Basic Defenders queue. The Basic Defender stablecoins are sent to the Endaoment in exchange for the liquidated assets (at a discount).

Example
Bob opts to become a Basic Defender. He specifies that he’s willing to spend $10k on $ETH and $5k on $UNI (even tho he has $100k in stablecoins deposited on Ripe). Bob will automatically buy ETH and UNI (up to his max budget) if those assets are in liquidation.

Super Defenders

This is the next line of defense. Super Defenders are very similar to Basic Defenders, except they cannot be selective about what assets they will buy, and how much to spend. Super Defenders will automatically buy any assets that are in liquidation, with all stablecoins they have deposited into Ripe.

Because Super Defenders do not have the same level of control as Basic Defenders (you may end up with an NFT you don’t really want!), they will always get the best possible discount. Additionally, opting in as a Super Defender will have an immediate positive impact on their Juice Score (the stablecoin deposit value will be part of the numerator in the Juice Score algorithm).

Example
Alice opts to become a Super Defender. She has $10k in stablecoin deposits on Ripe. She is basically agreeing to buy any asset that goes into liquidation (if the process reaches her). In exchange, she’ll get max discount and have a boosted Juice Score.

Auction Process

If assets are still not sold after the previous lines of defense, then it immediately goes into Auction. Each Auction will have a starting discount, end discount, and auction period (the default can be overwritten per asset, if necessary). The discount slowly goes up during the length of the auction (completely market-driven). Users can buy the auctioned asset with their existing Ripe deposits or via fresh stablecoin transfer. During an auction, the DAO also has the power to execute a transaction to sell assets directly on any DEX that Ripe has integrated with. This auction process is the only part of liquidation that does require active user engagement and participation.

$RIPE Token (ultimate backstop)

If after all the previous lines of defense there is still some amount of bad debt in the system… then $RIPE token holders serve as the backstop. We’ve spoken a bit about this before. $RIPE tokens will be taken from Stakers and auctioned off to make up for the bad debt. If that’s still not enough, then new $RIPE tokens will be minted and auctioned. This will happen until the protocol health is fully restored. Hopefully, this will never happen… but it’s important to have a plan for if it ever does. The priority is making sure jUSD is always fully collateralized.

Development Status

This liquidation system is not just academic or theoretical. The code has been written and the tests are passing. The work has been merged into the main development branch.

This was one of the last major components of Ripe that needed to be designed and developed before we could go to mainnet. We are getting closer!

As always, feel free to share any feedback or ideas in our Discord.

--

--

Mick Hagen

CEO/Founder of Hightop — a digital bank powered by web3