Deploy Compound III on Optimism

Deploy Compound V3 on Optimism

Preamble:

Type: Multichain Deployment
Title: Deploy Compound III on Optimism
Authors: @markg from Optimism Foundation, @bryancolligan & @sharp (Compound Growth Program)

Proposal Introduction

Point of contact(POC): @bryancolligan @Sharp

Overview of Proposal:

The Compound Growth Program, after conversations with various stakeholders and community members, identified Compound deployment on Optimism as one of the top priorities for the program. A further conversation with community members from Optimism validated our argument to expand Compound to Optimism. In line with our priorities, we propose deploying Compound V3 on Optimism Mainnet.
Note: A proposal with similar scope was also posted a year ago, but it could not be completed due to multiple factors. You can find the earlier proposal here Deploy Compound v3 on Optimism

Motivation:

Optimism is a Layer 2 scaling solution for Ethereum, designed to enhance the network’s capacity and speed while significantly reducing transaction costs. It operates on the principle of Optimistic Rollups, a technology that allows for the execution of smart contracts and transactions off the main Ethereum blockchain (Layer 1), but with the same level of security and decentralization. This is achieved by assuming transactions are valid by default and only running computations in the event of a dispute. This method drastically increases throughput and efficiency, making it an attractive option for decentralized applications (dApps) looking to scale without sacrificing Ethereum’s robust security model.

Optimism is EVM Compatible, in line with Compound’s requirements for deploying on new chains. Additionally, Optimism has introduced a novel funding mechanism known as Retroactive Public Goods Funding, which aims to sustainably fund projects contributing to the public good, leveraging a portion of transaction fees generated on the network.

Launching Compound on Optimism mainnet represents a strategic move to leverage these benefits. Compound stands to gain enhanced efficiency, reduced gas fees, and faster transactions, thereby providing more avenues for Compound users. Optimism users to gain services of the oldest, largest and most secure defi protocol. This integration demonstrates Compound’s commitment to scalability and cost-effective operations and aligns with the community’s efforts to address network congestion and high transaction fees. It positions Compound favorably in the competitive DeFi landscape, opening new avenues for growth and innovation on a platform designed for the future of decentralized finance.

Grant Application:

A developer team planned to apply to Grants for this deployment, but L2 deployment is left out of the scope of the Compound Grants program. Due to this CGP won’t be able to fund this project. The Compound Growth program will be activating its own developer fund to finance the development of this integration. In this case, the team initially applying for CGP has been enabled to move forward with the deployment. The total grant awarded to the team is $23,800 for this development.

Non-Technical Evaluation

