Bootstrap Carbon with POL from Bancor 3
Context:
This proposal is a continued discussion of the proposals created by alphavalion [here, and here]. In brief, there are two key aspects that should be consolidated:
Winding down of Bancor V3 and cementing the lossless state of tokens in surplus
The Bancor V3 contracts allow the DAO to determine the trading liquidity value of any pool. If the trading liquidity is set to zero, that pool can no longer trade. For pools with tokens currently in surplus, stopping trading will ensure that all LPs will forever be able to withdraw their tokens without incurring a loss. This point was elaborated in a comment on alphavalionâs original proposal; these mechanics are described in the Comprehensive Description of Bancor 3 section of BIP 15, and can be scrutinized in detail via the Bancor V3 simulation resources.
Importantly, the single-sided pool tokens of Bancor V3 represent a pro-rata share of the Staking Ledger, which is distinct from the Master Vault balances. The Bancor V3 withdrawal algorithm was designed to handle these situations, where a withdrawal from a pool in a state of surplus would trigger an adjustment in the poolâs marginal rate so as to effectively reduce its asking price and encourage the return of BNT tokens back into its reserves. In essence, the protocol would use surplus TKN to re-purchase BNT tokens from the market sporadically as users withdraw from these pools. Then, the recaptured BNT is destroyed as LPs withdraw in the future.
The source of surplus tokens is the rebalancing nature of the AMM. For illustrative purposes, consider the DRC token, which was among those that had their trading liquidity set to zero in a recent collection of similar decisions submitted for a vote via Snapshot.
The proposal to whitelist DRC appeared in the governance forums in July 2021, and was approved by the BancorDAO via Snapshot shortly thereafter. This was during the V2.1 paradigm, where protocol contributed BNT (aka the âco-investmentâ using the vernacular of the time) was an inflexible part of the system. Essentially, the protocol would provide BNT to complete the trading pair, from which the single-sided liquidity provisioning paradigm emerged. In V2.1, once the protocol exhausted its DAO-permitted BNT contribution to the pair, no additional liquidity contribution was possible. That is, unless the protocol BNT contribution limits were increased via a DAO vote. The DRC token was approved with an initial protocol BNT contribution capacity of 30k BNT, which was quickly exhausted. After approximately 1 month of the poolâs operation, a proposal to increase the protocol BNT contribution for DRC liquidity to 50k was published to the governance forums, which was also approved by the BancorDAO shortly thereafter.
Much has happened in the time since these proposals were approved. The BNT token significantly out-performed DRC in terms of price action during the first 12-months of the poolâs existence, and continued to out-perform DRC up to and including the present day. While this helps to illuminate the origin of the surplus, it is a worthy exercise to inspect precisely how these tokens arrived on Bancor V3.
In July 2022 a discussion began surrounding the re-equilibration of token balances on Bancor V3 by migrating protocol-owned tokens from V2.1 (i.e. tokens that cannot be ascribed to user-owned balances). In September 2022 a full analysis of the aggregate states of V2.1 and V3 was posted to the forums, including a google sheets document which itemizes the data by token. These discussions culminated in a proposal, posted to the forums in October 2022, which was subsequently approved by the BancorDAO via Snapshot vote the same month. In the google sheets document, DRC appears on row 64 (index 62), and columns F and G (current_poolTokenSupply and current_POL_poolTokens, respectively) reveal the surplus existed on V2.1 at least that long ago. Column I (current_POL_total_perc) lists the protocol ownership of DRC at 63%, which translates to a 237% surplus (column W, âcurrent_surplus_percâ). The calculated amount of DRC to migrate at that time was 22,307,903.72 (column AB, âmigrate_amount_tknâ). As the vote concluded Oct 19, 2022, 4:43 PM UTC, after a brief rally in DRC, I expect that the token amount that could be migrated was slightly reduced, which may explain why V3 has a balance of 16,348,845 DRC, not 22,307,903.72 as detailed in the original report.
Moving surplus tokens to Carbon and creating a protocol-owned strategy
The proposals by alphavalion generalise the purpose of this protocol-owned liquidity (POL) by introducing an intermediate step; the surplus tokens are first moved to Carbon and destined for inclusion in a âprotocol-owned strategyâ, which through fee generation also directly translates to BNT recapture and destruction. As an aside, the increased liquidity levels in Carbon ought to help maintain persistent volumes and assist with the adoption of the new product.
However, several issues have been raised that represent an insurmountable obstacle to implementing the protocol-owned strategies as initially envisioned by alphavalion. While a rebuttal was provided, it suggests a fundamental misunderstanding by the original author regarding the feasibility of what is being proposed. The only satisfactory process must be one where there are a set of functions that can be called by literally anyone, which facilitate the exchange of tokens into the desired pair, and the creation of a strategy with unambiguous settings. This is the decentralization requirement which, for example, would prohibit the use of a generic token tracker and entrusting an individual with correctly interpreting it, and maintaining the strategy on chain in accordance with the DAOâs guidelines, as suggested in the proposal. To create a system of smart contracts to achieve what is proposed, in terms of regularly updating the strategy conditions in accordance with a TWAP, is similarly untenable.
Consolidation:
As ongoing strategy management is untenable, this proposal suggests that a generic stablecoin strategy be adopted which can exist in perpetuity without changing its parameters.
Strategy Details
Suggested Tokens
A low maintenance token pair that can meet the restrictions and enforced criteria would be between two âlikeâ tokens preferrable stable. Since there are many options for stable tokens, it would be preferred to select the two tokens which are most popular and trade with the largest volumes. Therefore, USDC/USDT is an obvious candidate.
Competition for Volume
Carbonâs smart contracts are sufficiently gas-efficient to hold their own against industry giants, including Uniswap V3 and Curve Finance, with respect to the most competitive of liquid pairs: stable coins. Uniswap V3 is superbly efficient on a liquidity unit basis, commanding ~45% of all USDC/USDT volume ($1.8 billion last month), predominantly via its 1 bp liquidity pool despite having only ~$50 million in liquidity. Itâs a simple calculus; with the vast majority of liquidity concentrated within only a 2-tick range, and median and mean gas on swaps of 134k and 137k, respectively, Uniswap V3 offers attractive stable coin exchange rates at low overhead cost.
Carbon should be able to offer competitive rates, and lower overheads than even Uniswapâs shining example. On Carbon, the average gas overhead is comfortably at the 45th percentile of Uniswapâs gas distribution, meaning it is poised to be an immediate contender for a compelling share of volume.
There is one caveat - Carbonâs contracts apply a network-wide taker fee of 20 bps. However, it is possible to create a single, protocol-owned stable coin strategy with price settings that compensate for the difference and effectively emulate a 1 bp swap fee.
Competition for Price (Emulation of a sub 20 basis-point USDC/USDT Liquidity Pool)
To compensate for the network-wide 20 bp augmentation of exchange rates, the strategy will deliberately bid high on both USDT and USDC sides of the pair, sufficient only to compensate for swap fee. Therefore, with each trade, a maximum of 20 bps worth of the swap value is transferred from the strategy itself to the feeBurner
. For perspective, this would allow a protocol-owned strategy containing $2 million in stablecoin liquidity to process $1 billion in swap volume before the last penny is transferred from the strategy to the feeBurner
. The transfer of value from the strategy to the feeBurner
is over-unity; whatever stablecoin value the strategy begins with, will eventually be transferred to the feeBurner
together with the yields garnered on the taker volumes.
Strategy Settings
1 basis point USDC/USDT spread
Both orderâs y-intercepts (y_{int}) are be forced to an arbitrarily high number, and the high, low, and marginal rates are held constant (i.e. S = \sqrt{P_{a}} - \sqrt{P_{b}} = 0). The precise bidding and asking prices are held at precisely 1.0019 and 0.9981, respectively. The precise strategy configuration, before it has received any tokens, is:
# USDC ORDER
'y' : 0
'Z' : 5192296858534827628530496329220096
'A' : 0
'B' : 422346370619417 (compressed), 281742787817522 (decompressed); {mantissa: 140871393908761, exponent: 1}
# USDT ORDER
'y' : 0
'Z' : 5192296858534827628530496329220096
'A' : 0
'B' : 422346370619417 (compressed), 281742787817522 (decompressed); {mantissa: 140871393908761, exponent: 1}
# Example trades on the proposed 1 basis-point USDC/USDT strategy
# TRADE BY SOURCE
Trader sends: 1000000.000000 USDC
Trader receives: 999900.009998 USDT
Gas overhead: 133681
Trader sends: 1000000.000000 USDT
Trader receives: 999900.009998 USDC
Gas overhead: 132975
# TRADE BY TARGET
Trader sends: 1000100.000002 USDC
Trader receives: 1000000.000000 USDT
Gas overhead: 134132
Trader sends: 1000100.000002 USDT
Trader receives: 1000000.000000 USDC
Gas overhead: 133426
Work to be done
- Expose a public function on Bancor V3 to handle the transfer:
a. The caller chooses a token on Bancor V3. If the pool for that token has its trading liquidity set to zero, and the token is in surplus, then the function call is permitted.
b. This function will transfer the precise surplus amount from the Bancor V3 master Vault, to a dedicated contract on Carbon.
c. The caller receives a small incentive to call the function, proposed to be 0.2% of the total amount being transferred.
For example, assume that there is a token TKN, which has balances of 200 and 100 in the Staking Ledger, and Master Vault, respectively. Further, assume the DAO has recently set its trading liquidity to zero. Therefore, all LPs in TKN can withdraw at any time, and without incurring a loss, at any point in the future. The surplus 100 TKN is available for transfer to the dedicated contract on Carbon for the purpose of growing the protocol-owned strategy. Alice calls the function and receives 0.2 TKN to her wallet. The remaining 99.8 TKN are transferred from the Bancor V3 Master Vault to the dedicated contract on Carbon.
-
Expose a public function on the
carbonPOL
contract to exchange the tokens received from Bancor V3 for USDC:
a. The caller chooses a token from the available balances on thecarbonPOL
contract, to perform a swap into USDC.
b. AminReturn
value in the target stablecoin is obtained via a price oracle, and is not decided by the caller;minReturn
is protecting the function from being abused. The proposedminReturn
value is the oracle price - 0.5%:- The user inputs a certain value needed by the oracle (e.g. the hourly TWAP).
- That value is then verified on-chain.
- The
minReturn
is a fixed proportion of the verified value.
c. This function will perform the swap via an input trade route, provided by the caller. If the minimum return value is not met, the transaction reverts.
d. The caller receives a small incentive to call the function, proposed to be 0.2% of the USDC received by the contract following a successful swap.
For example, assume that the 99.8 TKN from the previous function call are chosen by the caller. The Uniswap V2 price oracle indicates that these tokens have an approximate value of 1000 USDC. Bob calls the function with a specific trade route, and the swap successfully returns exactly 1000 USDC. Bob is rewarded with 2 USDC, and the remaining 998 USDC are returned to the contract.
-
Expose a public function that allows USDC to be transferred from the contract, to the protocol-owned strategy:
a. The caller does not need to make any choices, except when to call the function, which is predicated on there being sufficient USDC to make the reward offset the gas cost of the interaction.
b. This function transfers the total balance of USDC from the contract, to the protocol-owned strategy.
c. The caller receives a small incentive to call the function, proposed to be 0.2% of the target USDC received by the contract following a successful swap.
For example, assume that the 998 USDC from the previous function call are chosen by the caller. Charlie calls the function and receives 1.996 USDC as a reward. The remaining 996.004 USDC are transferred from the contract to the protocol-owned strategy.
DAO Decisions:
Vote FOR to support the creation of a protocol-owned USDC/USDT strategy on Carbon, which emulates a 1 basis point concentrated liquidity pool, via the setting detailed above.
Vote AGAINST to defeat this part of the proposal
Vote FOR to support the creation of the proposed public function that moves surplus tokens from Bancor V3 to Carbon for the explicit purpose of being swapped for USDC, and where the functionâs caller receives 0.2% of the surplus token amount as an incentive.
Vote AGAINST to defeat this part of the proposal.
-
Function to swap surplus tokens for USDC with a 0.2% caller incentive and an oracle price - 0.5% minReturn (contingent on decision # 2).
Vote FOR to support the creation of the proposed function that allows anyone to provide a trade route whereby the tokens received by the contract are exchanged for USDC, with a minimum return value provided by an external price oracle, and where the functionâs caller receives 0.2% of the received USDC amount, after the swap, as an incentive.
Vote AGAINST to defeat this part of the proposal.
-
Function to move USDC to the protocol-owned strategy with a 0.2% caller incentive (contingent on decision # 3).
Vote FOR to support the creation of the proposed function that allows anyone to move the protocol-owned USDC received by the contract into the protocol-owned USDC/USDT strategy, and where the functionâs caller receives 0.2% of the received USDC amount, after the swap, as an incentive.
Vote AGAINST to defeat this part of the proposal.