|Trading Liquidity||Vault||Staking||ERC20 Contracts||Vortex||External Protection||Protocol WalletState|
The function and goal of the Bancor Vortex remains unchanged; the value it has accrued from its share of the revenues is used to buy and burn vBNT. However, the manner in which it achieves this is significantly improved.
Previously, the Bancor Vortex was powered by a dedicated wallet that would fill with each of the TKN from which it had earned fees. Each of these tokens would then be swapped at a later time on their respective pools for BNT, and that BNT is used to buy and burn vBNT. Conceptually, this process is maintained in Bancor 3; however, as demonstrated above, the TKN fees are translated into BNT on a continual basis. Therefore, the burner funds are collected exclusively in BNT, which dramatically simplifies the overall process and improves the gas efficiency of performing the burn.
Since the BNT used to power the Vortex are already in the vault, the act of performing a swap is also simplified. Consider that the protocol is using BNT inside the vault, to purchase vBNT that is already inside the vault alongside it. Performing a trade between the two assets therefore does not involve any token transfers at all. Instead, the liquidity balances of the BNT/vBNT pool are simply updated as though a swap was performed. Therefore, when the Vortex is triggered, the balance on its ledger is reset to 0, a virtual trade is performed on the BNT/vBNT liquidity pool, and vBNT is burned directly from the vault. To demonstrate the process, a simplified view of the protocol is presented below, where three human users, and the Bancor Protocol itself, are the only participants in the system.
For this scenario, the staked amount of BNT is set high to reflect the assumption that there are other pools in the network other than vBNT; however, they aren’t shown, because they are not an important component of this demonstration.
At this state, triggering the Vortex causes a virtual swap on the vBNT pool to occur. The equations that describe this process are presented in the above sections, and are repeated here for completeness. The change in the BNT and vBNT trading liquidity can be expressed as follows:
where a1† and a1 are the BNT trading liquidity balances of the pool after and before the trade, respectively, b1† and b1 are the vBNT trading liquidity balances of the pool after and before the trade, respectively, d1 is the pool fee (e.g. 0.01, or 1%) and e is the Vortex rate. Unlike standard trades, a Vortex burner does not trigger its own fee collection. Therefore, the Vortex rate, e, is set to zero during this swap. The number of BNT tokens being sent into the vault is x, and is equal to the balance on the Vortex ledger. The number of vBNT tokens removed from the trading liquidity, and burned from the vault is tknOut. The burner still causes fee accumulation to vBNT liquidity providers, denominated in vBNT, and is added to the staking ledger as normal:
For this example, assume the swap fee on the vBNT pool is 1%. The virtual swap of 123 BNT (i.e. the balance on the Vortex ledger) returns 114.715026 vBNT; however, recall that this trade is happening entirely within the vault. Therefore, ignoring the effect of the burn, the vault balances of BNT and vBNT remain completely unchanged - it is only the spot price reported by the pool that changes; there is no token transfer to process. The vBNT amount that is returned by this function represents the burn quantity, and so the vault balance of vBNT will be reduced by precisely this quantity after the virtual swap is completed. A fee of 1.158738 vBNT is added to the staked balance as normal.