Add Market: LINK

Ooh, I didn’t know that! This would be 10 operations just calling _setCompSpeed. I’m guessing Governor Bravo doesn’t increase the number of operations?

  • Speaking of Governor Bravo do we know if the Compound Governance UI and comp.vote are supporting Bravo yet? @arr00 do you know if the governance UI’s are supporting Bravo now?
  • For testing deploying new LINK market and/or Governor Bravo proposals, which testnet would be best to use?

Maybe for the comp speed updates (10 operations) we make that a separate proposal and do them back to back?

@TylerEther we’re getting closer to having values for all the market parameters to add the LINK market. We also need to review which contract code will be used for each smart contract used for the new market.

  • cLINK proxy contract (stored cToken state and delegates functionality to implementation)

    • CErc20Delegator, recently deployed for cWBTC2 market
      Constructor Argument Value Note
      underlying_ (address) 0x514910771af9ca656af840dff83e8264ecf986ca (LINK)
      comptroller_ (address) 0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b
      interestRateModel_ (address) 0xd956188795ca6f4a74092ddca33e0ea4ca3a1395 (shared with cCOMP)
      initialExchangeRateMantissa_ (uint256) 200000000000000000000000000 Copied from cCOMP
      name_ (string) "Compound ChainLink Token" or "Compound LINK" ?
      symbol_ (string) "cLINK"
      decimals_ (uint8) 8
      admin_ (address) 0x6d903f6003cca6255d85cca4d3b5e5146dc33925 Timelock
      implementation_ (address) 0x24aa720906378bb8364228bddb8cabbc1f6fe1ba (shared with cWBTC2)
      becomeImplementationData (bytes) 0x
  • cLINK Implementation contract (implements functionality used by the proxy contract)

    • CErc20Delegate (from arr00: implementation can be shared with cWBTC2)
  • The current PriceOracle contract used by the Comptroller already is configured for LINK so I don’t think any changes are needed there. The important thing is that the underlying address for LINK matches the value in the oracle (the price lookup uses this).

I’m sure there are things I’m missing but I wanted to get the discussion started on details needed to make the LINK market live. This might be something which can be tried on a testnet, or a test environment like ganache cli or hardhat (something to fork mainnet for testing). Help is available on the #development channel of Discord for any technical questions.

2 Likes

Thanks @mistertom

It looks like we won’t need to update any COMP distribution speeds. They’re all calculated based on utility. They’ll be automatically updated when the new market is added. :slight_smile:

1 Like

Thanks for taking the lead to getting this done. I’m quite supportive as long as the parameters are acceptable. I will try to catch up on the conversation soon and have some more constructive input.

Something that caught my eye and I’d like to point out:

We actually can, and should, use the exact same implementation already deployed for cWBTC2. It is at this address 0x24aa720906378bb8364228bddb8cabbc1f6fe1ba.

3 Likes

That was changed in proposal 33. We still will have to do it manually but those are details for the proposal, don’t need to be figured out for first steps of making the new market. blck said we have up to 10 operations per proposal so maybe we could just reallocate the comp reward from less markets or allocate it from the excess accruing.

It was causing too much gas usage for users interacting with Compound and there was also a need to reduce the size of comptroller contract for some future features being considered.

2 Likes

Ah good point. Because it doesn’t store any data/state then it can be shared by multiple proxy contracts. Thanks for this detail, I’ll update the post with the same implementation address used by cWBTC2.

1 Like

Agree; starting with a 0% collateralFactor is a “no risk” approach to add the asset. Based on @jmo and Gauntlet’s recommendations, there can be an immediate follow-up proposal to raise the collateralFactor, after the market develops.

I think the simplest (and most fair?) approach, would be to draw it from “similar” assets; UNI, BAT, ZRX; set LINK and these to 0.0014625, which would preserve the total COMP per day distribution, both of collateral assets, and for the total distribution.

5 Likes

I think we’re ready for the proposal.

Here’s the script to deploy the cLINK contract:

npx saddle -n mainnet script token:deploy '{
  "underlying": "0x514910771af9ca656af840dff83e8264ecf986ca",
  "comptroller": "$Comptroller",
  "interestRateModel": "0xd956188795ca6f4a74092ddca33e0ea4ca3a1395",
  "initialExchangeRateMantissa": "2.0e26",
  "name": "Compound ChainLink Token",
  "symbol": "cLINK",
  "decimals": "8",
  "admin": "$Timelock",
  "implementation": "0x24aa720906378bb8364228bddb8cabbc1f6fe1ba",
  "becomeImplementationData": "0x"
}'

This is using an updated version of token:deploy: https://github.com/TRiLeZ/compound-protocol/tree/update-deploy-token. Tested and works nicely.

I need someone to verify that those parameters are correct.

For the governance proposal:

  • Collateral factor: 0%
  • Reserve factor: 25%
  • Comp speed: 0.0014625 (set for LINK, BAT, UNI, and ZRX)
3 Likes

My apologies for screwing up the initialExchangeRateMantissa_ … I was copying from the cWBTC2 contract deployment rather than doing the math myself. Unfortunately this one for LINK is different because underlying decimals for ChainLink Token are 18. I’ve corrected my earlier post with this new value.

The standard cToken initial exchange rate for Compound is 0.02 scaled. The goal is to have 50 cTokens = 1 underlyingToken when the market is first deployed. In our case for cLINK, the math is:

  • 0.02 * 10^(18 + underlyingDecimals - cTokenDecimals)
  • = 0.02 * 10^(18+18-8)
  • = 0.02 * 10^28 … floating-point representation …
  • = 2e26 … unsigned scaled integer representation … (value used for constructor)

Your math looks good to me!

1 Like

