Deploy Compound III on Base

Deploy Compound III on Base

Preamble:

Type: Multichain Deployment
Title: Deploy Compound III on Base
Author: Compound Labs

Proposal Introduction

Point of Contact:

@compound.finance (Compound Labs)

Proposal Summary:

Compound Labs proposes the deployment of Compound III on Base for the community.

Overview of Proposal:

As mentioned in Compound Lab’s roadmap updates during the community call, Labs proposes to deploy Compound III on Base. Base is an EVM-equivalent L2, incubated within Coinbase, built on the OP Stack in collaboration with Optimism. Base seeks to provide a secure, low-cost, and developer-friendly environment to build decentralized apps on-chain and bring the next billion users to web3.

The Base Goerli testnet has been live since February of this year and mainnet is planned to launch in 2023. More details can be found in their docs.

Compound Labs sees two promising use cases for borrowing on Base and intends to launch two Comet markets on Base mainnet via governance proposals. The first will be a USDC market with crypto majors as collateral (e.g. WETH, WBTC, etc.). The second will be a WETH market with LSDs as collateral (e.g. cbETH, wstETH, etc.).

Compound Labs has already deployed two instances of Comet (cUSDCv3 and cWETHv3) on the Base Goerli testnet (addresses in the docs) and welcomes the community to start trying them out.

Motivation:

As Base gears up for mainnet launch in 2023, Compound Labs aims to position the Compound protocol as a core DeFi lego on the nascent chain. We believe that Coinbase’s popularity with retail users can onboard a new wave of users to the Compound protocol and community.

Grant Application:

Did not apply

Non-Technical Evaluation

As of this post, 2.3M accounts have been created and 24.1M transactions have been completed on Base Goerli. Base also has a comprehensive list of launch partners, as can be seen in the graphic below.


Source: How the Builders Met Base — Base

Security Considerations

Base is built on the OP stack and, as a result, will have a very similar security profile to Optimism, one of the largest L2s right now.

Some of the risks that should be taken into consideration:

  • Base’s sequencer is centralized
  • The fraud proof system is still under development
  • The core smart contracts can be upgraded by a multi-sig
  • Further risk analysis can be found here: Optimism – L2BEAT

Technical Implementation

The smart contract system deployed on Base will be similar to that already deployed on Polygon and Arbitrum. The L1 Timelock will govern the Base contracts by sending messages to the L2 BridgeReceiver via the native message-passing bridge. More details of Compound III’s multi-chain governance can be found here.

The set of contracts that will be deployed on Base is detailed in the diagram below:

Copyright Waiver

Copyright and related rights waived via CC0.

License Exemption

We are requesting an exemption from the community that will allow the Base network to obtain a Compound Business Source License (BSL) to use the Licensed Work, update compound-community-licenses.eth, and deploy it on the Base network, provided that the deployment is subject to Ethereum Layer 1 Compound Protocol governance and control.

10 Likes

Gauntlet Initial Parameter Recommendations - Compound V3 USDC and WETH Comets on Base (7/28/23)

BASE is currently in Goerli testnet. Testnet liquidity, users, and TVL may not necessarily transfer over to mainnet, which means any parameters we recommend right now are based on assumed TVL and liquidity and MUST be revisited once mainnet is launched and liquidity flows in.

Summary

We provide two options to the community below. Option 1 is very conservative to test out Compound V3 mechanics. As such, the conservatism is less so derived from market risk (which is Gauntlet’s focus) but more so from the smart contract and other technical risks. Option 2 is aggressive and assumes that the community does not need to test Compound V3 mechanics on a new chain.

Option 1: Very Conservative (Test out Mechanics)

USDC Comet

Risk Parameters

Parameter WETH WBTC cbETH
Liquidation Factor 50% 45% 45%
Collateral Factor 45% 40% 40%
Liquidation Bonus 5% 5% 7%
Supply cap 5500 ($10M) 175 ($5M) 3750 ($7.5M)

Storefront Price Factor: 60%

Incentive Parameters

IR Curve: Same as Polygon USDC

Supply COMP Rewards Borrow COMP Rewards
10 5

WETH Comet

Risk Parameters

Parameter cbETH
Liquidation Factor 85%
Collateral Factor 88%
Liquidation Bonus 5%
Supply cap 3750 ($7.5M)

Storefront Price Factor: 50%

Incentive Parameters

IR Curve: Same as Ethereum WETH

Supply COMP Rewards Borrow COMP Rewards
5 0

Option 2: Aggressive (Assume mechanics are working, then increase the aggressiveness of parameters after inflow)

