Bancor3: Redefining DeFi Playbooks Once Again

Aw Kai Shin
8 min readMay 24, 2022

--

Bancor official support site

With all that was happening in the crypto market recently, it was easy to miss one of the most promising and game changing innovations in the DeFi space this year. From the same team which pioneered the AMM mechanics that started the billion dollar DeFi wave in 2017, Bancor3 is a radically redesigned solution to address the main shortcomings of the earlier models: impermanent loss and dual-sided staking.

Before we begin, given the complexity of Bancor3, this article is a first of a series meant as a high level overview of its design elements and the issues which it solves for. This will then be followed up with a deeper dive into Bancor3 mechanics as well as a smart contract walkthrough of the main functions available in the protocol. Some helpful links below:

Impermanent Loss (“IL”) & Dual-Sided Staking: A consequence & a necessity

finematics: one of the best channels for crypto education

The video above is a good intro/refresher to the concept of IL for those unfamiliar. In short, IL occurs as trades against a liquidity pool results in a divergence of the asset ratio from when liquidity was added to the pool. This means that if a liquidity provider deposits tokens to a pool in a 50/50 ratio, the ratio of tokens upon withdrawal will likely differ as there are trades taking place against their assets between depositing and withdrawing from the pool. If the above sounds like gibberish, I highly recommend diving into Finematics channel.

Since the inception of the AMM model, many portfolio strategies have been created in order to minimize IL:

  • Timing of entry and exit from liquidity pool
  • Entering pools with highly correlated assets
  • Entering pools with higher trading volume to total value locked ratios

All these strategies are essentially a bandaid as it sidesteps the technical limitations of the system. Moreover, given actual on-chain data that has been generated on Uniswap V3, preliminary research has shown that:

“the average liquidity provider (“LP”) in the Uniswap v3 ecosystem has been financially harmed by their choice of activities and would have been more profitable simply holding their assets (“HODLing”)”

It is only reasonable to then question how all these protocols managed to amass more than USD 250B in total value lock at its peak. It might be a case of the illusion of superiority (where everyone believes they are above average) but it’s more likely that majority of users were attracted by the high APYs (Annual Percentage Yields) provided by such protocols. Majority of these high APYs were driven by the protocols minting their own token as an additional incentive as opposed to liquidity providers just receiving a ~0.3% trading fee.

3.17 billion APY being offered on SushiSwap

For the average user, these APYs mask not only the IL but also the complexity of where actual value is being generated on these protocols. The protocol tokens (ie SUSHI, CAKE, BOO, MMF, VVS) will have to maintain its value else see a significant drop in APYs across their own ecosystem as protocol rewards form the majority of the APY as opposed to trading fees. As such, there are generally a few actions that a user can take with their newly minted protocol tokens:

  • Immediately sell it for cash equivalents and reduce exposure to the liquidity pool tokens and the protocol token
  • Immediately convert it into more tokens to deposit into the same liquidity pool and thereby reducing exposure to the protocol token
  • Provide it as one side of a pair to a liquidity pool that trades the protocol token where they will need to provide additional liquidity for the trading pair
  • Stake it on the protocol to earn a portion of the protocol revenue which exposes the user to swings in the protocol token value. This usually also provides them with governance rights

Save from exiting completely from the protocol, the liquidity provider is always exposed to the risk of holding minimally the 2 tokens in the liquidity pool. If one token rises in value relative to the other, the liquidity provider will be left with less of the valuable token and more of the other. In fact, the liquidity provider always receives the short end of a trade and relies solely on market forces to rebalance their positions in order to protect their initial capital.

Ultimately, liquidity providers could significantly lower their risks if they were able to transact with just a single token and thereby reducing their exposure to multiple tokens. That is, as a ETH holder, I want to deposit ETH into a liquidity pool with a guarantee that I would minimally be able to withdraw this ETH amount plus any accrued fees paid out in ETH.

Such a simple concept, so many wars fought because of it (Source)

Given that liquidity pools generate revenue from trades and a trade requires another token to trade with (rather obvious but worth pointing out), this is where the ingenuity of the Bancor V3 solution emerges.

