# Intro to B.Protocol

B.Protocol is a DeFi Economic Risk Mitigation Hub.

B.Protocol was founded in mid-2020 with the vision to enable safety growth for the DeFi ecosystem. As a first step B.Protocol launched a [**Backstop**](https://app.bprotocol.org/) liquidity protocol to allow a robust, capital-efficient liquidation engine. The protocol launched its v2 in mid-2021 enabling anyone to participate in DeFi's lucrative liquidation processes with its Backstop Automated Market Maker (BAMM) - providing over $300m of liquidity to backstop supported lending platforms.&#x20;

In mid-2022, B.Protocol initiated [**RiskDAO**](https://riskdao.org) - a sub Service-DAO providing risk assessment and risk management solutions for DeFi platforms. Together with partners such as the research arm of 1kx, La-Tribu dev team, and other researchers and devs, RiskDAO fast became a leader in the space.&#x20;

Since early 2023, B.Protocol has broadened its scope, developing [**Risk Oracle**](https://risk-oracle.bprotocol.org/) in order to enable a more neutral, automated economic risk management for the DeFi ecosystem, minimizing the human factor in order to align it with the DeFi ethos of self-execution.

B.Protocol is run by a community of risk-aware DeFi players building open protocols for risk mitigation and assessment, governed by the BPRO token.


# Risk Oracle

{% embed url="<https://www.youtube.com/watch?v=JYTkLDs6iX0>" %}
**Yaron Velner presenting Risk Oracle at EDCON 2023**
{% endembed %}

## Intro <a href="#id-6e9f" id="id-6e9f"></a>

DeFi has seen tremendous growth in recent years, with billions of dollars in assets being locked into various DeFi platforms. However, to date, those billions of dollars risk management is somewhat opaque and the managing platform has a clear conflict of interest between its risk exposure and the growth of the platform.

To address this need, our community [has proposed](https://forum.bprotocol.org/discussion/8601-lets-build-an-onchain-risk-oracle-for-defi) to develop an on-chain risk oracle. Such oracles could provide objective pieces of information in a transparent and decentralised manner. With that in hand, smart contract devs could use it in their dapps and mitigate conflict of interest concerns, growing trust among their user base.

B.Protocol has been building risk mitigation tools for over two years, and works closely with numerous DeFi platforms. Leading an initiative for a new on-chain risk oracle DeFi primitive seemed like a natural next step on our roadmap.

In this post, we will explain what the Risk Oracle is, why it is important for DeFi to have an on-chain risk feed, how the Risk Oracle is designed, and who could benefit from it.

## The need for an on-chain risk oracle <a href="#ca2d" id="ca2d"></a>

DeFi platforms manage billions of dollars in user funds. In most cases, e.g, lending markets and yield aggregators, the protocol owners (a DAO or a multisig) have the authority to use or lend the funds in order to generate yield. This gives rise to the following issues:

1. The platforms might decide to take an excessive risk in order to increase the user and /or the platform’s yield. A yield aggregator might deposit user funds into risky platforms, a lending market might decide to list a risky asset due to high demand, etc.
2. The need for users to trust the platform’s risk management creates an entry barrier for new teams and DAOs, and leads to inefficient markets. Since it takes a long time for teams to build trust in their risk management capabilities and the robustness of their DAO in making the right decisions, users will favour lower yield (or higher fee) platforms that are more reputable.
3. The platform’s risk mitigation actions (e.g., delisting a risky asset due to changes in market conditions) are typically guarded by timelock and a tedious governance process which prevents taking action in a timely manner, though these actions are often time sensitive. .

**An on-chain risk oracle can help mitigate the above concerns.**

By integrating a risk feed into its protocol, a yield aggregator platform can verify to its users, by code, that a specific strategy is limited to deploying capital only in protocols and assets with a minimum pre-defined risk rating. This can help users choose strategies that align with their risk appetite and help align ROI expectations, as well as to adjust the risk of losses due to unexpected events or changes in market or platform conditions.

<figure><img src="https://miro.medium.com/v2/resize:fit:560/1*VlQuX4bXUb7xF89qdoP8JQ.png" alt=""><figcaption></figcaption></figure>

For example, a user who is comfortable with higher levels of risk may choose a strategy that deploys capital into lending protocols which provide higher APYs but with a lower risk rating (e.g. rated B rather than AA), while a user who is more risk-averse may choose a strategy that deploys capital into protocols with a stronger risk rating but lower APYs.

By using an on-chain risk oracle, the yield aggregator smart contract can verify the risk rating of the protocols or assets that are included in the strategy, and can even be coded to pull out funds and deploy them into another platform in case the platform’s rating is suddenly dropped due to changes in market or platform conditions.

Other use cases for an on-chain risk oracle can be

* A lending market that codes a restriction that prevents it from listing a new risky (volatile) asset;
* DAOs that enforce their treasury managers through smart contracts to invest only in platforms that meet their risk appetite;
* Lending platforms that can automatically set their reserve rates (fees) dynamically according to risk rating changes.

Other use cases that will be revealed with time.

## Oracle architecture <a href="#f230" id="f230"></a>

In order for the risk oracle to be decentralised and transparent, it should use an open source code whose output can be verified by anyone who wishes to run them. Such a risk framework is the one published by [RiskDAO](https://github.com/Risk-DAO), which is suggested to be the first framework to be used by the risk oracle, though we anticipate more risk frameworks will join as open source data providers to the oracle as the network grows.

A network of independent validators will run the required software to provide risk ratings according to a set of pre-decided risk parameters, and the consensus result will be published on-chain by the oracle.

<figure><img src="https://miro.medium.com/v2/resize:fit:560/0*ZRZIC2aIIAdY7lS-" alt=""><figcaption><p><strong>Risk Oracle High-Level Design</strong></p></figcaption></figure>

To ensure the integrity of the process and align the incentives of the validators, the risk oracle would implement a staking and slashing mechanism. Validators will be required to stake tokens, and in the event that their result deviates too much from other validators, their staked tokens will be slashed and distributed as rewards pro rata to other validators and network participants. Fees can be collected for reading the risk oracle feed (might be subsidized during initial stages to drive more traction), and other incentives might be proposed upon launch.

## Oracle feed examples <a href="#d6a8" id="d6a8"></a>

The initial set of objective risk parameters that can be used to assess the risk of lending platforms is as follow:

1. **Liquidations at risk** (normalized by TVL): This metric reflects liquidated positions the lending platform would process in a Worst Day simulation. Worst Day simulates the current state of the platform during the biggest price drop in ETH history, normalizing other assets according to their volatility w\.r.t ETH.
2. **Existing bad debt** in the platform: Some platforms operate with existing bad debt that was accrued historically through hacks or exploits, but many times is not published publicly.
3. **Risky tokens** listed on the platform: This metric considers the on-chain liquidity and the volatility of risky tokens listed on the platform as they can impose risk contagion.
4. **Borrowing and lending caps**: This metric considers whether the platform has borrowing or lending caps, and how high or low these caps are set, w\.r.t. Market liquidity and other factors.
5. **Smart contract updates**: This metric tracks when the platform’s smart contracts were last changed and whether there are any planned or forecasted updates in the near future. Recently updated contracts can impose a higher risk exposure as the new contracts are yet to be battle tested.
6. **Price oracles**: This metric considers the price feeds used by the platform, including their stability and trustworthiness.

More parameters can be added and others can be replaced as the system matures.

## Another lego piece for making DeFi platforms more robust <a href="#a850" id="a850"></a>

The idea of a new DeFi primitive that publishes risk rating on-chain doesn’t come from a void. [B.Protocol](https://www.bprotocol.org/) community was founded in mid 2020 (after “Black Thursday” events) with one main goal — providing safer ways for the DeFi ecosystem to scale. The core values we stick to are keeping everything we build open-sourced and decentralized, aiming to drive more traction into the ecosystem by providing new and innovative risk-mitigating DeFi primitives others can build on.

Since then we have released our [Backstop](https://app.bprotocol.org/) product, a robust liquidation engine that enables lending platforms to better secure their lenders’ funds, minimize the potential of accruing bad debt in the protocol, and facilitate better capital efficiency for borrowers — and doing all that while letting their users gain from liquidating unsafe positions from the platform. At the peak of the last bull market, the Backstop was trusted with over $300m of Backstoppers’ funds, coming from private users, funds, and DAOs.

After the Luna/UST crash, and from our experience talking with dozens of lending platforms, we realized there is a lack of knowledge and open-source tools for proper economic risk management. As a result, we launched [RiskDAO](https://twitter.com/Risk_DAO) together with 1kx research arm and other researchers and devs.

RiskDAO is dedicated to providing open-source tools, dashboards, and monitoring systems that give better transparency into lending platforms, stablecoins, and alt-L1s and L2 networks. By running simulations of tens of thousands of data points, RiskDAO provides real-time information and recommendations that help to set and manage better risk factors in the platforms that use its services. RiskDAO also provides some of its tools as public goods for anyone to use, such as the [Bad Debt Dashboard](https://bad-debt.riskdao.org/).

## Conclusion <a href="#id-8c30" id="id-8c30"></a>

The on-chain Risk Oracle is an important new DeFi primitive that aims to provide a way for devs to integrate the risks associated with DeFi into their protocol’s smart contracts. By using it, protocols can build risk-informed solutions that can scale safely and maintain user trust.

We are excited to see how the risk oracle will be used in the DeFi ecosystem and encourage readers to learn more about it by joining the B.Protocol community on [**Discord**](https://discord.gg/bJ4guuw) for discussions and feedback.[<br>](https://medium.com/tag/risk-management?source=post_page-----a5a44bf9048b---------------risk_management-----------------)


# SmartLTV formula

A smart contract to automatically calculate Loan-To-Value ratios according to risk-related data feeds.

## Disclaimer: <a href="#id-4f35" id="id-4f35"></a>

***The Smart LTV formula and the data layer used with it are experimental and are published for research purposes only. The data is used by a testnet smart contract and may be incorrect, missing, or wrong altogether. Using the formula, its code, and the data associated with it can cause risk management flaws and might result in severe financial losses. Use at your own risk and for research purposes only. You can reach out to*** [***RiskDAO***](https://twitter.com/risk_dao) ***for any inquiries or suggestions to improve the code, the formula, the data, or anything else related to this paper.***

## Introduction <a href="#id-4f35" id="id-4f35"></a>

Determining the correct Loan-To-Value (LTV) of a collateral asset is crucial to balance the loan’s default risk and the usability of the lending platform.

This is done by running excessive daily simulations and integrating a domain specific knowledge.

In a new [research paper](https://github.com/Risk-DAO/Reports/blob/main/a-smart-contract-ltv-formula.pdf), we try to find a simple “Uniswap-like” formula for the LTV ratio. We present a simple formula that can be calculated by a smart contract (e.g., when coupled with B.Protocol’s planned on-chain data oracle).

With the formula, one has to decide on a value of a Confidence level, instead of a value to the LTV. This process is more efficient as once the level is selected, the LTV ratio could change automatically based on the market conditions (volatility and liquidity).

Moreover, once such data is available on-chain (e.g., via B.Protocol oracle), it will be possible for a smart contract to automatically decide on the LTV ratio of assets, and change it dynamically over time. Hence, the formula can reduce a lot of future decision making overhead, and give rise to a more automated and permissionless lending market.

The formula can also be used as a ranking formula, comparing the different risks between different configurations and platforms. For example, a new platform can estimate the average confidence level of an existing project, and decide if they want to take similar or different risks with their assets. Existing platforms can give more transparency to their community about which asset configurations are currently less or more risky.

In the full paper we analyze the confidence level of the assets in Compound III USDC market.

## The formula <a href="#id-5c8b" id="id-5c8b"></a>

Aiming for the simplest possible formula, we abstract smart contract security considerations, and assumptions on user behaviour. However, as mentioned above, formula has an adjustable confidence parameter that could compensate for these aspects.

At the core level, the goal of setting an LTV ratio that is smaller than 1, is to compensate for the potential price decrease during the liquidation process (which need not be in a single tx, and could take time).

For this purpose, we aim to answer the following question:

> How much will the price decrease before a liquidation is fully executed?

This is a very open ended question, as even the size of the liquidation is unknown.

For this purpose, we make the following three assumptions:

1. There is a discrete basic time unit, and the price follows a log-normal random walk distribution. We note that in particular, there is an implicit assumption that a liquidation will not change the price of the asset, however, a different assumption could potentially be embedded at the confidence level factor.
2. **DEX liquidity.** We define liquidity as the total quantity that is available for sale with a given price slippage. We assume that every time the liquidity is depleted, it will be fully restored after a constant time interval T. This can be justified, e.g., by traders/bots arbitraging the existing DEX liquidity with Binance orderbook, and/or for additional liquidity to come from another chain (if the lending market is on an L2). As usual, the confidence parameter will also embed the confidence in this assumption.
3. **Liquidation sizes**. The size of liquidation that a lending market should be prepared for, is proportional to the total debt in the system. We note that in practice, the current user account composition also has a great effect on this parameter, however, as a design choice, we chose to abstract away the current user composition.

Given the above assumptions, the proposed formula is:

<figure><img src="https://miro.medium.com/v2/resize:fit:268/1*NI_JiFMnGAxK18eik6-ezQ.png" alt="" height="82" width="335"><figcaption></figcaption></figure>

Where:

* σ is the price volatility between the collateral and debt asset (normalized to the base asset price).
* β is the liquidation bonus.
* ℓ is the available dex liquidity with a slippage of β.
* d is the borrow cap of the debt asset.
* c is a confidence level factor. The higher c is, the odds for insolvency are decreasing.

We prove the correctness of the formula in the paper.

## Experimental results <a href="#id-5d9d" id="id-5d9d"></a>

99.9\\% of all DeFi liquidations are executed in a single transaction. And thus we take real liquidation data from Binance Futures ETH-USD pair. In order to test different volatility levels, we amplify the price changes and multiply them by a stretching constant that ranges between 0 and 2.

The most synthetic part in our experiments is the behavior of DEX liquidity. We follow the formula assumption that there is a fixed DEX liquidity size, which is restored every 30 minutes.

We take the 3 worst months (in terms of liquidations) in the history of Binance Futures, namely, January 2020, March 2020 and February 2021.

Having price trajectory and liquidation time and sizes in hand, we simulate the DEX liquidity, and the behavior of the liquidators. And keep track of the maximum price drop of an open liquidation.

The results are depicted below.

<figure><img src="https://miro.medium.com/v2/resize:fit:560/1*D8UkA80Lq3iYAY63S_O69w.png" alt="" height="557" width="700"><figcaption><p>Comparison of simulation results and the results of the formula. For x=0.2, we take all the input parameters for which the simulated max price decrease (max drop) is 0.2, and then plot, in the y axis, the different results and formula give. The red line draws the ideal outcome, i.e., an y=x curve, where the formula returns exactly the same results as the simulation. The R² score is calculated w.r.t the red line.</p></figcaption></figure>

{% embed url="<https://medium.com/risk-dao/a-smart-contract-formula-for-ltv-ratio-a60a8373d54d>" %}


# Backstop AMM (BAMM)

A robust DeFi liquidation engine primitive.

{% embed url="<https://www.youtube.com/watch?v=LBaRFiIrxvs&ab_channel=Bankless>" %} <mark style="color:blue;">**Yaron Velner presents B.Protocol's liquidation engine (v1)**</mark>
{% endembed %}

## Intro

B.Protocol provides a Backstop AMM (BAMM) DeFi primitive, providing better stability, and unlocking higher capital efficiency in the DeFi ecosystem. By democratizing liquidation systems we shift MEV and bots' profits to the community.&#x20;

**High-Level System Design**

B.Protocol pools users’ funds into Backstop pools. This liquidity is used for liquidations as they happen on integrated platforms. While the Backstop funds are sitting idle in the pools waiting for liquidation to occur, they gain either interest rates or liquidity mining rewards, or both, generating passive revenue for the Backstoppers - users who provide liquidity to the Backstop pools.

Once a liquidation takes place, the Backstop AMM (B.AMM) smart contract pulls the needed funds from the backstop to facilitate the liquidation and automatically puts the seized collateral for sale. Once sold, the return is deposited back to the backstop pool, and profits are accrued.

![B.Protocol's Backstop AMM High-Level System Design (B.AMM)](https://3452826419-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdGr7n_D-cGTaeor0FV%2Fuploads%2FehqrbvOantxK5gjNxrYw%2FB.AMM%20High%20Level%20Design%20\(44\).png?alt=media\&token=7a8ef60a-ad13-421d-b559-001f04048e29)

Here's a (recap of the) call we had with the Liquity team after the launch of B.Protocol v2 integration with Liquity, summarizing the benefits of using the B.AMM for automatic rebalancing after liquidations (the recording of the full call can be watched here - <https://youtu.be/t81WxsStfD4?t=52>) -&#x20;

{% embed url="<https://www.youtube.com/watch?ab_channel=B.Protocol&v=S29A5UindjQ>" %}

An interview with CRE8R DAO covering the inception and making of B.Protocol, liquidations in DeFi, the benefits of using B.Protocol, and more -

{% embed url="<https://youtu.be/4eVHWk78c9Q?t=928>" %}

For a more updated review of B.Protocol v2 and the User-Based Backstop, you can watch this interview of Eitan Katchka, Head of Growth at B.Protocol on the FTM Alerts show.&#x20;

{% embed url="<https://youtu.be/LAzHAu5AKfQ?t=58>" %}


# RiskDAO

RiskDAO is a risk assessment and risk management service DAO initiated by B.Protocol, 1kx research arm, La-Tribu dev team, and other researchers and devs.

We’re excited to announce the launch of [RiskDAO](https://riskdao.org/) — a service DAO spearheaded by [B.Protocol](https://www.bprotocol.org/) and [1kx](https://twitter.com/1kxnetwork) that will focus on providing a new, open-source risk assessment framework and associated audits to DeFi lending and borrowing protocols as well as L1 networks.

## Why RiskDAO? <a href="#id-930a" id="id-930a"></a>

Lending, borrowing, and CDP protocols account for over 30% of DeFi’s $110B total value locked. As a dominant sector in a rapidly growing industry, it’s important that we build open-source tools and resources to make protocols safer and the risks more clear for users. Risk DAO will aim to do just that.

Tens to hundreds of millions of dollars have been wiped out or put at risk due to economic exploits and/or mismanagement of borrowing protocols, further highlighting the need for objective third-party risk assessments and frequent monitoring.

Our new methodology takes into account real-world liquidation data of popular assets from centralized exchanges, along with the price trajectory of the assets in question. We extrapolate the liquidation sizes and price trajectory to the asset we wish to analyze, and simulate the outcome based on the asset’s available DeFi liquidity. This approach eliminates most of the assumptions that are usually made in risk assessments in the DeFi ecosystem regarding user behavior during market crashes and makes it more feasible to analyze the risk of a platform, including for multichain lending platforms, where the data for user behavior is even more sparse.

## Our Services <a href="#ebf6" id="ebf6"></a>

Here’s a summary of the services we’ll offer to DeFi protocols and L1s, all of which are rendered as one-time audits, with the potential for ongoing collaboration:

* Stress tests (e.g. bad debt likelihood, liquidation performance)
* Parameter optimization (e.g. collateral factor (MCR), liquidation penalty)
* Survey of collateral risks (e.g. price oracle strength, liquidity)
* Chain-specific analysis (e.g. liquidity propagation time, block time, and gas costs)

These various aspects of a borrowing system are analyzed through an in-house risk assessment model built by B. Protocol that’s outlined in depth [here](https://medium.com/b-protocol/data-extrapolation-framework-for-risk-assessment-of-defi-lending-platforms-290945d11cb7).

## Work With Us <a href="#id-29ee" id="id-29ee"></a>

Building a new project? Looking to make your protocol more robust? Reach out on [Twitter](https://twitter.com/Risk_DAO), [Telegram](https://t.me/koltenb), or [Discord](https://discord.gg/NYyeDQDDvM) and we’ll handle the rest!

If you’re still unsure, explore what we’ve built further by reading [*Data Extrapolation Framework for Risk Assessment of DeFi Lending Platforms*](https://medium.com/b-protocol/data-extrapolation-framework-for-risk-assessment-of-defi-lending-platforms-290945d11cb7) or the full report outlining our risk analysis framework [here](https://github.com/backstop-protocol/whitepaper/blob/master/Risk%20Analysis%20Framework.pdf).

## Join Us <a href="#id-4923" id="id-4923"></a>

Last, but not least, like any new DAO **we’re looking for talented individuals**. If you’re interested in math, risk analysis, data analytics, or becoming a researcher, [**join our Discord and fill out a membership request**](https://discord.gg/NYyeDQDDvM). Specifically, we’re looking for those with skills in:

• Technical Writing (academic experience is a plus)

• Designing and implementing mathematical models

• DeFi Security

• DeFi Research and Writing

• Data Analytics

<br>


# Media Resources

Below you can find a (partial) list of talks, interviews, summits, conferences, and articles about B.Protocol.

#### To follow on all things B.Protocol you can:&#x20;

* Follow us on [Twitter](https://twitter.com/bprotocoleth)&#x20;
* Talk with the team and other community members on [Discord](https://discord.com/invite/bJ4guuw)
* Watch interviews, community calls, and tutorials over our [YouTube](https://www.youtube.com/channel/UC-CnO7vIZrGd6HgIw0U0mIQ) channel
* Join the governance discussions on the [Forum](https://forum.bprotocol.org/)
* Read more on our Medium [Blog](https://medium.com/b-protocol)
* Join r/bprotocol to keep up with everything on [Reddit](https://www.reddit.com/r/bprotocol/)
* Subscribe to B.Protocol's newsletter [*The State of DeFi Lending*](https://defilending.substack.com/)

#### Main talks, interviews, and articles:

* [CRE8R DAO](https://youtu.be/4eVHWk78c9Q) - The full interview describing the history, presence, and future of B.Protocol.
* [FTM Alerts](https://youtu.be/LAzHAu5AKfQ?t=960) - Discussing DeFi liquidations, B.Protocol and the B.AMM
* [Cointelegraph](https://cointelegraph.com/news/b-protocol-announces-v2-platform-for-defi-liquidations) - Covering B.Protocol v2 launch
* [Bankless](https://www.youtube.com/watch?v=LBaRFiIrxvs) - *Meet the Nation* Interview covering B.Protocol v1
* [Crypto Briefing](https://cryptobriefing.com/defi-project-spotlight-b-protocol-decentralized-backstop-liquidity/) - Great Spotlight article.
* [Coindesk](https://www.coindesk.com/makerdao-loans-collateralized-debt-liquidation) - Covering one of the findings made by B.Protocol.


# General

## **1. What is B.Protocol?**

B.Protocol is a multi-chain user-based backstop liquidity protocol. It aims to make lending platforms more capital efficient and stable by handling liquidations in scale, using its Backstop Automated Market Maker (B.AMM) novel design.&#x20;

B.Protocol is currently live over:

* Liquity Protocol (Ethereum mainnet)
* Hundred Finance (Arbitrum, Fantom, Polygon)
* Vesta Finance (Arbitrum)
* Fuse (Ethereum mainnet, Arbitrum - coming soon)

With B.Protocol, users (aka Backstoppers) can deposit funds into backstop pools that will be used for the liquidation process, providing liquidation profits to the backstoppers. &#x20;

While users' deposited funds are sitting idle in the backstop pool they are deposited as supply liquidity on the lending market to gain interest rates and/or liquidity mining rewards.  When liquidation is needed, the funds are used to execute the trade with 5-10% profit. Finally, a novel on-chain algorithm is used to rebalance the liquidation proceeds back to the originally deposited currency, using a price feed to avoid price impact and potential cascading liquidation events.

B.Protocol V1 incentivizes professional traders to act as keepers in MakerDAO and Compound, by letting MakerDAO and Compound users give liquidation priority to these keepers, in return for sharing the proceeds of the liquidations. This way the miners' extracted profits (MEV) go back to the users of the platform, and the platform enjoys more committed liquidators. **B.Protocol v1 is still supported but is no longer the main focus of the community and the development team.**

## **2. Who should use B.Protocol?**

### Lending platforms as well as synthetic assets, derivatives, and stable coin platforms

Tap into B.Protocol's user-based backstop and let the community pool funds towards a more efficient, transparent, and decentralized liquidations system if you want to -&#x20;

* Help your users to avoid liquidations while allowing higher capital efficiency and security.
* A decentralized and transparent liquidation ecosystem instead of dealing with, maintaining, and/or paying bot operators to secure your protocol.
* Support low liquidity, long-tail assets across multiple chains and L2s.

Ask your lending market operators today if they have already integrated B.Protocol's backstop...!

### Low-Risk Yield Strategy Seekers

If you are seeking a low-risk yield strategy that will provide returns on your stable coins in an automated and passive manner - consider one of B.Protocol's backstop pools. You can choose your favorite stables across different chains and L2s B.Protocol supports.&#x20;

### Part of a DAO? Open a Fuse pool to let your community borrow against your native token

B.Protocol is integrated with Fuse (Rari Capital/ Fei/ Tribe) and offers its backstop to any new or existing pool on any EVM compatible chain. The B.Protocol DAO will join as co-admins to the manage the risk factors of the pool with your DAO, and will ensure liquidations are handled as intended with a user-based backstop integration.&#x20;

###


# Governance

### Overview

B.Protocol is governed by the BPRO token (<https://etherscan.io/token/0xbbbbbbb5aa847a2003fbc6b5c16df0bd1e725f61>). Via Compound's Governor Bravo governance module, the token holders control the protocol parameters, and/or delegate the control to a community multisig.

Governance discussions are taking place in the [forum](https://forum.bprotocol.org/) and over [Discord](https://discord.gg/bJ4guuw).&#x20;

Off-chain votes and signaling are carried out on [Snapshot](https://snapshot.org/#/bpro.eth).&#x20;

On-chain votes are possible via [Vote with Tally](https://www.withtally.com/governance/bprotocol).

### Token distribution details

BPRO token was launched by the community with a total supply of 1M tokens, and with a 4 years emission schedule, after which, 10M tokens will be in circulation. The first 1M tokens were given to the early users of the platform, and subsequently, 250k additional BPRO were given during the first liquidity mining program that lasted for 3 months, till the end of July 2021.

Over the course of 4 years, 3.333M BPRO will be distributed to the developers of the platform. The Genesis backstop liquidators will be incentivized with a total of 150k BPRO over a period of 1 year.

The remaining 5.266M BPRO will be under the control of the governance, accumulated in the DAO Reserve account, and will be used however the DAO sees fit.

When the 4 years distribution schedule ends, the DAO will be able to decide on a new distribution schedule.

##


# Ecosystem

B.Protocol is integrating and collaborating with some of the leading protocols and tools in DeFi.

![](https://3452826419-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdGr7n_D-cGTaeor0FV%2Fuploads%2FUA0ldKyN1ASDZE96tmzI%2Fecosystem%20updated.png?alt=media\&token=eaa23e10-7542-43fe-895a-018bf088f9f0)

* 88mph
* Abracadabra
* Chainlink
* Compound
* [DeBank](https://debank.com/projects/bprotocol)
* [DeFi Llama](https://defillama.com/protocol/b.protocol)
* [DeFi Pulse](https://defipulse.com/b.protocol)
* [DeFi Saver](https://app.defisaver.com/)
* EPNS
* Freely Finance
* [Furucombo](https://furucombo.app/explore)
* Gelato
* Hats Finance
* [Immunefi](https://immunefi.com/bounty/bprotocol/)
* Instadapp
* Kyber Network
* Liquity
* MakerDAO
* [Nsure Network](https://app.nsure.network/#/start_list/underwriting/)
* Paraswap
* [Pickle Finance](https://app.pickle.finance/jars)
* [Zapper](<https://zapper.fi/dashboard >)
* [Zerion](https://app.zerion.io/invest/asset/BPRO-0xbbbbbbb5aa847a2003fbc6b5c16df0bd1e725f61)


# User Guides

**Users can find easy-to-follow tutorials on how to interact with B.Protocol also on our** [**YouTube channel**](https://www.youtube.com/playlist?list=PLaIppVUfimLPVB088d3F5XnlUqBBaqYYF)**.**

{% embed url="<https://www.youtube.com/watch?ab_channel=B.Protocol&index=2&list=PLaIppVUfimLPVB088d3F5XnlUqBBaqYYF&v=XA54sQo440E>" %}
Vesta Finance
{% endembed %}

{% embed url="<https://www.youtube.com/watch?ab_channel=DeFiDoodle&index=1&list=PLaIppVUfimLPVB088d3F5XnlUqBBaqYYF&v=2eJDWsLP250>" %}
Liquity
{% endembed %}

### Written Tutorials

Liquity - <https://medium.com/b-protocol/b-protocol-liquity-integration-user-guide-b059db0f9672>&#x20;

Vesta - <https://medium.com/b-protocol/b-protocol-vesta-integration-is-live-3f5173169de7>&#x20;


# Liquity User Guide

A step-by-step guide for users on the B.Protocol-Liquity integration

![](https://cdn-images-1.medium.com/max/1200/1*eZJCLFuT9UsXv3pkUALA8A.png)

[B.Protocol v2](https://app.bprotocol.org/liquity) has launched its first integration on top of [Liquity](https://twitter.com/bprotocoleth/status/1422476042678251526?s=20) to enable automatic rebalancing of users’ positions in Liquity Stability Pool once liquidations are taking place.

This means that once a Liquity Trove is being liquidated and its ETH is being seized in return for paying its debt with LUSD from the Stability Pool, the seized ETH will be automatically sold back into LUSD, using [B.AMM](https://medium.com/b-protocol/b-amm-efficient-automated-market-maker-for-defi-liquidations-fea7b0fdc0c5) (the Backstop AMM which is the core unit of B.Protocol v2).

Though B.Protocol is using the same UI Liquity has across most of its different frontends, this step-by-step guide will walk you through the main steps of how to use this integration in case this is your first time using Liquity. \
Please pay attention that in B.Protocol there is no option to open a Trove (e.g. deposit ETH and mint LUSD), and the work assumption here is that users already have obtained LUSD and are looking to deposit it into the Stability Pool.

![Connect B.Protocol on MetaMask](https://cdn-images-1.medium.com/max/1200/1*vOwssA_bfMAUDjevl2DOIw.png)

First step would be to **connect MetaMask** to the Liquity app integration on B.Protocol — <https://app.bprotocol.org/liquity>

Make sure to connect with the same account where you keep your LUSD.

![](https://cdn-images-1.medium.com/max/1200/1*bCUU0QKsTBz3FvCiExpMWA.png)

Once your MetaMask is connected you can **Deposit LUSD** into Liquity Stability Pool. B.Protocol pools users funds so you can see how much of Liquity’s pool is managed by B.Protocol on the left box (32.9m LUSD, which are 6.9% of Liquity’s pool at the time of writing).

You can also see the current LQTY APR, which is the reward token distributed by the Liquity protocol for users who deposit LUSD in the Stability Pool. It’s worth mentioning that **B.Protocol does not take any cut of the LQTY rewards**, which means users get 100% kickback rate for their deposits.

<img src="https://cdn-images-1.medium.com/max/800/1*xl2c96qR9Jg1cVTSDwGxbw.png" alt="" data-size="original">![](https://cdn-images-1.medium.com/max/600/1*b_4m0x_q_yoS1dInLMgN2A.png)

&#x20;                           *You would need to confirm the transaction on MetaMask*

Unlike in other frontends for Liquity, in B.Protocol you would need to **Unlock** your LUSD on MetaMask before you can deposit into the stability pool. This is not different than any of the “regular” allowance users need to give to new tokens on Compound, Uniswap etc. Once you unlock on MetaMask, you will be able to deposit your LUSD. You can use the MAX button to deposit all of your current LUSD balance.

![](https://cdn-images-1.medium.com/max/800/1*ukYraX5ayndcv0lMen963A.png)![](https://cdn-images-1.medium.com/max/600/1*SWUz6BmB1DPF2nmg0c8Pfg.png)

&#x20;                               *Withdrawing is made by Adjusting your LUSD deposit amount*

If you want to **Withdraw** your LUSD from the Stability Pool, you need to **Adjust** your current deposit, stating how much you want to have in the pool. So to withdraw 100% of your LUSD you would need to adjust your deposit to 0 LUSD. The tool tip at the bottom of the box will show you how much you are withdrawing and what impact it has on your share in the stability pool. Withdrawing will also automatically claim your LQTY rewards.

![](https://cdn-images-1.medium.com/max/800/1*MMw7kggmgI-_mbkf0I0ZCw.png)![](https://cdn-images-1.medium.com/max/600/1*lLg8QU9y6JylNIo6y_eGnA.png)

&#x20;                                                 *Stake your LQTY for more rewards*

Users can stake their LQTY in order to get their share in Liquity’s protocol fees. Staking your LQTY is the same as in any other Liquity frontend and doesn’t include any B.Protocol wrapper around it (like it’s done in the LUSD deposits).

You can read more about Liquity Stability Pool in their docs — <https://docs.liquity.org/faq/stability-pool-and-liquidations>.

Watch the live call the B.Protocol team had with the Liquity team after the launch, where there is also a short demo of the integration — 

{% embed url="<https://www.youtube.com/watch?v=t81WxsStfD4>" %}


# MakerDAO User Guide

Whether you are a DeFi Chad or new to the world of Decentralized Finance — this guide will walk you through the B.Protocol-MakerDAO integration to get you started in a few clicks.

1\. Head over to <https://app.bprotocol.org/app> and open your MetaMask. Click the **“Connect”** button on the top right corner of the B.protocol app to connect your ETH account to B.Protocol using MetaMask.

![Connect](https://miro.medium.com/max/700/0*HJiW6YWE7koiwXJa)

2\. If you have a MakerDAO ETH-A/ ETH-B/ ETH-C or WBTC-A Vault connected to this account, you will see an **“Import”** button on the top left corner. Below the button, you can see the current balance of your Vault (ETH/WBTC locked vs Dai debt). With one click you can import your Vault to be managed by B.Protocol

![Import](https://miro.medium.com/max/700/0*amcTPiKxU2NlPqWB)

3\. You will have to confirm the Import. The Import operation is a single Ethereum transaction and could take up to a few minutes, depending on gas and network congestion.

![](https://miro.medium.com/max/700/0*ccuePi4aIQ18rH_B)

4\. Once imported, Your Vault on MakerDAO’s Oasis will show zero balance, but you will be able to Deposit/ Withdraw your ETH or WBTC, and Borrow/ Repay your Dai debt on the B.Protocol app as well as on other DeFi interfaces such as [Zapper](https://zapper.fi/dashboard) and others.

5\. If you want to open a new Vault (currently B.Protocol supports only the ETH-A/B/C and WBTC-A Vaults) — once your MetaMask is connected to B.Protocol you can Deposit ETH or WBTC and Borrow Dai in the exact same way as you would do on MakerDAO’s Oasis (with a bit more simplified UX).

In order to Borrow Dai, first you need to Deposit ETH or WBTC according to your Vault type. Pay attention that there is a minimum of a 5000–15,000 Dai (aka Dust) to borrow and a 130%-150% collateralization ratio that dictates the amount of ETH you need to deposit and the amount of Dai you can borrow against it.

You can learn more about MakerDAO’s Vaults here — <https://community-development.makerdao.com/en/faqs/vault/>

![Deposit ETH or WBTC](https://miro.medium.com/max/3200/0*Rt6f0i-ft8bhp3uG)

![Borrow DAI](https://miro.medium.com/max/3828/1*kaiBbWA3JpzSHNiAuTiwdw.png)

6\. When you want to pay back your Dai debt you would need to unlock your Dai. This will prompt a MetaMask confirmation

![Repay Dai](https://miro.medium.com/max/1400/0*mDOMvVmnd7PUwsQK)

7\. You can Use ‘Set Max’ to repay your full debt. As there are stability fees on MakerDAO, you will need to pay more Dai than you have borrowed in order to close your loan. If you haven’t made sure your Dai balance in your connected MetaMask account is higher than your debt, you will get a notification alert that your Dai balance isn’t sufficient to pay back the entire debt.

![SET MAX may prompt an alert when you don’t have sufficient Dai balance to close your loan](https://miro.medium.com/max/700/0*vYCaby6ztAY9QLOC)

8\. Once you click Repay you will have to confirm the transaction on MetaMask.

![](https://miro.medium.com/max/700/0*u9IhwoL0npInXvBS)

B.Protocol users are rewarded also with BPRO tokens, B.Protocol governance tokens. Your BPRO rewards will keep increasing according to the current liquidity mining program in place. You can check the current liquidity mining status on the B.Protocol [forum](https://forum.bprotocol.org/) or [Discord](https://discord.gg/bJ4guuw).

A user’s part in the Jar, where liquidation proceeds are being kept (separately for each platform), is calculated according to a User mScore and cScore (for MakerDAO and Compound respectively). The Score is non transferrable and is being distributed according to a 80/20 ratio between debt and deposits.

For any further support, or if you just want to jump into the on-going discussion — please join our Discord — <https://discord.gg/bJ4guuw>.


# Compound User Guide

This is a step-by-step tutorial on how to Import your Compound account into B.Protocol, as well as how to open and use a new account.

### Connect <a href="#caaa" id="caaa"></a>

Head over to <https://app.bprotocol.org/compound> and make sure your MetaMask is connected. Click the **“Connect”** button on the top right corner of the B.protocol app to connect your MetaMask account to B.Protocol. If you already have an account on Compound, make sure to connect your MetaMask with the same account used for Compound in order to be able to use the **Import** widget.

![Connect with MetaMask](https://miro.medium.com/max/2000/1*EYzAPC4Z8gvvpOWrQEjtxQ.png)

### Import <a href="#id-7dd3" id="id-7dd3"></a>

Once you have connected your MetaMask on B.Protocol, if you have a Compound account connected to the same MetaMask account, you will see an **“Import”** button on the top left corner.

![Import your Compound account to B.Protocol](https://miro.medium.com/max/2000/1*AmiB98AjkNKIeGh67j1NgQ.png)

Once you click the **Import** button, a widget will open where you will be able to see your deposits and borrowing balances on the Compound account to be imported. You will have to **Unlock** each of the supplied tokens separately (using the radio button next to each token) and **Confirm** it on MetaMask before the Import transaction could be made. The Import operation itself is a single Ethereum transaction and could take up to a few minutes, depending on gas and network congestion. Your $COMP balance will be imported as well of course.

![Unlock and Confirm each supplied token before Import](https://miro.medium.com/max/2000/1*Qu234RhAD5iZnChI2-d4WA.png)

Once imported, your account on [*app.compound.finance*](https://app.compound.finance/) will show zero balance, but you will be able to see your balance, Deposit/ Withdraw, as well as Borrow/ Repay any of the tokens available on Compound, as well as claim your COMP via your B.Protocol account.

> **Using B.Protocol will give you the exact same conditions as using Compound directly (same APYs, collateral factors, liquidation penalty, COMP distribution rate, etc.), PLUS you will start gaining cScore — the B.Protocol score for Compound integration. Your cScore will determine your part in the Liquidation cJar.**\
> **According to B.Protocol governance decisions and the current Liquidity Mining program, users might be entitled for $BPRO rewards, the B.Protocol governance token. Users can follow the status of these on the forum or on Discord**

![B.Protocol account](https://miro.medium.com/max/2000/1*aUifR7eJNTBf-p4PuILesQ.png)

### New Compound Users <a href="#id-3721" id="id-3721"></a>

In case you don’t have an account on Compound, or prefer opening a new account via B.Protocol, you can supply token(s) and get interest rates on them. Once you have deposited a token as collateral, you can also borrow tokens from the list and use them for whatever purpose you want. Borrowing will accrue borrowing interest fees you will have to pay once Repaying your loan. Interest rates (APY) are the same as on Compound, both for Supplied and for Borrowed tokens.

You will find that all actions on Compound are the same on B.Protocol (only with a more stunning and convenient UI if we may say…).

### Deposit and Borrow <a href="#id-6d66" id="id-6d66"></a>

In order to borrow a token, you first need to **Deposit** some collateral. Depositing a new token will demand first to **Unlock** it (and confirm it on MetaMask). Once the token you want to deposit is unlocked you can enter the amount you would like to Deposit. Using **SET MAX** will deposit the current balance you hold in your wallet of this specific token into your account. For the deposit to happen you need to confirm the transaction on MetaMask.

![Deposit DAI into your account](https://miro.medium.com/max/2000/1*IFY75K2NiOVbK89HHr9VXA.png)

Once you have deposited one (or more) tokens as collateral, your **Borrow Limit** will show you how much you can borrow in USD values according to the Collateral Factor of each asset as it was set by Compound (<https://compound.finance/markets>). For example, after depositing 1000 DAI you can borrow up to $750 worth of DAI or other tokens, as the CF of DAI is 75% on Compound currently.

In each action box (Deposit/Withdraw/Borrow/Reapy) you can see some data to help you make better decisions. This data currently includes, for each token — APY%, Balance in your account, Balance in your MetaMask wallet, the Total Deposit in your account, and a bar that shows your Borrow Limit (according to your total deposits and their collateral factors) and how much of it is currently used (in USD values).

### Repay and Withdraw <a href="#id-316e" id="id-316e"></a>

When you want to repay your loan you can do that by clicking the **Repay** button next to the token you would like to pay back. You will need to Unlock the token and confirm it on MetaMask if you haven’t done so already. You can use the **SET MAX** option to repay your full debt, but it may prompt an alert if you don’t have sufficient balance in your wallet to close your loan as you would have to cover the interest you have accrued.

![Repay using SET MAX option](https://miro.medium.com/max/2000/1*H4zVJMIwYQ2bv_GkgNR1eA.png)

When you want to **Withdraw** the collateral you have supplied, the app will let you do that as long as you are not causing your account to become unsafe, e.g. crossing your borrowing limit to a level that your account can be liquidated (having more debt than the collateral you have, as calculated by the CF). A notification will pop up in such a case.

### COMP Rewards <a href="#id-837d" id="id-837d"></a>

B.Protocol users are eligible for $COMP rewards just like if they would interact directly with Compound. Your COMP will be shown at the top of the B.Protocol app and you can claim it by clicking the **Claim COMP** button and confirming the transaction on MetaMask. The COMP will be transferred to your MetaMask wallet.

You can learn more about Compound and the distribution of COMP from the platform’s documents here — <https://compound.finance/docs>

### BPRO — B.Protocol governance token <a href="#e9dc" id="e9dc"></a>

Users of B.Protocol-Compound might be eligible for BPRO rewards according to DAO decisions which are made periodically. You can follow these over the [forum](https://forum.bprotocol.org/) or on [Discord](https://discord.gg/bJ4guuw).

### cScore — Your B.Protocol User Score <a href="#id-7e08" id="id-7e08"></a>

As long as you supply a token or have an open loan, e.g. borrowed tokens, on the B.Protocol app, you will be accumulating B.Protocol-Compound User Score — **cScore.** A user cScore determines his/her part in the cJar.

![BPRO and cScore](https://miro.medium.com/max/700/1*jr305QeZW7sGYYLA0MjEUQ.png)

The cJar holds the users’ share of the liquidations made by the Backstop on Compound (for those using B.Protocol). The Backstop liquidators transfer 3% out of the 8% discount they get on each liquidation into the cJar.&#x20;

For any further support, or if you just want to jump into the on-going discussion, please join the B.Protocol Discord — <https://discord.gg/bJ4guuw>.


# Risk Oracle

In this section, you can read the different medium posts published regarding Risk Oracle, its use cases, and how devs can start using it.

[<br>](https://medium.com/tag/risk-management?source=post_page-----a5a44bf9048b---------------risk_management-----------------)


# Economic Risk Management - The Path Towards Permissionless DeFi Lending

## Introduction <a href="#id-3411" id="id-3411"></a>

Though smart contracts security has become the main focus of any DeFi-related protocols, the passing year has proven that billions of dollars can still be wiped out without any smart contract hacks when it comes to DeFi lending activity.

The crash of Luna/UST, and the depegging of several other stablecoins, as well as “highly profitable trading strategies” on Mango markets and others, have shown that DeFi lending requires, on top of the smart contract security, a tighter **economic risk management** in order to mitigate this kind of vulnerabilities.

However, managing economic risks in DeFi is manual, complex and currently is usually done with low transparency. The lack of tools for developers to build more risk-aware dapps is yet another barrier to be crossed, which for now results in high-touch governance engagement requirements.

In this article, we will discuss how **B.Protocol’s Risk Oracle** is revolutionizing economic risk management for DeFi lending and how it can be used to pave the road for less DAO-active risk management, and eventually lead the way toward permissionless lending.

## The Challenges of Economic Risk Management in DeFi <a href="#id-6571" id="id-6571"></a>

Economic risk management in DeFi is complex, requires trust in the risk managers, and involves a lot of manual parameter updates with DAO votes. Setting the right risk parameters, such as Collateral Factors (aka Loan To Value, Liquidation Thresholds, or Collateral Ratios), lending and borrowing caps, interest rate curves, and other parameters of a lending platform can make the difference between a safe yet competitive market and a rekt one.

Lenders and borrowers **need to trust** the capabilities of the team or the DAO to manage these economic risks with the right balance. As these tasks are complex, it takes time for platforms to gain the trust of users that they can actually achieve the right balance and manage it according to the changing dynamics of the markets.

Moreover, even the most trusted lending platforms in DeFi today, who use in-house teams as well as 3rd party services for risk management, rely on off-chain reports and dashboards for their risk assessment processes which requires a lot of governance work from DAOs. This norm creates a higher barrier of entry for new platforms as younger communities usually find it harder to manage their governance processes effectively and in a timely manner.

The leading DeFi lending platforms by TVL,[ Aave](https://app.aave.com/governance/) and[ Compound](https://compound.finance/governance/proposals), had dozens (!!!) of governance votes related to risk parameters of new and listed assets during 2022. Some of them take weeks if not months to discuss and pass a vote.

Although the “ethos of DeFi” calls for full transparency, most of the available risk frameworks that are used in DeFi lending are not open-sourced. This lack of transparency makes it impossible to verify the recommended results by the platform and its dev team or DAO, which need to trust whatever calculations were made behind closed doors and private repos.

## B.Protocol’s Risk Oracle <a href="#id-22b8" id="id-22b8"></a>

[B.Protocol](https://www.bprotocol.org/)’s Risk Oracle provides **on-chain risk feeds** for DeFi platforms. Its first release provides basic risk-related data, such as an asset’s current and historic DEX liquidity and an asset’s volatility, which are published on the blockchain. Developers can embed these risk parameters directly into their smart contracts to assess in an automated and ongoing manner the risks involved with a specific asset, and the markets and pools where it is listed.

Risk Oracle is using the risk framework that was developed by[ **RiskDAO**](https://riskdao.org/), a sub-DAO that was launched by B.Protocol and other researchers and devs as a service DAO focused on risk assessment and risk management. The unique approach of RiskDAO, besides its mathematical model, was its full transparency — RiskDAO’s[ framework](https://github.com/backstop-protocol/whitepaper/blob/master/Risk%20Analysis%20Framework.pdf) is open source since launch, enabling anyone to verify the recommendations that are published on customers’ dashboards. Lending platforms such as[ Gearbox](https://gearbox.riskdao.org/#select-pool), Vesta Finance, and others have been using the services of RiskDAO to get better insights into their platform’s risk exposure while forging users’ trust in the platform.

## Use Cases for B.Protocol’s Risk Oracle <a href="#a80c" id="a80c"></a>

Lending markets are the third biggest category of applications in DeFi TVL (as recently liquid staking has crossed its TVL), and one that requires the most rigorous economic risk management. As such it is one of the key DeFi applications that can benefit from the Risk Oracle. By relying on on-chain feeds of liquidity and volatility of assets, lending markets can adjust their risk parameters, such as collateral factors and borrowing caps, with minimum need for intervention of governance processes.

A lending market DAO can pre-approve the risk parameters according to its risk appetite, and set or update the CF and caps automatically according to the changes in market conditions as they are reflected in the feeds of the Risk Oracle. Another way to reduce the governance work required for updating the risk parameters is by using the Risk Oracle for “sanity checks” of internal or external risk team recommendations. The recommendations can be executed automatically after a short time lock if they do not deviate significantly from the Risk Oracle feeds.

The Risk Oracle can also help lending markets set a barrier for listing new assets based on their risk score, reducing the risk of introducing new assets that may not be a good fit for the lending market’s desired risk exposure or setting transparent “risk trenches” for users.

You can read the way[ VMEX Finance](https://twitter.com/bprotocoleth/status/1618288057316409347?s=20) are planning to use Risk Oracle in their upcoming lending markets, or listen to the talk about this integration[ here](https://twitter.com/bprotocoleth/status/1630612496250814480?s=20).

## Conclusion <a href="#id-85bf" id="id-85bf"></a>

Economic risk management is crucial for the long-term sustainability of DeFi lending platforms. However, managing economic risks in DeFi is complex and expensive, and there is a lack of tools for developers to properly manage economic risk. B.Protocol’s Risk Oracle provides on-chain risk feeds for DeFi platforms, reducing complexity, improving transparency, and saving time and money for lending platforms, allowing users to make more informed decisions about their funds. In an upcoming series of posts, we will dive into the different aspects of risk management in DeFi lending which the Risk Oracle can improve and solve.

<br>


# The Power of Automated Decision-Making in DeFi Risk Management Processes

## Intro <a href="#dee0" id="dee0"></a>

Last week’s events, with SVB insolvency and the depegging of USDC which affected lending markets across the board, have shown once again the need for more automated, and transparent, economic risk management processes in DeFi. The rapid changes in the crypto markets make it hard for governance-savvy processes to manage the risk exposure of users in real-time and in an effective manner.

Transiting from opaque, manual risk management into an automated process that is based on quantifiable and verifiable real-time data streams, can offer a more robust framework for DeFi lending markets to manage their platforms’ risk.

In this post, we will focus on the automation aspect of Risk Oracle, and the way it helps mitigate human intervention in the risk management processes of DeFi lending platforms.

## Current state <a href="#id-5186" id="id-5186"></a>

Economic risk management in DeFi lending markets is consisted mainly of setting the right risk parameters such as collateral factors (aka LTV — Loan to Value) and liquidation thresholds of assets. Other risk management activities include setting borrowing and lending caps, effective interest curves for utilization rates, and ultimately the listing, and de-listing, of assets according to their risk profiles.

Today these processes are done manually, according to recommendations coming either from the team behind the platform or by a 3rd party hired by them, requiring the approval of the DAO through a governance vote of token holders. As crypto markets are very dynamic, the changes required to maintain the risk levels in place are quite often. During 2022, both Aave and Compound, the leading lending DeFi platforms, have made dozens of governance votes to set or adjust these risk parameters according to the changes in the market, which are mainly driven by changes in liquidity or volatility of assets, or by the depegging of a stablecoin.

Though DeFi can harness the transparency nature of blockchains to offer much tighter risk management than SVB or Credit Suisse can, last week’s events have shown also how hard a task is for DAO governance processes to keep track of the rapid changes in crypto market conditions. As USDC plunged below 88 cents and re-gained its peg within roughly 48 hours, risk parameters had to be adjusted and re-adjusted frequently according to market reactions. But as each of these changes goes through a forum post, community discussions, on-chain vote, and time-locks before the vote is executed (assuming the vote reached quorum) — platforms couldn’t keep up with the pace of the market, exposing its users to potentially excessive risks than intended by its gatekeepers.

## Automation of risk management <a href="#id-6401" id="id-6401"></a>

What if the decision-making process of adjusting these risk parameters could have been automated to keep track of market dynamics to give safer grounds to lenders and borrowers while minimizing the human intervention required in the process?

There are two separate issues with managing risk in DeFi:

1. The framework that is used to assess the risk and recommend the right parameters.
2. The processes which are required to execute these changes.

We’ll focus on the first part in another post, though it’s worth mentioning that most risk frameworks used today in DeFi are not open-source which makes it hard to verify the calculations that were made for the given recommendations.

As for the process — a way to make more hands-off adjustments of risk parameters, e.g. setting the collateral factor and liquidation threshold of an asset, is to base it on on-chain feeds of risk data such as the liquidity and volatility of assets.

> *By providing real-time, verifiable, streams of an asset’s liquidity available on-chain, a smart contract can automatically adjust the CF and LT in a gradual way in response to the current market condition. It would still need a template to “crunch” the data into specific risk parameters, but once this is available, a DAO can agree in advance on the template and its methodology and set the right parameters according to the liquidity and volatility feeds of an asset — alleviating most of the governance processes required to adjust its risk parameters.*

[**Risk Oracle**](https://medium.com/b-protocol/the-case-for-an-on-chain-risk-oracle-a5a44bf9048b) is setting the ground to do exactly this by providing on-chain feeds of liquidity and volatility of assets, that DAOs and risk teams can use to embed into their platform’s smart contracts to make their economic risk management process more automated and less governance-heavy.

Keeping the process automated, besides being more cost-effective, dictates a pre-defined and transparent set of rules. The automatic execution of this rulebook guarantees the decision-making process to be executed as intended, regardless of the “politics” around specific situations the platform may encounter due to changes in market conditions.

## USDC Depegging Case Study <a href="#efa0" id="efa0"></a>

The abrupt depegging of USDC after the insolvency of SVB forced the Aave DAO, like all other lending platforms, to take some fast decisions and adjust some of its platform’s risk parameters to keep users on the safe side and minimize the accumulation of bad debt.

Aave has a few parties managing its risk and the initial [recommendations](https://governance.aave.com/t/arc-stablecoin-volatility-risk-parameter-recomendations/12241/3) came out fast, suggesting to pause the platform due to the new market conditions. Others have suggested different proposals, and it took a few hours of online discussions to decide on one course of action. You can track the timeline of events [here](https://governance.aave.com/t/aave-resilient-through-usdc-volatility/12330).

Had Aave used a risk oracle, the recommendations coming out of the initial simulation would have been self-executed immediately, both on pausing the markets, and re-activating them once market conditions recovered and the risk framework used to assess the risk would approve it.

MakerDAO governance process was also lagging behind the pace of events during the USDC depegging event, with some risk-preventing [votes](https://vote.makerdao.com/executive/template-executive-vote-emergency-parameter-changes-march-11-2023#proposal-detail) being executed after USDC had already re-gained its peg due to timelocks and governance process time.

<figure><img src="https://miro.medium.com/v2/resize:fit:560/0*EQjf2X28wGSj5Et2" alt=""><figcaption><p>MakerDAO governance lagging behind the crypto market pace</p></figcaption></figure>

## Challenges <a href="#f02d" id="f02d"></a>

Just like professional market makers might perform better than Uniswap, the Automated Market Maker option enabled a deterministic set of rules (or algorithms) to be run by a self-executing smart contract — minimizing, and eventually eliminating, human intervention in the process, for better or worse.

Risk Oracle takes the same perspective toward DeFi lending protocols, where risk management is a core aspect of the success of the platform — and the safety of its users. Though there might be cases where human intervention for decision-making will still be required, the Pareto principle is probably true here as well — automation can eliminate 80% of the governance processes that are required for risk management in DAOs, and over time it can grow gradually to cover nearly 100%. In the meanwhile, the automated rulebook can include the conditions where the DAO should get involved and make decisions manually.

## Conclusion <a href="#id-74f4" id="id-74f4"></a>

Automating the risk management of DeFi lending platforms using a risk oracle can add transparency to the decision-making process while verifying it will be self-executed in real time as intended. By minimizing human intervention that might withhold “pressing the button” due to political outcomes of the pre-determined required action, DAOs can make sure their platform and their users are being guarded without favoring any specific stakeholder.

If we envision an on-chain, self-executing future, we should thrive to build the solutions that can get us there. A Risk Oracle for DeFi lending protocols is taking us a step closer to that goal.


# Mitigating The Human Factor in DeFi Risk Management

## Intro

DeFi ethos is all about code-is-law with neutral, self-executing applications that run on the blockchain without human intervention, from DEXs to Bridges to options trading, and more. The only exception is DeFi lending markets. In lending markets, the core activity to maintain a market active and safe is by setting and adjusting its risk parameters — an activity that is still run manually by DAO votes.

Setting the right risk parameters, such as collateral factors (Loan To Value, LTV), liquidation thresholds, interest curves, etc., are governance-heavy as each adjustment requires token holders to vote based on forum discussions and recommendations of risk management teams.

There are a few issues with these manual decision-making processes -

1. They take time — and as the pace of crypto market dynamics is high, sometimes the decisions are time-sensitive, and governance and time-locks may expose the platform users to unintended excessive risk.
2. They are exposed to human bias — as some decisions may affect some token holders more than others, and as not many have the required knowledge and skills to analyze each recommendation, there is a risk of the decision-making being manipulated through influencers who have a stake in the results.
3. They are not self-executed — As humans are in charge of the execution, there is a risk of not executing a required decision due to politics within the governance of the protocol.

In this post, we will focus on how Risk Oracle can minimize human intervention and the politicizing of DeFi lending platforms’ risk management decision-making processes. Aligned with DeFi’s un-written ethos, an automated, self-executing smart contract can make sure the red button will be pushed when needed, as it was intended and pre-approved by the governance of the protocol.

## Manual Decision-Making <a href="#id-681c" id="id-681c"></a>

Today, lending platforms manage their economic risk manually. For those less familiar with how these systems operate here’s a simplified flow of risk management decision-making in platforms managed by a DAO -

<figure><img src="https://miro.medium.com/v2/resize:fit:560/1*F7x9NKflYRL1N8EN-z7uWQ.png" alt=""><figcaption></figcaption></figure>

These processes take time and require high participation in governance activity. Time is not always something lending platforms can afford when it comes to adjusting risk parameters as crypto market conditions change rapidly. As for governance participation, this may also be a barrier as many DAOs find it hard to reach the required quorum to pass votes (which sometimes results in a second vote, which adds to the time-sensitive issue).

## Politicized Risk Management <a href="#c626" id="c626"></a>

We have discussed in a previous [post](https://medium.com/b-protocol/the-power-of-automated-decision-making-in-defi-risk-management-processes-fa8ecd65a7ad) the problems of time-sensitive risk-related decisions to be taken under such a process and the way Risk Oracle can mitigate this risk with an automatic process. But besides time constraints there is the issue of human intervention and politics in the process.

Many factors can impact the risk exposure of users, and different user profiles can be impacted by risk adjustments in different ways according to their specific positions and assets. This situation makes the decision-making process political in nature, where the risk managers can prioritize different factors that will lead to different recommendations according to their perception of risk impacts.

<figure><img src="https://miro.medium.com/v2/resize:fit:560/1*xLRBub8crQTDoGMia8mEcw.png" alt=""><figcaption><p><strong>A Politically Biased Risk Management process</strong></p></figcaption></figure>

We term this a **“Politically Biased Risk Management”** and believe an automated, decentralized, smart contract-based solution such as Risk Oracle can mitigate and eventually prevent this risk altogether, aligning the process with the neutral, self-executing ethos of DeFi.

## The Trading System Comparison <a href="#id-0f74" id="id-0f74"></a>

In a similar way to DeFi lending risk management, a high-pressure trading environment where rapid decisions must be made, there can be a risk that political pressures or other external factors may lead traders to deviate at the last minute from the established trading plan, even if they are fully committed to executing it.

To address this issue, some hedge funds and trading firms have implemented automated trading systems that can help ensure consistent and disciplined execution of trading strategies. These systems can be programmed to follow specific rules and guidelines and to automatically execute trades based on predefined criteria in market conditions.

These automated trading systems help remove the emotional and political pressures that can sometimes interfere with manual trading and can help ensure that trades are executed consistently and according to the trading plan. They can also be backtested and optimized to improve their performance over time and can help traders make rapid decisions in volatile markets.

This automated “Politics-proof” system is also required with risk management in DeFi where market conditions can change rapidly, and the DAO decisions can be influenced by internal or external politics. Without a self-executing layer to adjust risk parameters, platforms can be exposed to excessive risk, beyond the pre-defined risk levels that were approved by the DAO as the rulebook.

## DeFi Lending Risk Management Politics <a href="#id-8c05" id="id-8c05"></a>

The term “politics” might require a bit of explanation in the context of DeFi risk management. DAOs are prone to internal politics, maybe even more than other organizational structures. Most DAOs have a relatively small amount of token holders or delegates who are active and knowledgeable enough to keep track of the required steps for proper risk management. The ability of large players to influence decision-making that might benefit some, while exposing others to risk is an ongoing reality.

> *For example, whales or VCs who hold a significant amount of a specific token can try to influence the decision-making process of listing assets as collaterals in lending markets or push for higher LTV, in order to maximize their leverage capabilities on their initial investment. As long as the risk management process is not transparent and automated, these processes might be influenced by the identity of the entity submitting the governance proposal.*

## Risk Oracle — Unleashing Non-Politicized Risk Management <a href="#id-7f6f" id="id-7f6f"></a>

Though risk-related market data such as liquidity and volatility of assets, is available on-chain, there are still no standards for how they should be collected or calculated. Even after the data is collected, there is still a need for a transparent risk framework, e.g. Templates, that “crunch” the raw data and calculate the risk parameters (CF, LT, etc) according to specific assumptions and algorithms. Once such Templates exist, platforms could choose a ready-made template, or build their own templates for listing asset requirements, adjusting risk parameters, and more according to their risk appetite and other considerations the protocol might have. The DAO that governs the protocol can then pre-approve the template that will dictate the right risk parameters according to the market data.

<figure><img src="https://miro.medium.com/v2/resize:fit:560/1*G5T_ytXtxPYKL7DGZKK_4Q.png" alt=""><figcaption><p><strong>A Non-Politicized Risk Management Process</strong></p></figcaption></figure>

Risk Oracle’s first version will publish on-chain raw risk feeds that will include assets’ liquidity and volatility. Community members and devs could then use this on-chain risk data in their risk templates to calculate relevant risk parameters for lending markets. The template can enable automatic adjustments of the risk parameters according to the risk oracle feeds.

> ***By approving a risk framework template, a DAO will not only enable the automation of the process, but will also dictate a single rulebook for listing assets, setting collateral factors, adjusting parameters in an ongoing and gradual manner according to changes in market conditions, and much more.***

## Challenges <a href="#d1c9" id="d1c9"></a>

Of course, automated systems are not a panacea, and they can also be subject to technical glitches, errors in programming, or other issues that can lead to unintended outcomes. It’s also important for risk managers, DAOs, and community members to continuously monitor and evaluate their automated systems to ensure that they are functioning as intended and to adjust them as needed based on changing market conditions or other factors.

To mitigate this risk, a gradual onboarding process is required, where tools like Risk Oracle start with more narrow capabilities, e.g. publishing recommendations for the risk management teams to approve before execution. With time and as the system demonstrates its capabilities, it can be embedded directly into the smart contracts that set and adjust risk parameters as well as the assets’ listing process itself.

## Conclusion <a href="#id-10b4" id="id-10b4"></a>

The risk management process today in DeFi is manual and as such is prone to be influenced by internal or external politics. Risk Oracle paves the road for a transparent risk management rulebook with a self-executing layer that can enforce risk parameters adjustment in an automated way as was pre-approved by the DAO. Lending platforms can start the transition in a gradual way, setting the edge cases that require manual intervention in the process.


# V2 (B.AMM)

You can find this article also on [Medium](https://medium.com/b-protocol/b-amm-efficient-automated-market-maker-for-defi-liquidations-fea7b0fdc0c5). The original B.AMM whitepaper was first published on [IPFS](https://cloudflare-ipfs.com/ipfs/Qmb2ZMk7F48jYSwJczdJeqXJz7CZVh8H4KnfyNdHZSMRG5) and available also [here](https://github.com/backstop-protocol/whitepaper/blob/master/BAMM.pdf).

## B.AMM: Efficient Automated Market Maker for DeFi Liquidations

**Liquidations reside at the core of lending platforms, synthetic assets, derivatives and stable coins. The Backstop Automated Market Maker (B.AMM) is an automatic market maker optimized for lending platform liquidations. It is a fully autonomous smart contract and can efficiently handle liquidations of big debt with smaller capital requirements.**

B.Protocol aims to improve the liquidation process in DeFi, and to give rise to more stable systems and support higher leverage and capital efficiency.

At the initial v1 stage, with TVL that ranges between $100M-250M, we focused on trying to make the existing DeFi system more stable, by on-boarding professional liquidators who shared their profits with the users, instead of the miners. The design allowed users to get extra yield when using platforms like Maker and Compound, but did not address the capital inefficiency of the current system. Namely, users were still bound by the same poor collateral factor that Maker and Compound offer.

Last week, two of our community members posted [a novel design for a user based liquidation system](https://forum.bprotocol.org/t/b-amm-efficient-automated-market-maker-for-defi-liquidations/97). Such a system could integrate with our current v1 design, and support the liquidity given by professional traders, but also give rise to a v2 system that will facilitate higher leveraged loans in DeFi.

In this blog post we summarize the 11 page [whitepaper](https://cloudflare-ipfs.com/ipfs/Qmb2ZMk7F48jYSwJczdJeqXJz7CZVh8H4KnfyNdHZSMRG5) and try to make it more accessible to the general public.

We first describe the problem that it is trying to solve, then the proposed solution, and the initial promising experimental results.

## The problem <a href="#id-1413" id="id-1413"></a>

Decentralized lending platforms like Maker, Compound, dYdX, bZx, Aave, and others, notoriously enable a poor leverage ratio of x3-x5, despite having billions of dollars of liquidity at decentralized exchanges which can be used for liquidations at time of need.

Lending platforms are being conservative with their collateral factors (compared to CeFi systems like FTX, ByBit and others who offer x100 leverage to their users), because most of DeFi liquidity is concentrated on automated market makers (AMMs) who either (1) offer relatively high slippage w\.r.t deposited amount (e.g., Uniswap V2, Sushi, Balancer, and Bancor); or (2) offer tight spreads which can get depleted upon price changes (e.g., Uniswap V3, Kyber’s DMM).

Hence, AMMs like Uniswap V2, will fail to facilitate $20M DAI liquidation, despite having over $200M deposited inventory at its ETH/DAI pool.

This causes a negative spiral, in which lending platforms cannot offer decent leverage/higher collateral factors as they are uncertain of the liquidation results, and liquidators do not optimize their systems for anything more than arbitrages. Indeed, the paper compares liquidation volumes and expected returns on Binance Futures, which give liquidators very high yield even when they lock $200M only for liquidations. While the same amount will result in very poor APY in DeFi historical.

Some lending platforms try to mitigate this concern by keeping dedicated keepers on their payroll. This only makes the problem worse, as (1) there is no certainty on how these will execute at time of need; and (2) this solution is non-transparent, and gives rise to centralization and single point of failure.

These concerns are not only theoretical. A primary example is Maker’s Black-Thursday failed liquidation events, despite Maker’s great attempt to build a keeper’s community.

## The solution <a href="#id-18c8" id="id-18c8"></a>

The authors of the whitepaper describe a system where users provide liquidity that is used for liquidations (e.g., repay DAI debt in return to ETH collateral), and after liquidation happens, an automatic re-balance process begins. The re-balance process converts the seized collateral from the liquidation, back to the original asset (e.g., the ETH collateral is converted back to DAI).

The rebalance is done by offering the collateral for sale according to the market price, which is determined according to a price oracle (e.g., Chainlink). An optional discount on market price is given according to the imbalance size (the size of collateral to sell), and the exact formula is an adaptation of Curve Finance stable swap invariant.

As user deposits are expected to sit idle for the majority of the time (when liquidations do not occur), the system will deposit it, on behalf of the users, into yield-bearing protocols, e.g., Uniswap, YFI, or Compound, and will withdraw it only to facilitate liquidations.

![](https://miro.medium.com/max/700/0*nJqTsjJ1c0l-f8n9)

## Use of Curve formula <a href="#bdbc" id="bdbc"></a>

Curve Finance AMM is using the stable swap invariant to price assets. It’s core property is that it has a target portfolio (i.e., target ratio between two or more assets) and it provides different slippage according to the distance from the target portfolio, and the bigger the target is, the bigger the slippage is.

This property makes it ideal to use the stable swap invariant for the automated rebalancing process. However, the stable swap invariant was tailored to correlated asset classes, e.g., DAI and USDT.

As our system already relies on an external price feed for the liquidation process, we can normalize all portfolio assets to their USD values, and plug it into the stable swap invariant, without additional security risk.

## Initial experimental results <a href="#id-2e5e" id="id-2e5e"></a>

The whitepaper describes a set of experiments and a way to model how the B.AMM could handle liquidations of $1B monthly.

The authors simulate liquidations during some the most 20 volatile days in Binance Futures exchange, for the ETH-USD pair.

![](https://miro.medium.com/max/700/0*dUULWE-o1fjgV3L9)

The paper defines a simulation model and suggests the B.AMM could handle such a size of liquidations with $100M-$200M capital.

![](https://miro.medium.com/max/531/1*N9nMUaIOzOvS4Bc0YeDu6Q.png)

The simulation also shows that the liquidation process can be very profitable.

![](https://miro.medium.com/max/596/1*zjYFGsafWU4HbLL2W0xbaw.png)

## B.AMM and B.Protocol <a href="#e3fa" id="e3fa"></a>

Since its launch, B.Protocol stated that its goal is to build a strong backstop for DeFi liquidations in order to let the ecosystem scale in a secure manner. The efforts were concentrated in bringing a big user base which will give priority to professional liquidators, who in turn reward the users for the given priority.

However we witnessed that even with a TVL of over $250M it was hard to on-board more liquidators. In addition, the community kept asking for a way for users to participate in the liquidation process themselves, rather than using only the professional liquidators liquidity.

Hence, it is only natural that the community will explore some user-based solutions for a stronger backstop. Such backstop could enable a set of applications, from high leverage for margin trading platforms, to synthetic assets and derivatives.

We believe B.Protocol V2 could open up a whole new variety of use-cases and collaborations in the DeFi ecosystem, to integrate B.Protocol and its backstop solution.<br>


# RiskDAO - Research & Risk Analysis For DeFi Lending Protocols

RiskDAO is a risk assessment service DAO initiated by B.Protocol and other contributors, including 1kx research arm, La Tribu dev group, and others.

You can find this article also on [Medium](https://medium.com/b-protocol/data-extrapolation-framework-for-risk-assessment-of-defi-lending-platforms-290945d11cb7). The full report can be found [here](https://github.com/backstop-protocol/whitepaper/blob/master/Risk%20Analysis%20Framework.pdf). The RiskDAO website can be found [here](<https://riskdao.org/ >).

## Data Extrapolation Framework for Risk Assessment of DeFi Lending Platforms <a href="#id-4384" id="id-4384"></a>

B.Protocol launched a risk assessment sub-DAO and engaged with it to build a risk assessment framework for DeFi lending platforms. The sub-DAO issued a comprehensive 20 page [report](https://github.com/backstop-protocol/whitepaper/blob/master/Risk%20Analysis%20Framework.pdf), and this blog post summarises their findings.

**Tldr; We introduce a new methodology for lending platforms risk assessment: real world liquidation data of popular assets from centralized exchanges is taken, along with the price trajectory of the assets. We extrapolate the liquidation sizes and price trajectory to the asset we wish to analyze, and simulate the outcome based on the asset’s available DeFi liquidity. Our approach eliminates most of the assumptions that are usually made in risk assessments in the DeFi ecosystem regarding user behaviour during market crashes, and makes it more feasible to analyze the risk of a platform prior to its launch, and for multichain lending platforms, where the data for user behaviour is even more sparse.**

## Background <a href="#id-7303" id="id-7303"></a>

DeFi lending markets manage billions of user funds, with the top 2 platforms, namely, Compound and Aave holding over $20B of crypto-assets. At their core, they allow suppliers to deposit a set of assets, and borrowers to borrow them. The permissionless nature allows anyone to be a supplier and enjoy a supplier interest rate, however it also dictates that a borrower could only borrow against a collateral, and the platform becomes (partially) insolvent when a user debt exceeds his or her collateral. An insolvency event generates bad debt which comes at the expense of supplier deposits.

To prevent insolvency, the market admin set parameters that encourage successful liquidations, and reduce the insolvency risk when liquidation process prolongs. The 3 main risk parameters are:

1. **Liquidation incentive:** liquidators execute a liquidation when they believe it is profitable. For this purpose a liquidation incentive is given, in the form of a discount over the seized collateral.
2. **Collateral factor:** If liquidations were guaranteed to be executed immediately, then the needed over-collateralization would be the size of the liquidation incentive. In practice however, liquidity crisis and blockchain congestion might delay the execution of the liquidations. Higher over-collateralization ratio compensates for the risk of default in the presence of execution latency. The collateral factor specifies a borrower’s minimum collateral requirement w\.r.t her outstanding debt.
3. **Close factor:** The close factor determines the \\% of debt that can be liquidated when the borrower does not meet the over-collateralization requirements. By definition, higher closing factors reduce the platform risk, as it enables liquidators to close bigger portions of the borrower position.

## New Risk Assessment Model <a href="#e8fa" id="e8fa"></a>

Existing risk assessment models (e.g., Gauntlet and MakerDAO risk unit) try to simulate how borrowers will react to price movements and will close their debt on time prior to being liquidated. This model is hard to scale, as the data on DeFi user behaviour is relatively sparse.

We take a different approach, and instead, take liquidation data from centralised venues, which have more substantial liquidation history. We also take the price trajectory after liquidations, from the real world market price at the time of liquidations.

Finally, for assets that are not featured in the centralised futures market, we simply extrapolate the price movement according to their historical price volatility. In the figure below, we depict the simulated prices of 6 assets with different volatility levels (0.5–3). Where the real price is the price of the asset with volatility 1 (in green).

![Simulated price trajectories of assets with volatility 0.5–3](https://miro.medium.com/max/1400/0*Q9wvKyGNqkTl8-Kq)

To simulate market liquidity, we take into account only DeFi liquidity, and assume that liquidity will flow from centralised venues to Ethereum, or from Ethereum to its L2 in a time period of 30 minutes.

During that period, liquidations can only be executed by arbitraging DEXes.

For L2s we take available liquidity from Sushiswap. Constant product market makers (such as Uniswap V2 and Sushiswap) are very appealing for risk analysis, as they provide full information about their price slippage, as depicted in the figure below.

![The available DeFi liquidity, over Arbitrum, for SPELL/ETH Sushi LP token vs ETH](https://miro.medium.com/max/1400/0*KedVL3bu2ifBmd4y)

## Backstop <a href="#id-5d09" id="id-5d09"></a>

With [B.Protocol](https://www.bprotocol.org/)’s backstop, users provide liquidity that is used for liquidations (e.g., repay USDC debt in return to ETH collateral), and after liquidation happens, an automatic re-balance process begins. The re-balance process converts the seized collateral back to the original asset (e.g., the ETH collateral is converted back to USDC). The rebalance is done by offering the collateral for sale according to the market price, which is determined according to a price oracle. An optional discount on market price is given according to the imbalance size (the size of collateral to sell), and the exact formula is depicted in B.Protocol’s Backstop Automated Market Maker (B.AMM) whitepaper. In the backstop latest architecture, as user deposits are expected to sit idle for the majority of the time (when liquidations do not occur), the system will deposit it, on behalf of the users, to the lending market where it is used for supply, and will withdraw it only to facilitate liquidations.

See an illustration in the figure below.

![B.Protocol backstop high-level system design](https://miro.medium.com/max/1400/0*ePJtwQs0LxDezuFv)

The developed risk framework can also simulate how the lending market will perform when it has a backstop.

In the next figure, the x axis is the ratio between the backstop size and total market supply (BCR). The y axis is the ratio between monthly liquidation volume, and total market supply (SCLR). The result is the maximum bad debt of a single account during the 12 month simulation (in %).

The simulation depicted below was performed for the SPELL/ETH Sushi LP token, vs ETH as a debt asset, over Arbitrum L2 network.

![Simulation results](https://miro.medium.com/max/1400/1*PR64OUvM9kVxuqEFa_2aoA.png)

The simulations show that without a backstop, at least one position generated 32% of bad debt, and thus if the liquidation incentive is 10%, any collateral factor (LTV) higher than 58% would result in simulated bad debt. With a backstop as small as 10% of the collateral size, even a collateral factor of 90% would not have simulated a bad debt.

You can read the full report here - <https://github.com/backstop-protocol/whitepaper/blob/master/Risk%20Analysis%20Framework.pdf> <br>


# V1 (deprecated)

Below is the original white paper of B.Protocol v1, released in June 2020.

## B.Protocol — A Decentralized Backstop Liquidity Protocol <a href="#a88e" id="a88e"></a>

**B.Protocol makes lending platforms more stable by incentivizing liquidity providers (keepers) to commit on liquidation of under collateralized loans and shift the miners extracted profits back to the users of the platform.**

You can find this article also on [Medium](https://medium.com/b-protocol/b-protocol-b6dd4e3bf9c0).

## Introduction <a href="#id-0c1d" id="id-0c1d"></a>

Decentralized lending platforms, e.g., Compound, MakerDAO, Aave, and dYdX, are gaining wide popularity in recent years, but suffer from three major drawbacks:

1\. Low yield on user deposits.

2\. Lack of commitment from the liquidators who are responsible for the underlying security of the lending platform.

3\. A big part of the lending protocol value is taken by the underlying blockchain miners due to gas wars between liquidators who “fight” for undertaking borrowers' under-collateralized loans.

In this post, we introduce B-Protocol, a decentralized backstop liquidity protocol, where backstop liquidity providers (BLP) buy their right to liquidate under-collateralized loans and share their profits with the users of the platform. As a result, the users (borrowers and lenders) receive additional **yield** to their usual interest rate. The proposed mechanism eliminates the need for gas wars between liquidators, and thus transfers a big part of the protocol value back to the borrowers and lenders, which in turn improves their effective interest rate.

In the next section, we bring the necessary background on how liquidations currently work over existing lending platforms like Compound and MakerDAO. In the subsequent section, we present how B-Protocol is built atop those existing platforms, and in the final section, we depict the advantages of our approach to users, liquidators, and the platforms.

## DeFi Lending Platforms and Liquidations <a href="#ef75" id="ef75"></a>

Users interact with lending platforms by supplying (depositing) collaterals and borrowing (withdrawing) assets to and from the platform. A user account is *undercollateralized* if his total loan exceeds his total collateral (multiplied by an asset-specific collateral factor). Once an account is undercollateralized, a liquidation process is done by giving the liquidator the borrower’s collateral at a discount price, and the liquidator will be the first Ethereum account to call a liquidation function in the platform’s smart contract.

This approach gives rise to **gas** **price** **wars** where Ethereum accounts compete on who will give the highest gas price for the liquidation transaction, in order to get higher priority among miners who decide the order of transactions.

![](https://miro.medium.com/max/700/0*zckI3L8cKROT9pOc)

As a result, great value is shifted away from the platform users (i.e., borrowers and lenders) to the Ethereum miners, and to blockchain developers who craft sophisticated optimizations to increase the likelihood of winning and reduce the cost of a loss.

These gas wars add another layer of cost uncertainty for the liquidators, one that they are not used to when they are doing liquidations on centralized platforms like Kraken and FTX

[***Ori Cohen***](https://medium.com/efficient-frontier/from-international-high-frequency-trading-to-the-trenches-of-crypto-b595bd1da563) *has 20 years of algo-trading experience in the traditional markets, now Head of Research @ **Efficient Frontier** which is a leading technology and research company facilitating digital asset trading and powering billions in annual trade.* He says *-*&#x20;

> *For decades quants have learned how to estimate the likelihood of defaults, however,* *gas wars and elusive network topology make it impossible for me to model the liquidation success ratio over DeFi platforms. This uncertainty might deter big players from providing liquidity for lending platforms.*

This deters even experienced DeFi players from building liquidation systems, despite the fact that most of their capital is already kept on-chain.

> *Gas Wars are killing the LPs, B-Protocol is a much-needed protocol.”*

***Spyros Vretos**, Head of Trading at Kyber Network, the leading liquidity provider protocol in the Ethereum (DeFi) ecosystem.*

## Decentralized Backstop Protocol <a href="#b77b" id="b77b"></a>

The B-Protocol is a protocol where liquidators share their profits with the users of the platform in return to a *franchise* which gives a priority in the liquidation process. A periodic auction process is being done to determine the franchise winners. Where during the auction liquidators bid on the percentage of profit sharing. These profits go to a *jar* which is periodically distributed to users according to their rating.

It is our belief that for the long run liquidators will be willing to pay more than just the expenses they currently have on gas wars, since the certainty of the franchise would lower their desired minimum profit on liquidations.&#x20;

> *The difficulty in mathematically modeling transaction ordering outcomes adds a layer of model uncertainty for competing liquidators, contributing an extra risk spread to on-chain liquidation premia, in addition to the MEV (Miner extractable value) spread due to the cost of the gas auctions themselves.* [***Lev Livnev***](http://lev.liv.nev.org.uk/)*,* **founding partner of Symbolic Capital Partners**

As a result, not only most of the miner’s profits are routed back to the users, but also the underlying lending platforms enjoy a bigger commitment from the winners of the auction, and thus get better protection when extreme market conditions occur.

> *Backstop certainty will allow me to better organize, manage and allocate more funds towards future liquidations and as a result utilize my inventory much more efficiently.* \
> ***Spyros Vretos**, **Head of Trading at Kyber Network***

We integrate B-Protocol with existing lending platforms by letting the users interact with the lending platforms via a dedicated smart contract interface. And B-Protocol liquidators get a priority in the liquidation process by providing a cushion to the user account when it is getting close to the liquidation price.

The below diagram shows how B-Protocol is built atop Compound. The protocol API to end-user is identical to Compound’s API, and the only difference is that the users are interacting with different addresses. Liquidators provide the cushion with a top-up operation, and a scoring engine updates the user rating whenever he performs an operation. The user rewards are kept in a Jar that is distributed according to the user rating.

![B.Protocol - Compound Integration Architecture](https://miro.medium.com/max/700/1*7XszzRJ7ziVFbQFXZFqe_Q.jpeg)

The next diagram depicts an interaction between the user, the underlying lending platform, and the liquidators. In the described scenario user borrows 100 DAI when ETH price is $200, and as the price goes down, the liquidity provider (LP) provides a cushion to the user debt. Finally, when the price of ETH hits the liquidation price, the LP liquidates the user on B-Protocol smart contracts and share the profit with the Jar (which later will share it with the users of the platform).

![](https://miro.medium.com/max/700/1*YuM4G-4Qry2UrMRprRzEqg.png)

## Conclusion <a href="#id-6d2b" id="id-6d2b"></a>

B-Protocol gives better security guarantees to its underlying lending platforms, better yield to its users, and higher income to its liquidity providers. All without changing anything in the underlying lending platforms. This is achieved by a design choice to shift the arbitration power on who will be the liquidator, from the miners to a smart contract that implements a crypto-economic mechanism, to decide who is the best fit to hold the liquidation franchise. Shifting the decision from miners to a smart contract eliminates the liquidators gas war costs, and gives them much more certainty. Which in turn allows the liquidators to share some of their profits with the users, and make the lending platforms more secure, as the liquidators are now more committed.

We currently build B-Protocol around the three leading lending platforms, namely, Compound, Makerdao, and Aave. In the future, our system will have a standard abstracted layer that will allow seamless integration with all lending platforms.

**Website:** [https://bprotocol.org](https://bprotocol.org/)

**Github:** <https://github.com/backstop-protocol>


# Smart Contracts


# BPRO Token

The BPRO governance token is a mintable token, and the distribution schedule for the first 4 years was fixed by the community. It controls the protocol parameters via Governor Bravo DAO.

## Code base

#### [Github Repository](https://github.com/backstop-protocol/BPRO)

## Contract Addresses

| Name                                                                                                            | Address                                    |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| BPRO token                                                                                                      | 0xbbBBBBB5AA847A2003fbC6b5C16DF0Bd1E725f61 |
| Minter                                                                                                          | 0x20fe0eadbAfCA5458E129Bb3cCA303776165b371 |
| Governance Bravo                                                                                                | 0xbbBBBb512661E9A574A8A3E8c12AfAf647E98809 |
| DAO Reservoir                                                                                                   | 0xcC09c04A9e3930343290184544F97669eFF18A8d |
| Development Reservoir                                                                                           | 0x225f27022a50aF2735287262a47bdacA2315a43E |
| Backstop Reservoir                                                                                              | 0x63D7642F14f012063764BAc5aaB1CAF6c0771164 |
| Liquidity Mining Wallet (depleted)                                                                              | 0x11B20aEF260837Cd82D3d8099aF46a2B6D66e20C |
| [BIP #3 Vault](https://forum.bprotocol.org/t/bip-3-allocating-bpro-to-reward-v2-native-integrations/166)        | 0xb03927FF2880C3f89f561d8d9c3f7EDF52A0bBB2 |
| [BIP #4 Vault](https://forum.bprotocol.org/t/bip-4-use-umas-kpi-options-program-for-users-liquidity-mining/167) | 0x3328D5b2CabDF25a9AaD31Ae52f660398c54b6cE |
| [BIP #5 Vault](https://forum.bprotocol.org/t/bip-5-growth-squad-fund/168)                                       | 0xC507A27860C225aaD8CB4a5A32a44d8892288880 |
| [BIP #6 Vault](https://forum.bprotocol.org/t/bip-6-backing-b-protocol-immunefi-bug-bounty-program/169)          | 0x9F69BE585d0E635a846df7db15Ad6f7741a9843A |


# B.MakerDAO

The B.MakerDAO implementation is fully interface compatible with MakerDAO's original CdpManager. With BCdpManager taking the role of CdpManager.

## Code base

#### [Github Repository](https://github.com/backstop-protocol/dss-cdp-manager)

## Contract Addresses

| Name          | Address                                         |
| ------------- | ----------------------------------------------- |
| BCdpManager   | 0x3f30c2381CD8B917Dd96EB2f1A4F96D91324BBed      |
| BProxyActions | 0x5eAe7715D1970867E4d57C58b08e6AcF405A094d (\*) |
| Pool          | 0x5cbe121949F965472611d4B39907548598C86AF2 (\*) |

(\*) Address could change

|   |   |
| - | - |


# B.Compound

B.Compound code is fully interface compatible with the original Compound interface, with BComptroller taking the role of Compound's original Comptroller, and bToken replacing cToken role.

## Code base

#### [Github Repository](https://github.com/backstop-protocol/BCompound)

## Contract Addresses

| Name         | Address                                         |
| ------------ | ----------------------------------------------- |
| Registery    | 0xbF698dF5591CaF546a7E087f5806E216aFED666A      |
| BComptroller | 0x9dB10B9429989cC13408d7368644D4A1CB704ea3      |
| Pool         | 0xc9756AEd008b7A083d80c878139BdA9Ec0D293F5 (\*) |
| AvatarImpl   | 0xf29D869Ee7ebe30FDE045d26a9146654C392EACa      |
| bBAT         | 0x7776a65d70465bd598ca7e177d7CB62025e5c448      |
| bComp        | 0x930F1d6616de5E5765919863D59354bB3332fB04      |
| bDAI         | 0x0b1B0Aa805e48af767a6ec033984f9d7bffb56dd      |
| bETH         | 0x2acf65206bA29E0245B57a5D556Af7340B62eeb5      |
| bLINK        | 0x9Edf78ba1d0D6B30dAEb0244Bd59e287a631cEA8      |
| bTUSD        | 0x1caAE5929c2D33A6e2ba23d85FE3031954dbda70      |
| bUNI         | 0x1E7C30d49dE4dF2ac86406783ed75B210a277aa9      |
| bUSDC        | 0xc33E1541dC8C9F4BeCb4517EB1Acc5f8C67E766b      |
| bUSDT        | 0x4B17d8CAB1090A90C5e46045E6faCDB81Ca9BD65      |
| bWBTC        | 0xB6473C402116422f62Ff0ECc4B7E2b71911441AE      |
| bZRX         | 0x8c4f8f1d867f77251C1a1d470930d5F8E310e8F1      |

(\*) Address could change


# B.Liquity

The integration with Liquity only wraps its stability pool. And it is not interface compatible to the original Liquity contracts.

## Code base

#### [Github Repository](https://github.com/backstop-protocol/dev)

## Contract Addresses

<table data-header-hidden><thead><tr><th width="224.27857970709084">Address</th><th></th></tr></thead><tbody><tr><td>Name</td><td>Address</td></tr><tr><td>BAMM</td><td><a href="https://etherscan.io/address/0x00FF66AB8699AAfa050EE5EF5041D1503aa0849a">0x00FF66AB8699AAfa050EE5EF5041D1503aa0849a</a></td></tr><tr><td>BAMM (legacy)</td><td><a href="https://etherscan.io/address/0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598">0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598</a></td></tr><tr><td>PBAMM</td><td><a href="https://etherscan.io/address/0x54bC9113f1f55cdBDf221daf798dc73614f6D972">0x54bC9113f1f55cdBDf221daf798dc73614f6D972</a></td></tr><tr><td>FeePool</td><td><a href="https://etherscan.io/address/0x7095F0B91A1010c11820B4E263927835A4CF52c9">0x7095F0B91A1010c11820B4E263927835A4CF52c9</a></td></tr><tr><td>BAMM (Chicken Bonds)</td><td><a href="https://etherscan.io/address/0x896d8a30C32eAd64f2e1195C2C8E0932Be7Dc20B">0x896d8a30C32eAd64f2e1195C2C8E0932Be7Dc20B</a></td></tr></tbody></table>


# Hundred-Finance

B.Protocol provides a backstop to some of Hundred Finance markets.

## Code base

#### Arbitrum L2: [Smart contracts](https://github.com/backstop-protocol/dev/tree/hundred-finance/packages/contracts/contracts/B.Protocol)

#### Fantom chain: [Smart contracts](https://github.com/backstop-protocol/dev/tree/multi_collateral/packages/contracts/contracts/B.Protocol)

## Contract Addresses

<table data-header-hidden><thead><tr><th width="467.27777777777777">Address</th><th></th></tr></thead><tbody><tr><td>Name</td><td>Address</td></tr><tr><td>Arbitrum USDC BAMM</td><td><a href="https://arbiscan.io/address/0x04208f296039f482810B550ae0d68c3E1A5EB719">0x04208f296039f482810B550ae0d68c3E1A5EB719</a></td></tr><tr><td>Arbitrum USDC BAMM</td><td><a href="https://arbiscan.io/address/0x24099000AE45558Ce4D049ad46DDaaf71429b168">0x24099000AE45558Ce4D049ad46DDaaf71429b168</a></td></tr><tr><td>Fantom USDC BAMM</td><td><a href="https://ftmscan.com/address/0xEDC7905a491fF335685e2F2F1552541705138A3D">0xEDC7905a491fF335685e2F2F1552541705138A3D</a></td></tr><tr><td>Fantom DAI BAMM</td><td><a href="https://ftmscan.com/address/0x6d62d6Af9b82CDfA3A7d16601DDbCF8970634d22">0x6d62d6Af9b82CDfA3A7d16601DDbCF8970634d22</a></td></tr></tbody></table>


# Vesta-Finance

B.Protocol provides a backstop to some of Vesta Finance markets.

## Code base

#### [Github Repository](https://github.com/backstop-protocol/vesta-protocol-v1/tree/master/contracts/B.Protocol)

## Contract Addresses (Arbitrum)

<table data-header-hidden><thead><tr><th width="467.27777777777777">Address</th><th></th></tr></thead><tbody><tr><td>Name</td><td>Address</td></tr><tr><td>BAMM (ETH collateral)</td><td><a href="https://arbiscan.io/address/0x12c60B3170Fb43E6A8f8ba2d843621c19324329E">0x12c60B3170Fb43E6A8f8ba2d843621c19324329E</a></td></tr><tr><td>BAMM (gOHM collateral)</td><td><a href="https://arbiscan.io/address/0xebf8252756268091e523e57D293c0522B8aFe66b">0xebf8252756268091e523e57D293c0522B8aFe66b</a></td></tr><tr><td>BAMM (renBTC collateral)</td><td><a href="https://arbiscan.io/address/0x0a30963A461aa4eb4252b5a06525603E49034C41">0x0a30963A461aa4eb4252b5a06525603E49034C41</a></td></tr></tbody></table>


# Audits & Bug Bounty

## Audits

#### [MakerDAO Integration](https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Backstop%20Protocol%20%5B02.10.2020%5D.pdf) **(v1)**

[**Compound Integration**](https://github.com/solidified-platform/audits/blob/60778395ae2f78fc1caec0085bfa96c6f70c4573/Audit%20Report%20-%20B-Protocol%20%5B16.02.2021%5D.pdf) **(v1)**

[**Liquity Integration**](https://github.com/Fixed-Point-Solutions/published-work/blob/master/SmartContractAudits/FPS_B.AMM_Liquity_Assessment_FINAL.pdf)

[**Compound Compatible Platforms (Hundred, Fuse)**](https://github.com/Fixed-Point-Solutions/published-work/blob/master/SmartContractAudits/FPS_B.AMM_Rari_Assessment_FINAL.pdf)

## Immunefi Bug Bounty Program

B.Protocol has launched a bug bounty program with up to $100k of bounties. To review the program please head over to the [B.Protocol page on Immunefi](https://immunefi.com/bounty/bprotocol/).

## Hats Finance Bounty Vault

B.Protocol is collaborating with [Hats Finance](https://hats.finance/) where hackers can responsibly disclose vulnerabilities without KYC & be rewarded with prizes.


# Archive pages


# Liquidity Mining phase 2

## When? - THE PROGRAM ENDED

The 2nd LM will run for \~3 months starting September 18th - December 17 2021. \
Starting block number - 13251289\
Ending block number - 13842589

## How?

Per the DAO vote on [BIP#4](https://snapshot.org/#/bpro.eth/proposal/QmZC1PhCjK275WJu7mvDiphkXucp8qLDotPGSYM7rSbYQf) , the new LM is using [UMA's KPI Option](https://umaproject.org/kpi-options.html) program to align the incentives of the different actors in B.Protocol. \
90k BPRO tokens were deposited from the DAO reserve into an UMA's KPI Option contract to mint 30k uBPRO-BIP4 (ERC-20 tokens). \
The uBPRO-BIP4 tokens will be accumulated each block during the LM period by B.Protocol users according to their usage of the protocol, e.g., how much they deposit and borrow through the different integrated protocols.&#x20;

For v1 users (MakerDAO and Compound) - the distribution will be 80/20 according to Borrowed/Deposited funds. \
For v2 users (Liquity) - the distribution will be in full for Deposits of LUSD.

If B.Protocol's TVL reaches or surpasses $150m at the end of the LM period (KPI achieved), then each uBPRO-BIP4 option token will be redeemable for 3 BPRO tokens.  Otherwise, if the TVL < $150m then each uBPRO-BIP4 will be redeemable for 1 BPRO token and the remaining 60k BPRO will be returned to the DAO Reservoir account.

Redeeming the option in return to BPRO token will be possible once the LM period is over via the [UMA interface](https://projects.umaproject.org/0x863E77B0bFC12193d2f5D41cdcacE81f1bb5a09F).&#x20;

### Here is a distribution breakdown example according to the current deposits and borrowed funds in B.Protocol: &#x20;

|                                                    |     **MakerDAO**    |     **Compound**    |     **Liquity**    | Total |
| -------------------------------------------------- | :-----------------: | :-----------------: | :----------------: | ----- |
| <p><em>Deposit ($m)</em></p><p><em>Weight</em></p> | <p>10</p><p>0.2</p> | <p>48</p><p>0.2</p> | <p>13 </p><p>1</p> | $71m  |
| <p><em>Borrow ($m)</em></p><p><em>Weight</em></p>  |  <p>3</p><p>0.8</p> |  <p>5</p><p>0.8</p> |         --         | $8m   |
| *Total Weight (m)*                                 |         4.4         |         13.6        |         13         | 31    |
| <p>uBPRO-BIP4 </p><p>Distribution</p>              |         4.2k        |        13.2k        |        12.6k       | 30k   |
| <p>BPRO distribution <br>If TVL < $150m</p>        |         4.2k        |        13.2k        |        12.6k       | 30k   |
| <p>BPRO distribution <br>If TVL > $150m</p>        |        12.6k        |        39.6k        |        37.8k       | 90k   |

At current weights, if user A has a $0.3m deposit in Maker with $0.1m debt, and $0.7m deposit in Compound with $0.2m debt, and a $1m LUSD deposit in Liquity - she would get uBPRO-BIP4 according to this calculation:

`[(0.3m+0.7m)*0.2 + (0.1m+0.2m)*0.8 + 1m*1]/31 * 30,000 = 1393 uBPRO-BIP4`

If B.Protocol's TVL > $150m at the end of the LM period, these 1393 uBPRO-BIP4  will be redeemable for 4180 BPRO.

##


# Previous Liquidity Mining phases

Below you can find the details of the previous liquidity mining phases of B.Protocol.

## Liquidity Mining phase 1

The first LM of B.Protocol distributed 250k BPRO during the first 3 months from the launch of the tokenized governance.&#x20;

1 month after the beginning of the 1st LM [BIP#1 has passed a DAO vote](https://snapshot.org/#/bpro.eth/proposal/QmR1rTEAnmT4CwYvC3MpkBsddLuWc5v5fUvwKEgUW6gwVM) to reward \~81k BPRO (out of the 250k) to LPs on Uniswap and Sushiswap.

&#x20;The 1st LM phase was ended on block number 12895834 (July 25th 2021).&#x20;


