Skip to content

Commit

Permalink
Init AERO on Base market (#937)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikhailo Shabodyash <[email protected]>
Co-authored-by: GitHub Actions Bot <>
  • Loading branch information
dmitriy-woof-software and MishaShWoof authored Oct 18, 2024
1 parent b19a198 commit 01ce0c4
Show file tree
Hide file tree
Showing 10 changed files with 580 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
bases: [ development, mainnet, mainnet-weth, mainnet-usdt, mainnet-wsteth, goerli, goerli-weth, sepolia-usdc, sepolia-weth, fuji, mumbai, polygon, polygon-usdt, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-usdt, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, optimism-usdt, optimism-weth, scroll-goerli, scroll-usdc]
bases: [ development, mainnet, mainnet-weth, mainnet-usdt, mainnet-wsteth, goerli, goerli-weth, sepolia-usdc, sepolia-weth, fuji, mumbai, polygon, polygon-usdt, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-usdt, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-aero, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, optimism-usdt, optimism-weth, scroll-goerli, scroll-usdc]
name: Run scenarios
env:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
Expand Down
60 changes: 60 additions & 0 deletions deployments/base/aero/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "Compound AERO",
"symbol": "cAEROv3",
"baseToken": "AERO",
"baseTokenAddress": "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
"borrowMin": "1e18",
"pauseGuardian": "0x3cb4653f3b45f448d9100b118b75a1503281d2ee",
"storeFrontPriceFactor": 0.6,
"targetReserves": "50000000e18",
"rates": {
"supplyKink": 0.85,
"supplySlopeLow": 0.08,
"supplySlopeHigh": 11,
"supplyBase": 0,
"borrowKink": 0.85,
"borrowSlopeLow": 0.0706,
"borrowSlopeHigh": 15,
"borrowBase": 0.04
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "173611111111e0",
"baseBorrowSpeed": "173611111111e0",
"baseMinForRewards": "1000e18"
},
"assets": {
"WETH": {
"address": "0x4200000000000000000000000000000000000006",
"decimals": "18",
"borrowCF": 0.6,
"liquidateCF": 0.65,
"liquidationFactor": 0.75,
"supplyCap": "7500e18"
},
"USDC": {
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"decimals": "6",
"borrowCF": 0.65,
"liquidateCF": 0.7,
"liquidationFactor": 0.8,
"supplyCap": "30000000e6"
},
"wstETH": {
"address": "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452",
"decimals": "18",
"borrowCF": 0.6,
"liquidateCF": 0.65,
"liquidationFactor": 0.75,
"supplyCap": "5000e18"
},
"cbBTC": {
"address": "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"decimals": "8",
"borrowCF": 0.6,
"liquidateCF": 0.65,
"liquidationFactor": 0.75,
"supplyCap": "150e8"
}
}
}
119 changes: 119 additions & 0 deletions deployments/base/aero/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager';
import { DeploySpec, deployComet, exp } from '../../../src/deploy';

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 aero = await deploymentManager.existing(
'AERO',
'0x940181a94A35A4569E4529A3CDfB74e38FD98631',
'base'
);
const weth = await deploymentManager.existing(
'WETH',
'0x4200000000000000000000000000000000000006',
'base'
);
const usdc = await deploymentManager.existing(
'USDC',
'0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
'base'
);
const wstETH = await deploymentManager.existing(
'wstETH',
'0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452',
'base'
);
const cbETH = await deploymentManager.existing(
'cbETH',
'0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf',
'base'
);
// AERO
// AERO -> USD
const aeroUsdPriceFeed = await deploymentManager.deploy(
'AERO:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x4EC5970fC728C5f65ba413992CD5fF6FD70fcfF0',
8
]
);
// USDC
// USDC -> USD
const usdcToUsdPriceFeed = await deploymentManager.deploy(
'USDC:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x7e860098F58bBFC8648a4311b374B1D669a2bc6B', // USDC -> USD
8,
],
true
);
// WETH
// WETH -> USD
const ethToUsdPriceFeed = await deploymentManager.deploy(
'WETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70', // ETH -> USD
8, // decimals
],
true
);
// wstETH
// wstETH -> USD
const wstETHToUsdPriceFeed = await deploymentManager.deploy(
'wstETH:priceFeed',
'pricefeeds/MultiplicativePriceFeed.sol',
[
'0xB88BAc61a4Ca37C43a3725912B1f472c9A5bc061',
'0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70',
8, // decimals
'wstETH / stETH ETH / USD'
],
true
);
// cbBTC
// cbBTC -> USD
const cbBTCToUsdPriceFeed = await deploymentManager.deploy(
'cbBTC:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0x07DA0E54543a844a80ABE69c8A12F22B3aA59f9D', // cbBTC -> USD
8, // decimals
],
true
);

// Import shared contracts from cUSDbCv3
const cometAdmin = await deploymentManager.fromDep('cometAdmin', 'base', 'usdbc');
// new comet factory
const $configuratorImpl = await deploymentManager.fromDep('configurator:implementation', 'base', 'usdbc');
const configurator = await deploymentManager.fromDep('configurator', 'base', 'usdbc');
const rewards = await deploymentManager.fromDep('rewards', 'base', 'usdbc');
const bulker = await deploymentManager.fromDep('bulker', 'base', 'usdbc');
const l2CrossDomainMessenger = await deploymentManager.fromDep('l2CrossDomainMessenger', 'base', 'usdbc');
const l2StandardBridge = await deploymentManager.fromDep('l2StandardBridge', 'base', 'usdbc');
const localTimelock = await deploymentManager.fromDep('timelock', 'base', 'usdbc');
const bridgeReceiver = await deploymentManager.fromDep('bridgeReceiver', 'base', 'usdbc');

// Deploy Comet
const deployed = await deployComet(deploymentManager, deploySpec);

// XXX We will need to deploy a new bulker only if need to support wstETH

return {
...deployed,
bridgeReceiver,
l2CrossDomainMessenger, // TODO: don't have to part of roots. can be pulled via relations
l2StandardBridge,
bulker
};
}
Loading

0 comments on commit 01ce0c4

Please sign in to comment.