8000 Refactor proposal to make market live by jflatow · Pull Request #640 · compound-finance/comet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Refactor proposal to make market live #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deployments/mainnet/weth/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "0e15",
"baseSupplySpeed": "447916666666",
"baseBorrowSpeed": "0e15",
"baseMinForRewards": "1000000e6"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: need to follow up on this value

},
Expand All @@ -31,15 +31,15 @@
"borrowCF": 0.90,
"liquidateCF": 0.93,
"liquidationFactor": 0.95,
"supplyCap": "0"
"supplyCap": "9000"
},
"wstETH": {
"address": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
"decimals": "18",
"borrowCF": 0.90,
"liquidateCF": 0.93,
"liquidationFactor": 0.95,
"supplyCap": "0"
"supplyCap": "80000"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { DeploymentManager, migration } from '../../../../plugins/deployment_manager';
import { calldata, exp, proposal } from '../../../../src/deploy';
import { calldata, exp, getConfigurationStruct, proposal } from '../../../../src/deploy';

import { expect } from 'chai';

const cETHAddress = '0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5';
const COMPAddress = '0xc00e94cb662c3520282e6f5717214004a7f26888';

export default migration('1666906928_raise_supply_caps_and_seed_reserves_and_rewards', {
export default migration('1666906000_configurate_seed_reserves_and_rewards', {
prepare: async (deploymentManager: DeploymentManager) => {
return {};
},
Expand All @@ -15,6 +15,7 @@ export default migration('1666906928_raise_supply_caps_and_seed_reserves_and_rew
const trace = deploymentManager.tracer();
const ethers = deploymentManager.hre.ethers;

const cometFactory = await deploymentManager.fromDep('cometFactory', 'mainnet', 'usdc');
const {
governor,
comptrollerV2,
Expand All @@ -27,6 +28,8 @@ export default migration('1666906928_raise_supply_caps_and_seed_reserves_and_rew
cbETH,
} = await deploymentManager.getContracts();

const configuration = await getConfigurationStruct(deploymentManager);

const actions = [
// 1. Set v2 cETH speeds to 0
{
Expand All @@ -35,22 +38,18 @@ export default migration('1666906928_raise_supply_caps_and_seed_reserves_and_rew
args: [[cETHAddress], [0], [0]],
},

// 2. Increase v3 supply reward speed
// 2. Set the factory in the Configurator
{
contract: configurator,
signature: 'setBaseTrackingSupplySpeed(address,uint64)',
args: [comet.address, exp(38.7 / 86400, 15, 18)], // ~ 38.7 COMP / day cut from v2
signature: 'setFactory(address,address)',
args: [comet.address, cometFactory.address],
},

// 3. Increase supply caps for each of the assets
// 3. Set the configuration in the Configurator
{
contract: configurator,
signature: "updateAssetSupplyCap(address,address,uint128)",
args: [comet.address, wstETH.address, exp(80_000, 18)], // ~ $100M / $1225
}, {
contract: configurator,
signature: "updateAssetSupplyCap(address,address,uint128)",
args: [comet.address, cbETH.address, exp(9_000, 18)], // ~ $10M / $1091
signature: 'setConfiguration(address,(address,address,address,address,address,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint104,uint104,uint104,(address,address,uint8,uint64,uint64,uint64,uint128)[]))',
args: [comet.address, configuration],
},

// 4. Deploy and upgrade to a new version of Comet
Expand Down Expand Up @@ -101,20 +100,25 @@ export default migration('1666906928_raise_supply_caps_and_seed_reserves_and_rew
cbETH,
} = await deploymentManager.getContracts();

// XXX re-align, check more things
// XXX re-write proposal text

// 1.
expect(await comptrollerV2.compSupplySpeeds(cETHAddress)).to.be.equal(0);
expect(await comptrollerV2.compBorrowSpeeds(cETHAddress)).to.be.equal(0);

// 2. & 4.
expect(await comet.baseTrackingSupplySpeed()).to.be.equal(447916666666n);
expect(await comet.baseTrackingBorrowSpeed()).to.be.equal(0);
// 2.
// XXX

// 3. & 4.
expect(await comet.baseTrackingSupplySpeed()).to.be.equal(exp(38.7 / 86400, 15, 18)); // ~ 38.7 COMP / day cut from v2
expect(await comet.baseTrackingBorrowSpeed()).to.be.equal(0);

const wstETHInfo = await comet.getAssetInfoByAddress(wstETH.address);
expect(wstETHInfo.supplyCap).to.be.equal(exp(80_000, 18));
expect(wstETHInfo.supplyCap).to.be.equal(exp(80_000, 18)); // ~ $100M / $1225

const cbETHInfo = await comet.getAssetInfoByAddress(cbETH.address);
expect(cbETHInfo.supplyCap).to.be.equal(exp(9_000, 18));
expect(cbETHInfo.supplyCap).to.be.equal(exp(9_000, 18)); // ~ $10M / $1091

// 5.
const config = await rewards.rewardConfig(comet.address);
Expand Down
0