[Proposal] Mento Upgrade MU05: Native USDC Integration

Hello everyone!

With the recent deployment of native USDC to Celo, we would like to introduce additional native USDC pools in Mento v2 to eventually replace the current axlUSDC pools and remove the now unnecessary bridge risk (see previous forum discussion).

With the still ongoing rollout and missing support of Celo native USDC on centralized exchanges, we will continue supporting bridged USDC in the meantime until it can be fully phased out and we can complete the switch to native USDC.

This post outlines the transactions that will be part of the native USDC Mento integration(MU05).

As with previous proposals, the Celo community will have the opportunity to verify them. In preparation for the upcoming CGP, we are currently in the process of:

  • Testing the proposal on Baklava and Alfajores
  • Simulating the proposal on top of a fork of Celo Mainnet, in addition to running tests against the fork

The transactions in the upcoming CGP will be broken down into the following sections, noted here with transaction indices in brackets:

  1. Add native USDC to the Reserve (0-1)
  2. Configure new native USDC pairs in the BiPoolManager (2-4)
  3. Configure trading limits (5-9)

Before we dive into each section and transaction, we recommend you have celocli set up to follow along. For the tech savvy, you can find everything we are describing here in our deployment tooling repository as code. To verify that the addresses included in the proposal are correct, please refer to the Appendix at the bottom for some handy tips.

1. Add native USDC to the Reserve

This includes the transactions to add native USDC to the reserve collateral assets list as well as setting the daily spending ratio.

TX#0 adds USDC as a collateral asset to the Reserve addCollateralAsset()

  • Verify the ReserveProxy address
  • Verify the native USDC address

TX#1 sets the daily spending ratio for USDC to 100%. The value is represented as a fixed point number with 24 decimals, i.e. 1 is written as 1e24 getDailySpendingRatioForCollateralAsset()

  • Verify the ReserveProxy address
  • Verify the native USDC address
  • Verify the ratio: 1e24 = 100%

2. Configure new native USDC pairs in the BiPoolManager

This includes the transactions to create new exchanges in the broker, namely cUSD/nativeUSDC, cEUR/nativeUSDC, and cBRL/nativeUSDC.

Verifying an exchange payload feels a bit complicated at first sight because the argument to the function is a solidity struct with a nested struct as well, which gets serialized verbosely in celocli with all arguments both named and using indices. The structure also gets serialized both under args and params so something like 11 attributes are repeated 4 times in the outputs making it feel harder to parse. When reading the output from celocli we recommend ignoring the args field and focusing on the params, and also ignoring the numbered fields and focusing only on the named fields.

To verify the exchange configuration is sane, check the docs BiPoolManager - Mento Protocol 1 for an explanation of the structure.

TX#2 Create the new cUSD/nativeUSDC exchange

  • Verify the BiPoolManagerProxy address
  • Verify the exchange configuration

TX#3 Create the new cEUR/nativeUSDC exchange

  • Verify the BiPoolManagerProxy address
  • Verify the exchange configuration

TX#4 Create the new cBRL/nativeUSDC exchange

  • Verify the BiPoolManagerProxy address
  • Verify the exchange configuration

3. Configure trading limits

As part of the native USDC integration, we need to configure trading Limits for the newly created exchanges. For the currently deployed FX risk-sensitive pairs cEUR/axlUSDC and cBRL/axlUSDC, we have a net flow global trading limit configured of 14.000.000 and 5.000.000 tokens respectively (denominated in the Stable Token, so cEUR and cBRL).

Since we want to keep the FX risk profile of the Mento Reserve the same we are going to update these global limits as well. This means that the combined global Limit of the cEUR/axlUSDC and cEUR/nativeUSDC pairs add up to the same 14.000.000 cEUR. The same applies to the cBRL/axlUSDC and cBRL/nativeUSDC pairs with a combined 5.000.000 cBRL global trading limit. Once we fully transition towards native USDC these limits will be updated.

In this section, the output of celocli can be too verbose when dealing with arguments and structs, so it’s recommended to ignore args and numbered fields and to focus instead on params and named fields.

The TradingLimit.Config structure is documented here: https://docs.mento.org/mento/developers/smart-contracts/tradinglimits

TX#5 - configure trading limits on cUSD for the cUSD/nativeUSDC exchange configureTradingLimit()

  • Verify BrokerProxy address
  • Verify the arguments:
    • exchangeId: the deterministic id of the cUSD/nativeUSDC exchange
    • token: which asset in the pair to target, in this case, the cUSD token address
    • config: the trading limit configuration

TX#6 - configure trading limits on cEUR for the cEUR/nativeUSDC exchange configureTradingLimit()

  • Verify BrokerProxy address
  • Verify the arguments:
    • exchangeId: the deterministic id of the cEUR/nativeUSDC exchange
    • token: which asset in the pair to target, in this case, the cEUR token address
    • config: the trading limit configuration

TX#7 - configure trading limits on cBRL for the cBRL/nativeUSDC exchange configureTradingLimit()

  • Verify BrokerProxy address
  • Verify the arguments:
    • exchangeId: the deterministic id of the cBRL/nativeUSDC exchange
    • token: which asset in the pair to target, in this case, the cBRL token address
    • config: the trading limit configuration

TX#8 - reconfigure trading limits on cEUR for the cEUR/axlUSDC exchange configureTradingLimit()

  • Verify BrokerProxy address
  • Verify the arguments:
    • exchangeId: the deterministic id of the cEUR/axlUSDC exchange
    • token: which asset in the pair to target, in this case, the cEUR token address
    • config: the trading limit configuration

TX#9 - reconfigure trading limits on cBRL for the cBRL/axlUSDC exchange configureTradingLimit()

  • Verify BrokerProxy address
  • Verify the arguments:
    • exchangeId: the deterministic id of the cBRL/axlUSDC exchange
    • token: which asset in the pair to target, in this case, the cBRL token address
    • config: the trading limit configuration

Appendix: Verifying an address

Verifying that an address in the CGP is correct requires a few different strategies depending on what that address is (see the mento docs for some additional information). Here are common situations:

  • Is it a rate feed identifier like: address(uint160(keccack256(”USDCEUR”)))
    • Use Keccak-256 Online 2 to compute the keccak
    • Take the last 40 characters (20 bytes) of the keccak and compare with the value
  • Is it a Mento contract?
  • Is it a Core Celo contract?
    • Yes:
      • It’s probably GoldToken which can be verified in the Celo Registry
    • No:
5 Likes