USDC Comet

Risk Parameters

Parameter WETH WBTC cbETH
Liquidation Factor 84% 76% 80%
Collateral Factor 79% 70% 75%
Liquidation Bonus 5% 5% 7%
Supply cap 11000 ($20M) 350 ($10M) 7500 ($15M)

Storefront Price Factor: 60%

We give supply cap recommendations based on assumed BASE TVL upon Compound deployment. Given it is unknown what the ratio of asset market cap proportions to total BASE TVL will be, the parameter values recommended here are an estimation based on assumptions, including cbETH having a higher circulating supply than wstETH on BASE, due to the Coinbase relationship. Again, these numbers depend on BASE TVL upon launch and may change.

Incentive Parameters

IR Curve: Same as Polygon USDC

Daily COMP Supply Rewards Daily COMP Borrow Rewards
30 15

Our COMP rewards recommendations are designed to offer appealing distribution APRs when the comet is first launched, and also when supply caps are highly utilized.

The relatively higher supply rewards incentivize a greater inflow of supply tokens into the protocol. This is important in the early stages of protocol growth since USDC supply is required before borrowers can join. Daily COMP rewards are subject to change as TVL rises and the markets evolve.

Given the recommended supply caps and liquidation factors, users can borrow at most $36.4M USDC. If users max out supply caps with an average borrow usage of 67% (current Polygon USDC borrow usage), then $24.6M USDC will be borrowed. If the protocol has $24.4M USDC borrows and distributes 15 daily COMP Borrow Rewards, the Borrow Distribution APR will be 1.61%. Now, assuming a 70% USDC utilization, the total supply required would be $34.8M USDC. If the protocol has $34.8M USDC supply and distributes 30 daily COMP Supply Rewards, the Supply Distribution APR will be 2.25%.

Note that it will take time for the Base ecosystem to grow and Compound TVL to grow to this end state. In the meantime, this reward distribution amounts to a daily cost of $3,225 and $1.1M annually given the current COMP price. The table below shows an example of how distribution and net APRs could evolve based on the protocol’s TVL.

USDC Supply USDC Borrows Utilization Supply APR Supply Distribution Net Supply APR Borrow APR Borrow Distribution Net Borrow APR
$5,000,000.00 $1,000,000.00 20.00% 0.65% 15.70% 16.35% 2.20% 39.24% 37.04%
$10,000,000.00 $3,000,000.00 30.00% 0.98% 7.85% 8.82% 2.55% 13.08% 10.53%
$20,000,000.00 $10,000,000.00 50.00% 1.63% 3.92% 5.55% 3.25% 3.92% 0.67%
$34,840,000.00 $24,388,000.00 70.00% 2.28% 2.25% 4.53% 3.95% 1.61% -2.34%

WETH Comet

Risk Parameters

Parameter cbETH
Liquidation Factor 93%
Collateral Factor 90%
Liquidation Bonus 5%
Supply cap 7500 ($15M)

Storefront Price Factor: 50%

Incentive Parameters

IR Curve: Same as Ethereum WETH

Supply COMP Rewards Borrow COMP Rewards
20 0

Given the recommended supply cap and liquidation factor, users can borrow at most $14M WETH. If users max out supply caps with an average borrow usage of 85% (current Ethereum WETH borrow usage), then $11.8M WETH will be borrowed. Now, assuming a 85% WETH utilization, the total supply required would be $27.5M WETH. A daily COMP supply reward distribution of 20 would yield a 1.90% Supply APR.

Note that it may take for the Base ecosystem to grow and Compound TVL to grow to this end state. In the meantime, this reward distribution amounts to a daily cost of $1,433 and $523,191 annually given the current COMP price. The table below shows how distribution and net APRs evolve based on the protocol’s TVL.

WETH Supply WETH Borrows Utilization Supply APR Supply Distribution Net Supply APR Borrow APR Borrow Distribution Net Borrow APR
$5,000,000.00 $1,000,000.00 20.00% 0.57% 10.46% 11.03% 2.03% 0.00% -2.03%
$10,000,000.00 $4,000,000.00 40.00% 1.14% 5.23% 6.37% 3.06% 0.00% -3.06%
$19,000,000.00 $8,000,000.00 42.11% 1.19% 2.75% 3.95% 3.17% 0.00% -3.17%
$27,575,581.40 $11,857,500.00 43.00% 1.22% 1.90% 3.12% 3.22% 0.00% -3.22%

Next Steps

We welcome the community’s feedback and will create a poll below to gauge the community’s preferences.

