How Kyber Uses B.Protocol And FPR As A Professional DeFi Backstop

Yaron Velner
B.Protocol
Published in
6 min readNov 24, 2020

The first member in our genesis backstop, Victor Tran (Kyber Network’s CTO) has completed the integration of B.Protocol with Kyber Reserve.

In this guest blog post, he explains why Kyber works with B.Protocol as a liquidator, and how the Fed Price Reserve (FPR) system works seamlessly with the protocol as an automated hedging mechanism.

Why Is Kyber Reserve A Liquidator On B.Protocol?

A liquidator needs to be able to repay a user’s MakerDAO DAI debt and in return receive the user’s seized ETH with a 13% discount on ETH/DAI market price (and half of the discount is shared with the users of B.Protocol). Thus far, DeFi lending platforms mainly focused on encouraging the retail user to take advantage of this discount, and arbitrage it immediately with other available on-chain liquidity.

However this approach will fail in extreme market conditions, when liquidations are most needed, as witnessed on Black Thursday. B.Protocol on the other hand provides clear incentives to professional liquidity providers to prepare a robust system that could bring much needed liquidity from centralized venues as well in times of need.

In particular, by allowing a set of liquidators, split fairly, to liquidate, they allow liquidations to avoid costly gas wars that both cut deeply into potential profits (even causing the system to fail), and make the profit taking from liquidations highly unpredictable.

Using B.Protocol’s clear incentive system/set of rules makes it much simpler for Kyber Reserve to act as a liquidator and earn from it, when it might have been unfeasible before.

Hedging Risks Involved with Liquidation

However, even though the lending services sell the collateral at a discount (for B.Protocol it is 6.5%), it is crucial that the collateral from the liquidation is able to be sold at the right price very quickly, particularly in fast moving market conditions.

When the collateral is sold on exchanges as a taker, you are likely subjected to additional taker fees as well as the delay in deposit time. Liquidators usually have to hedge against this risk, mostly by having to predict how much they will get from the liquidation, how long it will take to sell the collateral, as well as how the price might change in the time. They could also trade a future/option to hedge the risk, but all of the above increases the complexity greatly.

However, because Kyber Reserve uses the FPR system, the hedging is automatically built in if the collateral is a token that we are already market making for. We will now explain the FPR system, followed by how it works with the Backstop protocol.

Kyber Fed Price Reserve (FPR)

Kyber Reserve runs a market making system called FPR, which is a novel smart contract system that allows more gas-efficient and more secure on-chain market making. Prior to the introduction of the FPR, in the early days of DeFi in 2017, on-chain market making was done with order books, and suffered from two major pitfalls:

  1. Heavy gas costs in updating the orders. As every change in the market price of a certain asset required multiple Ethereum transactions to change multiple levels in the bid and ask orders.
  2. Vulnerability to extreme price volatility. As the orders require on-chain transactions, they could be updated with a few minutes delay after the change in the market price. During this time, arbitrage bots could hit these orders and cause losses to the market maker who placed them.

Kyber FPR reserve implements a better on-chain alternative to the traditional order book.

Better Safeguards and Gas Efficiency: A price function replaces the multi-level order book. As a result, it is possible to change the requested price for multiple quantities at once. Moreover, the smart contracts allow an update of up to 14 different assets, and up to 10 different levels (each), with a single smart contract storage update. Hence, effectively saving up to 139 storage updates (650k gas) w.r.t a traditional order book update.

Having a dedicated smart contract logic also enables the implementation of critical safeguards, which cancel the market maker price quotes if it detects a burst of volume during a short duration of time. Hence, the risk of being hit by an arbitrage bot during high volatility is reduced.

The above allows market makers to give tighter price quotes, as updating the quotes is up to x140 cheaper (in gas costs), and the effect of a wrong quote is bounded, thanks to the automatic burst limitation.

Better Operational Security: In addition, market making via a smart contract provides additional security. As market making dictates on-going 24/7 price quoting and inventory re-balancing, it must be done via a hot wallet that is connected to the internet. This wallet must have control over the market maker funds, as it should be able to send them to other arenas (e.g. Binance) in order to manage its position. Being able to put all the funds in a smart contract allows the market maker to program hard limitations on the control of the hot wallet over the funds. In particular, it can restrict it from sending funds to unauthorized addresses.

To date, Kyber FPR Reserve has served over $2.8B in volume, and is being used by major professional DeFi market makers.

Kyber FPR Reserve And B.Protocol

Kyber’s own market making reserve has already been configured to quote tokens for others to take. When a liquidated collateral is deposited to the reserve, the FPR is already designed to quote it nicely according to our own profit taking and making algorithms.

As such, all we had to do is to add a dedicated Kyber reserve operator who could withdraw DAI from the reserve in times of need, use it to liquidate an unsafe MakerDAO Vault, and return the received ETH back to the reserve. At this point the reserve position manager detects that a new (short) DAI position has incurred, and will promptly work on rebalancing it over the various centralized exchanges.

This is an extremely effective and automated hedging mechanism since there are no fees (there are no fees to quote on Kyber), and there is no waiting time between collateral being transferred to the reserve and being available (apart from the tx mining on the blockchain, which is atomic).

In addition, if the reserve already sold the same collateral even before the liquidation, your collateral deposit to the Kyber FPR closes this position resulting in immediate profit realization.

The aforementioned features are unique to the Kyber FPR and are not possible with other systems. As such, the Kyber FPR is the perfect 1st choice for B.protocol as a seamless, automated hedging mechanism.

Conclusion

Kyber FPR reserve has been integrated with B.Protocol for over 3 weeks, and successfully managed to liquidate numerous Vaults, including Vaults that MakerDAO keepers failed to handle, and Vaults that became unsafe while Infura was down.

Thanks to the clear incentives B.Protocol provides, namely certainty for liquidators, and the removal of expensive gas wars, most of it could become available for liquidations in time of need (and for a short duration), as the 6.5% premium offered is much higher than typical trading profits.

B.Protocol is an important DeFi protocol that makes lending platforms more secure, and Kyber is glad to support an integral part of its operations by facilitating its on-chain liquidations and providing an automated hedging mechanism.

Interested and sophisticated market makers should reach out to Kyber or B.Protocol to inquire how to create similar systems for their own usage.

About Kyber Network

Kyber’s on-chain liquidity protocol allows decentralized token swaps to be integrated into any application, enabling value exchange to be performed seamlessly between all parties in the ecosystem. Using this protocol, developers can build innovative payment flows and applications, including instant token swap services, ERC20 payments, and financial DApps — helping to build a world where any token is usable anywhere.

Kyber is the most used and integrated decentralized finance (DeFi) protocol in the world, with over US$2 Billion worth of transactions facilitated since its inception. Kyber supports over 80 different tokens, and powers over 100 integrated projects including popular wallets Trust, Enjin, Argent, and the HTC Exodus smartphone, as well as DeFi platforms Nuo, DeFi Saver, InstaDApp, Set Protocol, Melon, and many others.

Discord | Website | Blog | Twitter | Reddit | Facebook | Developer Portal | KyberPRO | Kyber Tracker | KyberWidget Generator | Github

About B.Protocol

B.Protocol makes lending platforms more secure by incentivizing liquidators (keepers) to commit on liquidation of under collateralized loans and shift the miners extracted profits back to the users of the platform. B.Protocol was founded by Yaron Velner, who was previously Kyber Network’s CTO and a co-designer of the WBTC protocol.

For more, please visit our website, twitter, discord and github.

--

--