Redesigning Risk Management In DeFi

Blueberry & Bloom Protocols
8 min readOct 18, 2022

--

(Scroll down to “Blueberry Design” to skip risk management talk and learn about the protocol)

Designing a new protocol in the last year has arguably been the perfect period to do so, as we have witnessed firsthand the countless points of failure that need to be addressed.

We at Blueberry do believe in many of the fundamental financial smart contracts that were invented in the last cycle. However, many were misused — either intentionally or unintentionally — to extract profit from frothy market conditions and poor risk controls. While this is the unfortunate reality, we have still built some incredible decentralized inventions, and the next iteration will be even better. DeFi can and will thrive if we are smart about risk management, thoughtful about token value accrual, and focused on offering strategies that make users real yield.

This article is focused on the risk management side, which comes before everything else. While this topic may be boring to some, these are the conversations that we need to have as an industry to build things that last and repair our collective reputation.

Exploits in DeFi

Often when we talk about a protocol getting “exploited” or “hacked,” the sad reality is that it was a result of poor design decisions rather than errors in code. In the worst cases, it might even be an intentional oversight so that insiders can steal. There are real hacks/exploits too, but the majority are design flaws. Whenever bad debt is created, we call it an exploit. But, usually it was just a loan that should never have been originated.

Other bad financial outcomes result from too much leverage in the system causing cascading liquidations. Leverage in crypto gets a bad rap because of this trend. However, we strongly believe that capital efficiency through leverage is a useful tool. Leverage is not the enemy — bad risk management is.

We designed Blueberry in the wake of so many of these collapses and exploits, so we constantly had one question in mind:

How can we be smarter, safer, and more capital efficient when offering leverage?

We thought deeply about this question, as we wanted to build something that can stand the test of time. This eventually led us to three tenets, which I will explain in this article in the context of Blueberry.

These are principles that can be widely applied to DeFi protocols, and we hope others take similar approaches. Hopefully, investors can also reference some of these points to be better informed when choosing to put their money into a protocol.

Risk Management Tenets

Tenet #1: Always Measure Collateral Borrow Limits Against Liquidity

The risk level of a collateralized loan is tied to one question: can the collateral be realistically liquidated to cover the debt?

The faulty assumption much of the industry made is that a token collateral is worth its Oracle Price * Amount of Tokens. In reality, the collateral is worth: Oracle Price * Amount of Tokens — (Oracle Price * Amount of Tokens / Value of Token Liquidity On-chain).

A good example of this faulty assumption was the liquidation scenario on Solend.

https://twitter.com/solendprotocol/status/1538441350441422848?s=20&t=izqTWb-88ifqQf2f0DvZSw

No insult to the team, but it can be good to have context.

The defining factor of a trade’s price impact (slippage) has nothing to do with its market cap and everything to do with its tradable liquidity. Given that collateral liquidation = market selling, it seems obvious that the estimated market impact must be considered when underwriting a loan — whether that loan is made between entities or through a decentralized smart contract.

While that explanation may have been wordy, the logic is extremely simple: factor in how much price impact selling will have if you are covering your risk with collateral that must be sold in order to perform liquidation.

We do this at Blueberry by never allowing a collateralized position that is greater than a predetermined % of the value of tradable liquidity available for the collateral. This is a simple yet powerful risk control that other protocols can adopt with different thresholds based on the nature of the transaction. There are many more methods used around the same principle, such as avoiding liquidation price clusters to avoid cascades.

Now of course, even measuring against liquidity can be manipulated. In a permissionless system, an attacker could increase a token’s liquidity at another venue by pairing it with stablecoins, use that to take a borrowed liquidity position against the token collateral at its inflated liquidity level, then pull the liquidity at the other venue and use the borrowed liquidity source to dump their tokens. They would profit from the amount of stablecoin in the borrowed position and could repeat this forever.

This scenario leads us to our second tenet.

Tenet #2: Permissioned Collateral Asset Support

To address this risk, collateral asset support is determined at the Blueberry DAO’s discretion after a significant review of liquidity sources for the asset. Becoming a collateral asset on Blueberry will be a thorough and slow process, but the benefits of generating additional liquidity are worth it.

While interaction with a protocol should always be permissionless, you must know thy counterparty when offering a loan. Therefore, the assets supported must be permissioned. This is already a standard with most DeFi, but it is extremely important. It is also not in violation of decentralized principles. The DAO behind the protocol still uses a decentralized governance process to make these decisions, but the decisions do have to be made with the best interest of the solvency of the protocol in mind.

There are a number of proprietary factors a team should consider before selecting assets to support as collateral, including but not limited to:

  • Locked/burned liquidity
  • This means that there is a trading venue that has liquidity locked either contractually or through code, guaranteeing that collateral can be liquidated in that market
  • Team
  • You must assess the history and good faith of the team looking to enable borrowing
  • Backers
  • You must assess the history of the investors and other partners
  • Treasury and Assets
  • Jurisdiction
  • Both of these last two help determine the probability that bad debt is repaid in a worst-case scenario where collateral liquidation is not enough