4 Likes

To gauge community sentiment, starting a poll here

  • Option 1: Very Conservative
  • Option 2: Aggressive
  • Abstain
0 voters

As mentioned in last week’s community call, Labs is planning to make the proposals to initialize the Base markets once a) all the assets (e.g. USDC) have been deployed on Base and b) Chainlink price feeds are available on Base. Until then, Labs is in a holding pattern because the proposal is blocked by these contracts being available.

1 Like

Thanks @Gauntlet we support the deployment of Compound III on Base!

We are in favour of the aggressive risk parameters to ensure Compound remains competitive with other lending protocol deployments on Base.

5 Likes

Thanks Gauntlet team for the analysis. We also agree with the aggressive parameter setting.

2 Likes

Following the conversations on this thread, recent community calls, Discord, and GitHub, a cUSDbCv3 (USDbC is the bridged version of USDC on Base) market has been deployed to Base from this pull request.

The parameters to enable the market are being finalized on this pull request. It includes Gauntlet’s recommended risk parameters (aggressive option) for the following assets:

  • WETH: $20.2M supply cap (11K tokens), 79% CF, 84% LCF, and 5% liquidation fee
  • cbETH: $14.4M supply cap (7.5K tokens), 75% CF, 80% LCF, and 7% liquidation fee

WBTC is not included as an initial collateral asset because it does not exist on Base yet.

The interest rate model for cUSDbCv3 is currently configured the same as cUSDCv3 on Polygon/Arbitrum. After the launch of the market, Gauntlet will monitor and consider recommendations to the interest rate model based on preliminary utilization & growth.

The assets and price feeds of the deployment use the following inputs:

OpenZeppelin has completed an additional audit of the bridged governance contracts and flows. Note that the audit is for Optimism, which Base is a fork of.

Finally, see the Initialization Proposal section below for more information about the next steps to enable the deployed market.

Deployed Contracts

cUSDbCv3: 0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf

This is the main proxy contract for interacting with the new market. The address should remain fixed and independent from future upgrades to the market. It is an OpenZeppelin TransparentUpgradeableProxy contract.

cUSDbCv3 Implementation: 0x75c07e9DF5B6EB30f6A40Fb124794aB0e0996322

This is the implementation of the market logic contract, as deployed by the Comet Factory via the Configurator.

cUSDbCv3 Ext: 0x2F9E3953b2Ef89fA265f2a32ed9F80D00229125B

This is an extension of the market logic contract which supports some auxiliary/independent interfaces for the protocol. This is used to add additional functionality without requiring contract space in the main protocol contract.

Configurator: 0x45939657d1CA34A8FA39A924B71D28Fe8431e581

This is a proxy contract for the ‘configurator’, which is used to set and update parameters of a Comet proxy contract. The configurator deploys implementations of the Comet logic contract according to its configuration. This pattern allows significant gas savings for users of the protocol by ‘constantizing’ the parameters of the protocol.

Configurator Implementation: 0x83E0F742cAcBE66349E3701B171eE2487a26e738

This is the implementation of the Configurator contract, which can also be upgraded to support unforeseen changes to the protocol.

Proxy Admin: 0xbdE8F31D2DdDA895264e27DD990faB3DC87b372d

This is the admin of the Comet and Configurator proxy contracts. It is a ProxyAdmin as recommended/implemented by OpenZeppelin according to their upgradeability pattern.

Comet Factory: 0x27C348936400791b7350d80Fb81Bc61Ad68dF4AE

This is the factory contract capable of producing instances of the Comet implementation/logic contract, and invoked by the Configurator.

Rewards: 0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1

This is a rewards contract which can hold rewards tokens (e.g. COMP) and allows claiming rewards by users, according to the core protocol tracking indices.

Bridge Receiver: 0x18281dfC4d00905DA1aaA6731414EABa843c468A

Receives bridged governance messages from the Base cross domain messenger contract and forwards them to the bridge timelock.

Bridge Timelock: 0xCC3E7c85Bb0EE4f09380e041fee95a0caeDD4a02

The governor of the Comet deployment, exclusively receiving input from Ethereum mainnet governance through the bridge receiver.

Initialization Proposal

To initialize the market, the deployment process is similar to the initialization of cUSDCv3 on Ethereum mainnet, the primary difference being the bridging of governance actions to Base, instead of taking place directly on the governance chain (Ethereum mainnet).