The math works well with reallocation of COMP distribution from UNI/BAT/ZRX. I’ve updated the post above to indicate rebalancing those three for equal distribution with LINK.

1 Like

50 cTokens = 1 underlyingToken really clears up the confusion. Thanks for this! :slightly_smiling_face:

2 Likes

I don’t think it’s “most fair” distribution. I suggest we keep UNI,BAT and ZRX distributions where they are. They are modest and actually kind of fairly distributed, getting only their share of 10% from total daily distribution equally distributed between all existing markets, without any additional initiatives unlike stable coins and some other markets like COMP (which actually getting unfair portion, due to existense of COMP market CAP). There is no real reason to decrease distributions to minor markets. Instead decrease DAI and USDC distribution in equal portion to create 0.00195 distribution for LINK. Which will be decrease of 0.000975 for both DAI and USDC. Distribution is still massively shifted towards stable coins at the expense of everything else.

Alternatively, distribution for LINK could be completely drawn from COMP, which is distorted market for a long time, producing unfair distribution to early borrowers, actually paying them to borrow COMP and at same time blocking new borrowers from joining. And since governance is adamant in not raising CAP at COMP market, to let market fix overinsentivisation of borrowing, that is actually a way to kind of apply a patch, by removing extra distributions and directing it to LINK market.

Removing 0.00195 from COMP probably wouldn’t completely fix COMP market, but will make it less ugly then it is now. with it’s -7% APY for borrowing (yes, minus, you getting paid for borrow COMP) But that minus 7% isn’t for everybody, but only exclusevely for those, who already borrowed. New people can’t borrow, because CAP :slight_smile:

2 Likes

Thank you for outlining this problem. 0 COMP able to be borrowed but the utilization rate is reported to be 16.16%.

Utilization rates need to be updated to take borrow caps into effect.

A new thread/proposal should be created to address this.

2 Likes

Are the simulations of the proposal somewhere (e.g. GitHub) where we can review them?

1 Like

Deployments

These use the updated token:deploy script found here.

Ropsten

npx saddle -n ropsten script token:deploy '{
  "underlying": "0x8fa29bece84a731008f585aac8f47a08bf4e33c6",
  "comptroller": "$Comptroller",
  "interestRateModel": "0x2341Ba42Eb00c63CF03559c9A2295a23ace7E4aD",
  "initialExchangeRateMantissa": "2.0e26",
  "name": "Compound ChainLink Token",
  "symbol": "cLINK",
  "decimals": "8",
  "admin": "$Timelock",
  "implementation": "0x0295a48b76bc68662bd15bfaecedca075a4f568f",
  "becomeImplementationData": "0x"
}'

Mainnet

npx saddle -n mainnet script token:deploy '{
  "underlying": "0x514910771af9ca656af840dff83e8264ecf986ca",
  "comptroller": "$Comptroller",
  "interestRateModel": "0xd956188795ca6f4a74092ddca33e0ea4ca3a1395",
  "initialExchangeRateMantissa": "2.0e26",
  "name": "Compound ChainLink Token",
  "symbol": "cLINK",
  "decimals": "8",
  "admin": "$Timelock",
  "implementation": "0x24aa720906378bb8364228bddb8cabbc1f6fe1ba",
  "becomeImplementationData": "0x"
}'

Proposal

Ropsten

Comptroller._supportMarket(0x92c27d1E28dFa05662a46fCc70C5F4aDc392b3E9)
Support cLINK

Comptroller._setCollateralFactor(0x92c27d1E28dFa05662a46fCc70C5F4aDc392b3E9, 0)
0% collateral factor

cLINK._setReserveFactor(250000000000000000)
25% reserve factor

See here.

Mainnet

Comptroller._supportMarket(0xface851a4921ce59e912d19329929ce6da6eb0c7)
Support cLINK

Comptroller.setCollateralFactor(0xface851a4921ce59e912d19329929ce6da6eb0c7, 0)
0% collateral factor

Comptroller._setCompSpeed(0xface851a4921ce59e912d19329929ce6da6eb0c7, 1462500000000000)
compSpeed(cLINK) = 0.0014625

Comptroller._setCompSpeed(0x6C8c6b02E7b2BE14d4fA6022Dfd6d75921D90E4E, 1462500000000000)
compSpeed(cBAT) = 0.0014625

Comptroller._setCompSpeed(0x35a18000230da775cac24873d00ff85bccded550, 1462500000000000)
compSpeed(cUNI) = 0.0014625

Comptroller._setCompSpeed(0xB3319f5D18Bc0D84dD1b4825Dcde5d5f7266d407, 1462500000000000)
compSpeed(cZRX) = 0.0014625

cLINK._setReserveFactor(250000000000000000)
25% reserve factor

4 Likes

Looks good to me. The contract deployed to 0xFAce851a4921ce59e912d19329929CE6da6EB0c7 matches the expected value.

Would like to see some simulations prior to actual proposal, but once those are in, I’m very excited for this to be proposed. Good job.

You can base simulations on this one I wrote a while back. You will need to migrate it to work with governor bravo, but that shouldn’t be much of an issue.

7 Likes

With @arr00’s help, I’ve written these simulations: compound-protocol/hypothetical_clink_integration.scen at clink-integration · TRiLeZ/compound-protocol · GitHub

The simulations pass!

Give me the go-ahead and I’ll submit a CAP :slight_smile:

4 Likes

@blck would you be willing to fast track this to full proposal with your 100k+ voting power? CAP always takes so long and painful to gather the 100k delegation.

@sukernik is it possible to grant something to @TylerEther for work on making this LINK market happen. I don’t see it in the list of funded grants so maybe hasn’t been applied for yet.

1 Like

i have to wait till the active one is gone, cannot have more than one active

2 Likes