B.Protocol <> Vesta Integration is LIVE!

Yaron Velner
Published in
6 min readFeb 8, 2022


Tldr: B.Protocol, the biggest Stability Pool interface in Liquity, integrates with Vesta Finance, and automatically converts liquidated ETH, renBTC, and gOHM back to VST and re-deposits it into the Stability Pools. VST providers to the Stability Pools who use B.Protocol benefit from locking the liquidation profits, minimizing their exposure to volatile assets, compounding passive APY on VST (no need to manually rebalance their position), and strengthening Vesta’s stability.

Try it out at https://app.bprotocol.org/vesta

B.Protocol makes lending platforms more secure by improving their underlying liquidation process and by fighting MEV — preventing liquidators from gas wars over liquidation transactions. As the biggest stability pool interface for Liquity (LUSD), with over $100M in user deposits, and after two successful integrations with Hundred Finance across Arbitrum and Fantom, we are happy to launch our latest integration with Vesta Finance.

Vesta Finance operates the VST stable coin via a free interest rate mechanism that resembles Liquity Protocol with additional collateral types and a governance model. The VST minted on Vesta is backed by ETH, renBTC, and gOHM, and as in most algorithmic coins, it crucially relies on successful and efficient liquidations when the price of these collaterals decline.

The core of Vesta’s liquidation mechanism relies on its stability pool. Vesta incentivizes users to provide VST to the stability pool, and whenever a liquidation happens, VST is taken from the pool, to pay the debt of the liquidated Vault. In return, the pool receives an equivalent amount of ETH, renBTC, or gOHM, with a 10% discount on their equivalent USD price, from the liquidated Vault’s collateral (each Vault type has its own segregated stability pool).

As the stability pool got battle-tested already with Liquity Protocol, it proved itself to be a useful security measure to enhance the liquidation process, by supplying the required liquidity while preventing MEV.

However, the outcome of a liquidation using a stability pool is that the depositor’s VST is converted to the liquidated collateral, and users who wish to maintain their asset’s exposure balanced, and keep getting more VSTA, need to sell the ETH, renBTC, or gOHM gains back to VST and re-deposit it into the pool themselves.

This introduces a short term drawback for the users, which might result in a long term drawback for the entire Vesta Finance protocol:

  • Short-term drawback: Users have to develop and maintain their own rebalancing system that automatically withdraws their collateral(s) and sells it back to VST. This entails both development and maintenance costs, as well as gas costs.
  • Long-term drawback: Asking users to actively rebalance their position, and deposit the VST back to the stability pool increases the safety margins and capital efficiency for the required stability pool. Vesta Finance dictates that over time the VSTA token incentives for depositing in the stability pool are decreasing, and thus it is imperative to increase the efficiency of the rebalance process.

Making the rebalance process fully automatic and trustless improves Vesta’s user experience in the short term, and in the long run could lead to lower capital requirements from the stability pool.

User experience with and without B.Protocol

We illustrate the different stability-pool-user experience with and without B.Protocol in the next two diagrams:

Without B.Protocol, the user simply deposits VST to one of the stability pools Vesta offers (ETH SP in the example below) , and whenever a liquidation occurs, part of his VST is converted to the collateral that is being liquidated (ETH in this example). At this point the liquidation process is completed, and it is up to the user to either sell the gained collateral (ETH, renBTC, or gOHM according to the SP he deposited his VST to) and deposit the return back in the stability pool, or to do other things with his gains.

It is worth mentioning that the un-balanced gains are not accumulating VSTA rewards, as only VST deposits are being incentivized.

Vesta Finance Stability Pool Liquidation Without B.Protocol

With B.Protocol, the deposits are done via B.Protocol’s wrapping smart contract interface, which deposits the VST to the chosen stability pool on behalf of the users. Once liquidation happens, the discounted collateral (again, ETH in the example below) is automatically offered for sale by B.Protocol’s Backstop AMM (B.AMM). This is done according to a deterministic formula, which takes into account the current ETH and VST inventory, and the current ETH-USD market price (which is taken from Chainlink). Whenever the sale occurs, the smart contract deposits the returned VST back to the stability pool.

Vesta Finance Stability Pool Liquidation With B.Protocol

This forms a circular system, in which the collateral is always eventually sold and the size of the VST stability pool does not decrease over time (unless users actively withdraw their deposits). Moreover, as Vesta users are being rewarded with VSTA tokens only for their VST in the stability pool, but not for their ETH, renBTC, or gOHM, B.Protocol’s automatic rebalancing process optimizes also the user’s VSTA rewards, which affects the distribution of Vesta’s fees paid in VST.

On top of these optimizations, users save the gas costs that are needed for the withdrawal, sale and re-deposit operations, and the Vesta protocol benefits from more stable stability pools.

How does it work?

Users deposit VST into B.Protocol, picking which VST stability pool s/he wants to use. B.Protocol in turn deposits the VST to the chosen Vesta’s stability pool on behalf of B.Protocol smart contract. An internal accounting system in the smart contract makes sure that all users get their fair share of VST and VSTA rewards.

Whenever a liquidation happens on one of Vesta’s Vault types (ETH, renBTC or gOHM), the Vesta liquidation system takes VST from the related stability pool to cover the debt of the liquidated Vault, in return for the Vault’s discounted collateral.

B.Protocol is another account in each of the stability pools, pooling all its users’ funds together, and thus, from time to time, part of its VST will be replaced with the related collateral, according to a conversion rate that offers a 10% discount over the Collateral-VST market price.

This applies also to the B.Protocol account in the stability pool. And when the collateral balance of the account is non zero, it is offered for sale by the smart contract. The sale offer is simply a smart contract function that lets anyone buy the collateral in return to VST, according to a quantity based price formula. The formula is an adaptation of Curve Finance’s stable swap invariant, and Chainlink price feed, and the details are described in the B.Protocol v2 whitepaper.

The formula offers the seized collateral for sale with a discount over market price. And the bigger the Collateral balance is (w.r.t total VST + Collateral inventory) the bigger the discount is. Up to a limit of 4% over market price.


  • B.Protocol is another smart contract layer on top of Vesta’s stability pool. Usual smart contract risks apply.
  • Participating in the stability pool is not risk free, with or without B.Protocol interface. Pool participants get ETH/renBTC/gOHM with a 10% discount in return to VST, however there is always a risk that these asset prices will go down by more than 10% before it is sold back to VST. B.Protocol mitigated this risk by offering it to sale, and by deploying a dedicated decentralized keepers from Gelato, however this does not fully mitigate the risk in cases of severe and rapid market crashes.
  • B.Protocol is built on top of Vesta protocol and uses Chainlink price oracle (and Vesta protocol itself is built on top of Chainlink price oracle itself). A bug in any of these two protocols could put B.Protocol users at risk.

About B.Protocol

B.Protocol is building a Backstop DeFi primitive, unlocking higher capital efficiency in the ecosystem. By democratizing liquidation systems it shifts MEV and bot profits to the hands of the community.

Lending platforms that integrate with B.Protocol democratize their liquidation system, provide a stronger safety net to their lenders, and enable higher collateral factors for its borrowers.

With B.Protocol, anyone can participate in the lucrative business of liquidations, tapping into the $1B/Year market of DeFi liquidations, on its growth path to the $100B/Year of liquidations made in CeFi.

Website, Docs, Discord, Twitter, Reddit, Forum, GitHub