The following statistics were recorded on Feb 6th 2024

  1. TVL on the Chain: $775M

  2. Amount of protocols on the chain: 181+

  3. (#) of unique addresses on the chain: 110M

  4. Active Addresses: Nansen

  5. 1 Day: 97K

  6. 7 Day: 534k

  7. 30 Day: 1.23M

Rationale

Optimism is one of the top L2s, it has considerable activity and Liquidity as a chain.

Additionally, the Optimism Grants programs provide an opportunity for Compound to apply and get some incentives to promote activity on Compound V3 which will be on Optimism. Currently Optimism has two funding mechanisms, the Optimism Grants which happen in cycles and also the RetroPGF funding for projects on Optimism. An additional Partner Fund also exists that Compound can tap into.

Proposed Markets

  • Native USDC (64 Million)
  • USDT (341 Million)

For collateral assets, we propose LINK, OP, WBTC, Wrapped ETH(wETH), LDO. We will be looking forward to the community to give more feedback in this direction.

Security Considerations

Some of the risks that should be taken into consideration:

  1. OP sequencer is centralized. There are plans to incorporate decentralized sequencing with teams such as Espresso in the future. However, a core security goal of Optimism is that despite the current centralization, the Sequencer should not be able to prevent users from submitting transactions to the L2 chain. Users of OP Stack chains can always bypass the sequencer and include transactions in the L2 chain by sending their L2 transactions directly to the OptimismPortal contract on L1.
  2. The Fault proof system is live on OP Goerli, currently at Stage 0 of fault proofs. Stage 0 means L2 state roots are posted to Ethereum L1, inputs for the state transition function are posted to L1, and a source-available node exists that can recreate the state from L1 data.
  3. Further risk analysis can be found here: Optimism – L2BEAT

Copyright Waiver

Copyright and related rights waived via CC0 2

9 Likes

Optimism is currently at the center of a lot of growth, with many chains utilizing the OP stack and the superchain narrative becoming more prevalent. We support the launch of Compound on Optimism and expect that it will be welcomed by users looking for reliable alternatives to the current lending and borrowing options. We see this as a deployment that will necessarily drive growth and bring more revenue to the bottom line.

6 Likes

Adding USDT market makes perfect sense. Its massive presence on Optimism dwarfs both USDC and USDC.e combined. Launching with wETH, wBTC, and OP as collateral seems like a solid first step.

5 Likes

Hello, Compound community. Me and my team are working on the technical implementation of Comets deployment on Optimism. A brief intro about us: we are a team of 12 independent developers gathered under the Bergman Software willing to bring value to the Compound community and protocol.

After discussions with community members, we have started the development of USDT and USDC markets.

With the following collateral for both markets:

  • LINK
  • OP
  • wBTC
  • wETH
  • LIDO

If the community would like to change or add any suggestions we are more than open to consider them.

1 Like

Thanks for starting the work on those markets. It definitely will be exciting to have Comet on Optimism.

In terms of collateral assets, tokens like LIDO and LINK have very low liquidity on Optimism right now and probably aren’t ready to be used as collateral there. Currently, there is around $1.8mn of LIDO and $7.2mn of LINK on Optimism. Alternatively, an asset like wstETH has $120mn of liquidity on Optimism and would make more sense IMO.

5 Likes

[Gauntlet] Optimism v3 USDT & USDC Initial Asset Listing Recommendations

Simple Summary

Gauntlet is excited for the Compound community to expand into Optimism. We recommend the following initial parameter recommendations for the USDT and USDC Comets on Optimism.

Asset Recommendation

USDT Risk Parameters

Asset Collateral Factor Liquidation Factor Liquidation Penalty Supply Cap
WETH 83% 90% 5% 1,600 ($5.1M)
WBTC 80% 85% 5% 60 ($3.3M)
OP 65% 70% 20% 400,000 ($1.5M)
wstETH 75% 80% 10% 300 ($1.1M)

USDC Risk Parameters

Asset Collateral Factor Liquidation Factor Liquidation Penalty Supply Cap
WETH 83% 90% 5% 1,600 ($5.1M)
WBTC 80% 85% 5% 60 ($3.3M)
OP 65% 70% 20% 700,000 ($2.7M)
wstETH 75% 80% 10% 500 ($1.8M)

Gauntlet recommends against listing LDO and LINK based on their liquidity on decentralized exchanges (DEX). Presently, exchanging 4,000 LDO (valued at $12,000) for USDT results in a 32% slippage, while swapping 20,000 LINK (worth $389,000) incurs a 15% slippage. USDC cap recommendations are higher than USDT, reflecting the higher liquidity paths to USDC relative to USDT within decentralized exchange liquidity.

Storefront Price Factor: 60%

Gauntlet recommends keeping the storefront price factor at 60% for both Comets.

Target Reserves: 20,000,000

After Gauntlet’s forum post analyzing Target Reserves, Gauntlet recommends a target reserve of 20M for both Comets.

IR Curve Parameters

Gauntlet recommends the following IR parameters for USDC and USDT Comets:

IR Parameter Value
borrow per year interest rate base 0.015
borrow per year interest rate slope low 0.061
borrow kink 0.90
borrow per year interest rate slope high 3.2
supply per year interest rate base 0
supply per year interest rate slope low 0.059
supply kink 0.90
supply per year interest rate slope high 2.9

The chart above demonstrates that the generation of Comet USDT reserves will be positive when utilization exceeds 72%.

Considering the market equilibrium assumption of reaching 90% utilization, the following chart forecasts annualized reserves corresponding to various borrowing amounts. At $10M borrows, the Comets would generate annual reserves of $98k.

Incentive Parameters

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

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

USDT Comet Incentives

Daily COMP Supply Rewards Daily COMP Borrow Rewards
5 5

Here’s an update on the current COMP rewards structure in Optimism v3 USDT:

  • Daily COMP Supply Rewards: 5 COMP
  • Daily COMP Borrow Rewards: 5 COMP

Assuming full usage of supply caps and current liquidation factors, the total borrowing power would be $9.3M.

Here’s a breakdown based on our assumptions:

  • Borrow Usage (60%): This leads to a borrowing volume of $5.5M.
  • Utilization (90%): Corresponding to a supply volume of $6.2M.

With the above utilization and the present Interest Rate curve:

  • Supply APR: 5.31%
  • Borrow APR: 6.99%

Given the current COMP price of $78:

  • Supply Distribution APR: 2.29%
  • Borrow Distribution APR: 2.54%

This results in the following Net APRs:

  • Net Supply APR: 7.60%
  • Net Borrow APR: 4.45%

USDC Comet Incentives

Daily COMP Supply Rewards Daily COMP Borrow Rewards
5 5

Here’s an update on the current COMP rewards structure in Optimism v3 USDC:

  • Daily COMP Supply Rewards: 5 COMP
  • Daily COMP Borrow Rewards: 5 COMP

Assuming full usage of supply caps and current liquidation factors, the total borrowing power would be $10.7M.

Here’s a breakdown based on our assumptions:

  • Borrow Usage (60%): This leads to a borrowing volume of $6.4M.
  • Utilization (90%): Corresponding to a supply volume of $7.1M.

With the above utilization and the present Interest Rate curve:

  • Supply APR: 5.31%
  • Borrow APR: 6.99%

Given the current COMP price of $78:

  • Supply Distribution APR: 1.99%
  • Borrow Distribution APR: 2.21%

This results in the following Net APRs:

  • Net Supply APR: 7.30%
  • Net Borrow APR: 4.78%

The chart above illustrates the Distribution Annual Percentage Rates (APRs) across various supply levels, assuming a 90% utilization rate. It’s noteworthy that APRs exceeding 2% will persist until the market’s supply reaches $8M. These incentive distributions are strategically designed to accelerate the USDT and USDC Comets. The current projected net APRs are within reasonable ranges.

Gauntlet welcomes any community feedback.

3 Likes

Dear Compounders! Our team just pushed a PR with USDC and USDT Markets on Optimism network: Deploy Compound III on Optimism by dmitriy-bergman-works · Pull Request #833 · compound-finance/comet · GitHub

Looking forward to OpenZeppeling audit and community feedback to push on-chain proposal!

2 Likes

Optimism Comet Deployment Assessment

Updated April 10, 2024

Initially we reviewed pull request Deploy Compound III on Optimism by dmitriy-bergman-works · Pull Request #833 · compound-finance/comet · GitHub of the compound-finance/comet repository at commit b329070. This was a set of deployment and migration scripts that deployed Comet USDC and USDT on the Optimism network. After the first review of the scripts, with new changes after the initial stage of the audit, the scope was reduced to only USDC scripts on commit 2abd324, the changes can be found here.

In scope were the following files:

deployments
└── optimism
    ├── usdc
    │   ├── configuration.json
    │   ├── deploy.ts
    │   └── migrations
    │       └── 1707394874_configurate_and_ens.ts
    └── usdt
        ├── configuration.json
        ├── deploy.ts
        └── migrations
            └── 1707399040_configurate_and_ens.ts

Low Severity

Outdated verification of state changes

Changes of the migration script up to commit 874052 contain code changes including:

  • Setting baseSupplySpeed and baseBorrowSpeed to zero.
  • Setting supplyCap for all collateral assets to zero.
  • Removing wstETH as collateral form the USDC Comet.

However, these changes are not reflected in the verify function. Consider the following changes:

  • Change the expected values of baseTrackingBorrowSpeed and baseTrackingSupplySpeed to zero.
  • Change the expected supplyCap values to zero.
  • Remove wstETH from the list of expected changes.

Notes & Additional Information

Inaccurate Proposal Description

The description of the proposal states that there will be an emission of 5 COMP/day for both borrowing and lending on the upcoming USDC market. However, in recent changes to the migration script, the baseSupplySpeed and baseBorrowSpeed were set to zero.

Consider adapting the proposal description to reflect recent changes.

Update: Resolved in commit 05a1f00

Conclusion

In this audit, our initial focus was on the deployment of Compound V3 USDC and USDT markets on Optimism. After the first phase of the audit, the OpenZeppelin team concluded that under normal conditions, the contracts are likely to be deployed successfully without issues. However, it is important to highlight a concern regarding the initialization of the BridgeReceiver contract which was also noted in a previous audit: this contract can be initialized by any address. Although the BridgeReceiver is deployed and initialized within the same script, these actions occur in different transaction contexts which can be modified by the block proposer. This means that verifying the deployment after the script is run is also important. In such scenarios where the contract is initialized by an unexpected address, we recommend restarting the deployment process in a more secure and controlled environment.

Later on, the scope was reduced to only include the USDC market. Our team at OpenZeppelin has carefully reviewed the new changes to the deployment scripts and is confident that the initial deployment of the contracts will proceed without issue. However, the verify function fails to check the appropriate values, leading to failure in the verifying step of the deployed contract.

To sum up, the scripts are fundamentally correct, and the deployment process is expected to go through successfully while minor fixes need to be implemented.

2 Likes

After consideration of OpenZeppelin audit, community feedback and Compound Labs comments, we created an on-chain proposal.

2 Likes

Proposal 238 Review

OpenZeppelin reviewed the proposal Initialize cUSDCv3 on Optimism and confirmed the Inaccurate Proposal Description note from the assessment was addressed before proposing to the community. The assessment was updated with the commit that resolved the issue.

2 Likes

The onchain proposal has reached quorum and majority support. We thank all the community members, service providers and delegates that helped in deploying the protocol to Optimism.

A note, the USDC Market is deployed on Compound, we will also be aiming to deploy the USDT market on Optimism as well, but this will be alsongside a larger effort to launch USDT markets on other chains Including Mainnet and Arbitrum. We will keep the Community updated.

2 Likes