Ask or search…

Bancor 3 Mechanics - #1 Swap

What happens during “Swap”? - an overview of the protocol and a comparison with the traditional AMM model.


Let’s start with an example of a swap and measure its impact on withdrawals from the system. In Bancor 3, all tokens are paired with the BNT Omnipool. If you are swapping TKN A to TKN B, the following set of swaps will occur:
  1. 1.
    TKN A → BNT
  2. 2.
    BNT → TKN B
Take the diagram below which shows a BNT to TKN swap
Here, we have a pool that consists of Token A and BNT, with each Token A having value of $1.33 and each BNT having a value of $1. in Bancor 3 all pools are weighted 50–50, meaning the total liquidity in the pool is therefore $8, with each side contributing $4.
An outside trader performs a swap on this liquidity pool by swapping 2 BNT for 1 Token A. The final state of the pool after the swap is 2 Token A and 6 BNT. On the Token A side, there is a deficit of 33% (1 out of the original 3 tokens was removed) and on the BNT side there is now a surplus of 50% (relative to the initial quantity 4 vs 6). When looking at the picture as a whole, the liquidity in the pool is now $12 with the cumulative value of each respective token in the pool being $6 (i.e. each side has an even dollar value).
In Bancor 3, all deposits are single sided, meaning users only have to contribute one side of a pool. In our example above, assume that the entirety of the Token A pool was contributed by a single liquidity provider and the Bancor Protocol matched his Token A side deposit with BNT (it contributed the BNT side of the pool). The LP in the Token A pool is currently in a state of deficit, while the BNT pool is currently in a state of surplus. What happens if the Token A LP decides to withdraw?