Bancor3: 100% IL Protection & Single-Sided Staking

Source

Bancor3 was designed from the ground up with an overarching goal to bring DeFi to the masses by solving 5 key issues faced by the average user:

  • Capital Protection: The user should always be able to withdraw exactly what they put in
  • Token Exposure: The user, as much as possible, should bear only the risks related to their preferred token
  • Capital Efficiency: The user should not need to sell their preferred asset nor source additional capital in order to become a liquidity provider
  • Timing the Market: The user should not need to actively manage their positions in order to outperform a HODL strategy
  • Network Fee Drag: The network fees should form an increasingly smaller proportion of the transaction value

In order to achieve the above, the dual-sided liquidity pools had to be removed from the equation and instead replaced with a single shared liquidity pool. So instead of each trading pair having its own separate liquidity pool, all tokens are now paired with a single BNT pool per below.

Consequently, Bancor3 had to decouple the 2 key concepts which were merged in prior versions:

  • The total supply of liquidity pool tokens
  • Liquidity pool underlying token balances

Previously, the liquidity pool tokens would always represent a proportional claim of the tokens held in a liquidity pool. However, this meant that any market-making activities would expose the pool token to IL as the ratio of the tokens in the pool fluctuates. By decoupling the above and making the pool tokens indifferent to IL, pool tokens now represent a users withdrawal entitlement which could be more easily accounted for with an internal Staking Ledger. Given the pervasiveness of the individual liquidity pool concept, the Bancor team has opted to continue using this terminology however liquidity pools now contain nothing more than just the pool logic.

With the liquidity pool reserves being virtualized, the protocol then needed a separate vault contract to store all the deposits. The vault would not only keep track of underlying token amounts but also enable the protocol to store an unlimited amount of tokens (hence the name infinity pool). The token balances in the vault would then be a key parameter when determining the available trading liquidity for each pool as well as calculating underlying token amounts for any withdrawal events. Of note, any changes to the pool depth would require the BancorDAO to co-invest the corresponding amount of BNT hence changes to pool liquidity can now be manually configured via a governance vote.

The result of all this is that, via BancorDAOs co-investments, the protocol is able to earn trading fees which are then redirected to cover the cost of IL (similar to an insurance). Bancor would manage to turn a profit if the fees earned are greater than the IL compensation to the user at the time of withdrawal. In order to prevent abuse as well as guarantee “100% IL Protection”, a new withdrawal algorithm, exit fee and cooldown period was introduced (details of which will be covered in a future article). These effectively shifted the risk of IL to the Bancor protocol while guaranteeing that users would always be able to outperform a HODL strategy by providing their token to Bancor.

As an added bonus of this new omnipool design, the gas fees throughout the system were also minimized. Swaps between non-BNT tokens. could be done with only 2 transactions while virtualizing the intermediate BNT hop. Moreover, as Bancor is a co-investor and has its own pool tokens, Bancor can instead choose to burn their own tokens to allow the reward value to accrue to all pool token holders. This means no more fees (and time) required to claim your rewards, convert them, and restake them.

Trailblazing a path for the future of DeFi

Bancor App

With such a promising solution being implemented, it is now being put to the test with more than $574M of value locked in the first 10 days since launch. This is noteworthy given that Bancor3 launched on May 12 right when the Terra ecosystem collapse was unfolding. While it is still too early to call it, it does seem like Bancor team will be the pioneers to the next chapter of DeFi yet again.

Personally, I’m super excited to see how this plays out and will be following this article up with additional deeper dives as well as detailed code walkthroughs so do stay tuned! :)

Thanks for staying till the end. Would love to hear your thought/comments so do drop a comment. I’m active on twitter @AwKaiShin if you would like to receive more digestible tidbits of crypto-related info or visit my personal website if you would like my services :)

Bancor3 Deep Dive Series

Analysis

Smart Contract Guides

Other Links

Official Links

--

--

Aw Kai Shin

Web3, Crypto & Blockchain: Building a More Equitable Web | Technical Writer @FactorDAO | www.awkaishin.com