With the first two tenets, we establish the validity of collateral and the amount that can reasonably be borrowed against it. With the last tenet, we control systemic risk and unlock far greater capital efficiency.

Tenet 3: Control for the Deployment of the Loan

This enables under-collateralization. It is also a principle that you may not realize you are already familiar with. For example a mortgage, an auto loan, or a perpetual swap. Most homes are purchased with mortgages allowing 10–50x leverage. In DeFi, you might call this “undercollateralized.” But it’s really not, as the lender can claim the collateral and the position together if it is required. Another example of the same concept is leverage trading with perpetual swaps or other futures contracts.

What do these kinds of loans have in common?

They set out in advance what the loan is being used for and are able to take control of the deployment asset if needed. This means that you can offer significant under-collateralization. In the case of the home mortgage, the lender can repossess the home if payments are not made in a timely manner. In the case of the perpetual swap, the lender can simply liquidate the collateral and the position to make itself whole. The key principle here is that since we know and control the deployment of the loan, we can measure the liquidation price against the PnL of the deployment, rather than just the collateral value. Therefore, in principle, you can offer unlimited leverage so long as both the position and the collateral can be liquidated at market when the PnL exceeds the collateral value plus potential slippage.

Compare this to something like AAVE–your loan value is measured directly against your collateral value. While still incredibly useful, this system can never lend 100% or more of the collateral value, limiting capital efficiency.

Blueberry Design

For Blueberry, we use an analog to the latter perpetual swap model. The protocol aggregates all of the DeFi strategies you might want to use leverage for into one margin yield account. When you enter a position, it is kept within the same NFT as the collateral. The position is liquidated at an 80% or 90% -PnL depending on the collateral type. This way, you can utilize more than 100% borrow (up to 3x leverage) and significantly boost yield strategies while maintaining preferred collateral asset price exposure.

The goal of the protocol is to offer this system for all potential on-chain deployments where users may wish to apply leverage. Imagine the ultimate cross-margin account, where you can create and deploy any yield strategy with the leverage amount and collateral asset you prefer. This is an extremely flexible and novel strategy design space for DeFi strategists.

The main difference between Blueberry and other leveraged DeFi strategy providers is the collateral isolation aspect. This allows much greater flexibility and capital efficiency, especially for DAO/protocol use cases (see “Community Owned Liquidity” section below).

Imagine you are a user that is very bullish on a particular asset, and your conviction is high that it will go up in the next 6–12 months. Let’s call it TETH. Let’s say you want to hold 100% of your portfolio amount in that spot asset. You also want to earn a yield on it, but you don’t want to sacrifice any price upside.

With Blueberry, you could deposit this asset as collateral, instantly earning the organic lending yield for the asset. On top of that, you could enter a 150% LTV TETH-USDC liquidity position. Blueberry supports the best automated UNI v3 strategies (which also help mitigate impermanent loss), so that position could yield 25%+ APR. You are effectively now earning 37.5% APR on your TETH collateral, and you have increased your exposure to your base asset to earn even more from the price appreciation. All are fully automated.

Compare this to the traditional LP experience, where you would need to sacrifice 50% of the upside and suffer impermanent loss. You could recreate this scenario using multiple existing protocols and manual range management, but the max position size would be 75% (typical LTV maximum). Also, you would constantly sweat and need to manage your LTV between protocols in order to prevent liquidation. In a volatile market, this is not so practical.

Future Use Cases

The isolated collateral system also unlocks amazing future use cases.

Really, anything on-chain can be leveraged.

Our first integrations after Uni v3 will be:

  • Convex
  • Curve
  • Yearn
  • Balancer
  • Leverage Spot Trading

Plus many other newer trendy options. Anything people want to employ greater capital efficiency for, they can do so fully on chain with Blueberry.

We could eventually add oracle based perpetual swaps like GMX or GNS. In this system, you could hypothetically enter a 10x leverage liquidity position against USDC collateral, then use the same collateral to open a hedge in order to eliminate the price risk (delta) you are taking on. Imagine you could 10x leverage farm stETH-ETH then short the same amount on perps. In theory, this would produce a strong delta neutral yield.

Delta-flexible leveraged yield where you don’t have to navigate and manage LTV between multiple protocols is our long term vision, as it provides holy grail like strategies. In order to implement this, the system would need to be extremely large and liquid. That said, it is one of the many reasons to be excited about the long term future with Blueberry.

Follow us on Twitter to keep up: twitter.com/BLBprotocol

--

--

Blueberry & Bloom Protocols

Blueberrry - DeFi prime brokerage offering the most access to leverage. Bloom - the world's first permissionless stablecoin savings product