Multi-Collateral Automated Backstop

Yaron Velner
B.Protocol
Published in
3 min readJan 17, 2022

We introduce a Backstop Automated Market Maker (B.AMM) implementation that supports liquidations of multiple collateral types with the same backstop liquidity. The implementation is now live and backstops Hundred Finance over Fantom network.

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

The current B.AMM implementations consists of over $100m in user deposits, and demonstrated it’s abilities in the recent weeks by handling liquidations on Liquity Protocol and Hundred Finance. In the current design, a lending platform like Hundred Finance requires a different backstop to each of its collateral types.

In this blog post, we explain the extended B.AMM formula which supports multi-collateral liquidations.

For a background on how the single-collateral B.AMM works we refer the reader to the this writeup.

Multi-collateral stable swap invariant

At the core of the B.AMM resides the Rebalance algorithm, which offers the seized collateral for sale. The sell price is determined by a price feed and by a formula that decides on a discount over the market price. The formula is inspired by Curve Finance’s stable swap invariant, where one asset is the backstop debt token (e.g., USDC) and the other is the seized collateral (e.g., ETH), both of which are normalised to USD price. The key property of the formula is that the discount increases when the imbalance (namely the ratio between the backstop debt token to the collateral token) increases.

We extend the invariant by defining:

With this definition, the key property of the original invariant is maintained, and it gives rise to a pricing algorithm for any swap between a debt and collateral token.

We illustrate the extended invariant with the two figures below. In the first figure the backstop consists of $1000 of USDC, and $100 imbalance, which consists only of ETH.

In the second diagram there is again a $100 imbalance, however it is composed of 3 different assets.

In both examples the discount for $1 of seized collateral will be the same.

Implementation and deployment

We implemented a B.AMM with the extended invariant and support for any ERC20 collateral, the code is open source and available in our github here.

The implementation was audited and no major issues were found.

The implementation was deployed over Fantom to backstop Hundred Finance USDC and DAI debts (each debt is a separate backstop pool), with MIM, BTC, Spell, DAI, USDC and YFI collaterals.

In order to support future collateral listing and changes in the price feed, we set up an admin contract that is co-owned by B.Protocol and Hundred Finance admins, which allows to list/delist collateral if and only if both parties sign. Furthermore, the new collateral will be added only after a timelock of two weeks.

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 enabling 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

--

--