forked from compound-finance/comet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy compound v3 usdt market (compound-finance#848)
Forum thread - https://www.comp.xyz/t/deploy-compound-iii-on-optimism/4975 --------- Co-authored-by: Mikhailo Shabodyash <67977488+EviLord032@users.noreply.github.com> Co-authored-by: GitHub Actions Bot <>
- Loading branch information
1 parent
3ed7bbf
commit caa66a3
Showing
9 changed files
with
516 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "Compound USDT", | ||
"symbol": "cUSDTv3", | ||
"baseToken": "USDT", | ||
"baseTokenAddress": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58", | ||
"baseTokenPriceFeed": "0xECef79E109e997bCA29c1c0897ec9d7b03647F5E", | ||
"pauseGuardian": "0x3fFd6c073a4ba24a113B18C8F373569640916A45", | ||
"borrowMin": "1e5", | ||
"storeFrontPriceFactor": 0.6, | ||
"targetReserves": "20000000e6", | ||
"rates": { | ||
"supplyKink": 0.9, | ||
"supplySlopeLow": 0.059, | ||
"supplySlopeHigh": 2.9, | ||
"supplyBase": 0, | ||
"borrowKink": 0.9, | ||
"borrowSlopeLow": 0.061, | ||
"borrowSlopeHigh": 3.2, | ||
"borrowBase": 0.015 | ||
}, | ||
"tracking": { | ||
"indexScale": "1e15", | ||
"baseSupplySpeed": "0e15", | ||
"baseBorrowSpeed": "0e15", | ||
"baseMinForRewards": "1000e6" | ||
}, | ||
"assets": { | ||
"OP": { | ||
"address": "0x4200000000000000000000000000000000000042", | ||
"priceFeed": "0x0D276FC14719f9292D5C1eA2198673d1f4269246", | ||
"decimals": "18", | ||
"borrowCF": 0.65, | ||
"liquidateCF": 0.7, | ||
"liquidationFactor": 0.8, | ||
"supplyCap": "0e18" | ||
}, | ||
"WETH": { | ||
"address": "0x4200000000000000000000000000000000000006", | ||
"priceFeed": "0x13e3Ee699D1909E989722E753853AE30b17e08c5", | ||
"decimals": "18", | ||
"borrowCF": 0.83, | ||
"liquidateCF": 0.9, | ||
"liquidationFactor": 0.95, | ||
"supplyCap": "0e18" | ||
}, | ||
"WBTC": { | ||
"address": "0x68f180fcCe6836688e9084f035309E29Bf0A2095", | ||
"priceFeed": "0x718A5788b89454aAE3A028AE9c111A29Be6c2a6F", | ||
"decimals": "8", | ||
"borrowCF": 0.8, | ||
"liquidateCF": 0.85, | ||
"liquidationFactor": 0.95, | ||
"supplyCap": "0e8" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { | ||
Deployed, | ||
DeploymentManager, | ||
} from '../../../plugins/deployment_manager'; | ||
import { DeploySpec, deployComet } from '../../../src/deploy'; | ||
|
||
const HOUR = 60 * 60; | ||
const DAY = 24 * HOUR; | ||
|
||
export default async function deploy( | ||
deploymentManager: DeploymentManager, | ||
deploySpec: DeploySpec | ||
): Promise<Deployed> { | ||
const deployed = await deployContracts(deploymentManager, deploySpec); | ||
return deployed; | ||
} | ||
|
||
async function deployContracts( | ||
deploymentManager: DeploymentManager, | ||
deploySpec: DeploySpec | ||
): Promise<Deployed> { | ||
const trace = deploymentManager.tracer(); | ||
|
||
const USDT = await deploymentManager.existing( | ||
'USDT', | ||
'0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', | ||
'optimism' | ||
); | ||
const WETH = await deploymentManager.existing( | ||
'WETH', | ||
'0x4200000000000000000000000000000000000006', | ||
'optimism' | ||
); | ||
const WBTC = await deploymentManager.existing( | ||
'WBTC', | ||
'0x68f180fcCe6836688e9084f035309E29Bf0A2095', | ||
'optimism' | ||
); | ||
const OP = await deploymentManager.existing( | ||
'OP', | ||
'0x4200000000000000000000000000000000000042', | ||
'optimism' | ||
); | ||
|
||
const COMP = await deploymentManager.existing( | ||
'COMP', | ||
'0x7e7d4467112689329f7E06571eD0E8CbAd4910eE', | ||
'optimism' | ||
); | ||
|
||
// Import shared contracts from cUSDCv3 | ||
const cometAdmin = await deploymentManager.fromDep('cometAdmin', 'optimism', 'usdc'); | ||
const cometFactory = await deploymentManager.fromDep('cometFactory', 'optimism', 'usdc'); | ||
const $configuratorImpl = await deploymentManager.fromDep('configurator:implementation', 'optimism', 'usdc'); | ||
const configurator = await deploymentManager.fromDep('configurator', 'optimism', 'usdc'); | ||
const rewards = await deploymentManager.fromDep('rewards', 'optimism', 'usdc'); | ||
const bulker = await deploymentManager.fromDep('bulker', 'optimism', 'usdc'); | ||
const localTimelock = await deploymentManager.fromDep('timelock', 'optimism', 'usdc'); | ||
const bridgeReceiver = await deploymentManager.fromDep('bridgeReceiver', 'optimism', 'usdc'); | ||
|
||
// Deploy Comet | ||
const deployed = await deployComet(deploymentManager, deploySpec); | ||
|
||
return { | ||
...deployed, | ||
bridgeReceiver, | ||
bulker, | ||
rewards, | ||
COMP | ||
}; | ||
} |
Oops, something went wrong.