The initialization proposal will take the following actions:

  1. Set Comet configuration, deploy new Comet on Base, and set rewards configuration. This sends the encoded setConfiguration and deployAndUpgradeTo and setRewardConfig calls across the bridge to the governance receiver on Base. Rewards will be allocated according to Gauntlet’s aggressive suggestion: 30 COMP/day to the supply side and 15 COMP/day to the borrow side.

  2. Approve Base’s L1StandardBridge to take Timelock’s USDC, in order to seed the market reserves through the bridge.

  3. Deposit 10K USDC from mainnet to the Base L1StandardBridge contract to bridge to Comet.

  4. Approve Base’s L1StandardBridge to take Timelock’s COMP, in order to seed the rewards contract through the bridge.

  5. Deposit 12.5K COMP from mainnet to the Base L1StandardBridge contract to bridge to CometRewards.

  6. Write the ENS TXT record v3-official-markets on v3-additional-grants.compound-community-licenses.eth containing the official markets JSON.

  7. Reduce the COMP distribution to v2 cUSDC suppliers by 45 COMP/day, so as to keep the total COMP distribution constant.

The deployment and proposal migrations have been built using the Comet scenario framework and deployed using the Comet deployment manager. The scenario checks can be seen from the proposal branch CI checks.

4 Likes

The proposal has been created and will start voting in 2 day.

6 Likes

Thanks everyone for voting. The proposal has passed and reached quorum. It will be executable on Base on Saturday.

7 Likes

cWETHv3 market on Base

Following the conversations on this thread, recent community calls, Discord, and GitHub, a cWETHv3 market has been deployed to Base from this pull request.

The parameters to enable the market are being finalized on this pull request. It includes Gauntlet’s recommended risk parameters (aggressive option) and latest recommendations for the WETH market for the following assets:

  • cbETH: $14.5M supply cap (7.5K tokens), 90% CF, 93% LCF, and 2.5% liquidation fee

The community can add more liquid staking derivatives as collateral to the market once other options get supported on Base.

The interest rate model for cWETHv3 is configured to match Gauntlet’s latest recommendations for the WETH market. After the launch of the market, Gauntlet will monitor and consider recommendations to the interest rate model based on preliminary utilization & growth.

The assets and price feeds of the deployment use the following inputs:

  • The base asset, WETH, uses a constant price feed of unity in terms of ETH with 8 decimals.
  • For cbETH, a scaling price feed is used to convert the Chainlink cbETH / ETH price feed’s 18 decimals to the constant 8 decimals that Comet expects.

OpenZeppelin has completed an additional audit of the bridged governance contracts and flows. Note that the audit is for Optimism, which Base is a fork of.

The cWETHv3 market has been deployed to 0x46e6b214b524310239732D51387075E0e70970bf.

Finally, see the Initialization Proposal section below for more information about the next steps to enable the deployed market.

Initialization Proposal

To initialize the market, the deployment process is similar to the initialization of cWETHv3 on Ethereum mainnet, the primary difference being the bridging of governance actions to Base, instead of taking place directly on the governance chain (Ethereum mainnet).

The initialization proposal will take the following actions:

  1. Send a cross-chain message to Base, triggering a series of actions. These actions are to set the CometFactory for the new Comet, set the Comet configuration, deploy a new Comet implementation, set COMP as the reward token for the deployment, wrap some ETH to WETH, and transfer WETH to the cWETHv3 contract as initial reserves. The initial supply speed will be 20 COMP/day and borrow speed will be 0 COMP/day.

  2. Bridge 10 ETH from the mainnet Timelock to the Base Timelock, to be wrapped as WETH and seeded as initial reserves to the cWETHv3 market.

  3. Write the ENS TXT record v3-official-markets on v3-additional-grants.compound-community-licenses.eth containing the official markets JSON.

  4. Reduce the COMP distribution to v2 cUSDC borrowers by 20 COMP/day, so as to keep the total COMP distribution constant.

The deployment and proposal migrations have been built using the Comet scenario framework and deployed using the Comet deployment manager. The scenario checks can be seen from the proposal branch CI checks.

4 Likes

Are there any plans to launch a native USDC comet on Base? This would better integrate with exchanges e.g. Coinbase where it is only possible to withdraw native USDC to Base and not USDbC.

A similar process was implemented with USDC on Arbitrum. I highly suspect over the coming months and years the majority of USDC coming onto Base will be native and not bridged.

1 Like

Agree, it would be great to see a native USDC Comet be spun up on Base. As you said, native USDC provides the best UX due to the ability to transfer it directly from Coinbase.

Labs is not actively working on this, since we’re currently focused on some other priorities. This would be a great project for the rest of the community to work on (e.g. via the grants program).

4 Likes