Skip to content
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
2 changes: 1 addition & 1 deletion scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async function main() {

// Phase 2 - Assets/Collateral
if (!baseL2Chains.includes(hre.network.name) && !arbitrumL2Chains.includes(hre.network.name)) {
// Ethereum
scripts.push(
'phase2-assets/0_setup_deployments.ts',
'phase2-assets/1_deploy_assets.ts',
Expand Down Expand Up @@ -109,7 +110,6 @@ async function main() {
'phase2-assets/collaterals/deploy_aerodrome_usdc_eusd.ts',
'phase2-assets/collaterals/deploy_aerodrome_weth_aero.ts',
'phase2-assets/collaterals/deploy_aerodrome_mog_weth.ts',
'phase2-assets/collaterals/deploy_aerodrome_usdz_usdc.ts',
'phase2-assets/collaterals/deploy_aerodrome_weth_cbbtc.ts',
'phase2-assets/collaterals/deploy_aerodrome_weth_well.ts',
'phase2-assets/collaterals/deploy_aerodrome_weth_degen.ts',
Expand Down
2 changes: 1 addition & 1 deletion scripts/deployment/phase2-assets/assets/deploy_stg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function main() {
const { asset: stgAsset } = await hre.run('deploy-asset', {
priceTimeout: priceTimeout.toString(),
priceFeed: networkConfig[chainId].chainlinkFeeds.STG,
oracleError: fp('0.02').toString(), // 2%
oracleError: fp('0.05').toString(), // 5%
tokenAddress: networkConfig[chainId].tokens.STG,
maxTradeVolume: fp('1e6').toString(), // $1m,
oracleTimeout: '86400', // 24 hr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function main() {
oracleError: ORACLE_ERROR.toString(),
erc20: networkConfig[chainId].tokens.sUSDe,
maxTradeVolume: fp('1e6').toString(), // $1m,
oracleTimeout: ORACLE_TIMEOUT.toString(), // 24 hr
oracleTimeout: ORACLE_TIMEOUT.toString(), // 23 hr
targetName: hre.ethers.utils.formatBytes32String('USD'),
defaultThreshold: fp('0.01').add(ORACLE_ERROR).toString(), // ~1.5%
delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(), // 72h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function main() {

const CTokenV3Factory: ContractFactory = await hre.ethers.getContractFactory('CTokenV3Collateral')

const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = getUsdcOracleError(hre.network.name)

const collateral = <CTokenV3Collateral>await CTokenV3Factory.connect(deployer).deploy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {
oracleError: fp('0.0025').toString(), // 0.25%
cToken: fUsdc.address,
maxTradeVolume: fp('1e6').toString(), // $1m,
oracleTimeout: '86400', // 24 hr
oracleTimeout: '82800', // 23 hr
targetName: hre.ethers.utils.formatBytes32String('USD'),
defaultThreshold: fp('0.0125').toString(), // 1.25%
delayUntilDefault: bn('86400').toString(), // 24h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ async function main() {
const collateral = await FiatCollateralFactory.connect(deployer).deploy(
{
...baseStableConfig,
oracleTimeout: '82800', // 23 hr
chainlinkFeed: networkConfig[chainId].chainlinkFeeds.USDC!,
erc20: maUSDC,
},
Expand Down Expand Up @@ -178,7 +179,7 @@ async function main() {
}

{
const wbtcOracleError = fp('0.02') // 2%
const wbtcOracleError = fp('0.005') // 0.5%
const btcOracleError = fp('0.005') // 0.5%
const combinedBTCWBTCError = combinedError(wbtcOracleError, btcOracleError)
const collateral = await NonFiatCollateralFactory.connect(deployer).deploy(
Expand All @@ -188,7 +189,7 @@ async function main() {
maxTradeVolume: fp('1e6'), // $1m,
oracleTimeout: '86400', // 24 hr
targetName: ethers.utils.formatBytes32String('BTC'),
defaultThreshold: fp('0.01').add(wbtcOracleError), // 3%
defaultThreshold: fp('0.01').add(wbtcOracleError), // 1.5%
delayUntilDefault: bn('86400'), // 24h
chainlinkFeed: networkConfig[chainId].chainlinkFeeds.WBTC!, // {target/ref}
erc20: maWBTC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function main() {
oracleError: oracleError.toString(),
erc20: erc20.address,
maxTradeVolume: fp('1e6').toString(), // $1m,
oracleTimeout: '86400', // 24h hr,
oracleTimeout: '82800', // 23 hr,
targetName: hre.ethers.utils.formatBytes32String('USD'),
defaultThreshold: fp('0.01').add(oracleError).toString(),
delayUntilDefault: bn('86400').toString(), // 24h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function main() {
[networkConfig[chainId].chainlinkFeeds.USDC],
[networkConfig[chainId].chainlinkFeeds.crvUSD],
],
oracleTimeouts: [['86400'], ['86400']],
oracleTimeouts: [['82800'], ['86400']],
oracleErrors: [[fp('0.0025').toString()], [fp('0.005').toString()]],
lpToken: YVUSDC_LP_TOKEN,
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/verification/collateral-plugins/verify_cusdcv3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function main() {

/******** Verify Collateral - wcUSDCv3 **************************/

const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = getUsdcOracleError(hre.network.name)

await verifyContract(
Expand Down
6 changes: 3 additions & 3 deletions scripts/verification/collateral-plugins/verify_morpho.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function main() {
'MorphoNonFiatCollateral',
deployments.collateral.maWBTC as string
)
const wbtcOracleError = fp('0.02') // 2%
const wbtcOracleError = fp('0.005') // 0.5%
const combinedBTCWBTCError = combinedError(wbtcOracleError, fp('0.005'))

await verifyContract(
Expand All @@ -85,11 +85,11 @@ async function main() {
[
{
priceTimeout: priceTimeout.toString(),
oracleError: combinedBTCWBTCError.toString(), // 2% + 0.5%
oracleError: combinedBTCWBTCError.toString(), // 0.5% + 0.5%
maxTradeVolume: fp('1e6'), // $1m,
oracleTimeout: '86400', // 24 hr
targetName: ethers.utils.formatBytes32String('BTC'),
defaultThreshold: fp('0.01').add(wbtcOracleError), // 3%
defaultThreshold: fp('0.01').add(wbtcOracleError), // 1.5%
delayUntilDefault: bn('86400'), // 24h
chainlinkFeed: networkConfig[chainId].chainlinkFeeds.WBTC!,
erc20: await maWBTC.erc20(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function main() {
[networkConfig[chainId].chainlinkFeeds.USDC],
[networkConfig[chainId].chainlinkFeeds.crvUSD],
],
oracleTimeouts: [['86400'], ['86400']],
oracleTimeouts: [['82800'], ['86400']],
oracleErrors: [[fp('0.0025').toString()], [fp('0.005').toString()]],
lpToken: YVUSDC_LP_TOKEN,
},
Expand Down
10 changes: 5 additions & 5 deletions test/monitor/FacadeMonitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ describeFork(`FacadeMonitor - Integration - Mainnet Forking P${IMPLEMENTATION}`,
).wait()

/******** Deploy Aave V3 USDC collateral plugin **************************/
const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = baseL2Chains.includes(hre.network.name) ? fp('0.003') : fp('0.0025') // 0.3% (Base) or 0.25%

const MockV3AggregatorFactory = await ethers.getContractFactory('MockV3Aggregator')
Expand Down Expand Up @@ -842,7 +842,7 @@ describeFork(`FacadeMonitor - Integration - Mainnet Forking P${IMPLEMENTATION}`,
/******** Deploy Compound V3 USDC collateral plugin **************************/
const CollateralFactory = await ethers.getContractFactory('CTokenV3Collateral')

const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = baseL2Chains.includes(hre.network.name) ? fp('0.003') : fp('0.0025') // 0.3% (Base) or 0.25%

const MockV3AggregatorFactory = await ethers.getContractFactory('MockV3Aggregator')
Expand Down Expand Up @@ -1036,7 +1036,7 @@ describeFork(`FacadeMonitor - Integration - Mainnet Forking P${IMPLEMENTATION}`,
await wstgUsdc.deployed()

/******** Deploy Stargate USDC collateral plugin **************************/
const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = baseL2Chains.includes(hre.network.name) ? fp('0.003') : fp('0.0025') // 0.3% (Base) or 0.25%

const MockV3AggregatorFactory = await ethers.getContractFactory('MockV3Aggregator')
Expand Down Expand Up @@ -1115,7 +1115,7 @@ describeFork(`FacadeMonitor - Integration - Mainnet Forking P${IMPLEMENTATION}`,
/******** Deploy Flux USDC collateral plugin **************************/
const CollateralFactory = await ethers.getContractFactory('CTokenFiatCollateral')

const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = baseL2Chains.includes(hre.network.name) ? fp('0.003') : fp('0.0025') // 0.3% (Base) or 0.25%

const MockV3AggregatorFactory = await ethers.getContractFactory('MockV3Aggregator')
Expand Down Expand Up @@ -1207,7 +1207,7 @@ describeFork(`FacadeMonitor - Integration - Mainnet Forking P${IMPLEMENTATION}`,

const CollateralFactory = await hre.ethers.getContractFactory('MorphoFiatCollateral')

const usdcOracleTimeout = '86400' // 24 hr
const usdcOracleTimeout = '82800' // 23 hr
const usdcOracleError = baseL2Chains.includes(hre.network.name) ? fp('0.003') : fp('0.0025') // 0.3% (Base) or 0.25%
const baseStableConfig = {
priceTimeout: bn('604800').toString(),
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/individual-collateral/aave-v3/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const PYUSD_ORACLE_TIMEOUT = bn('86400')
export const PYUSD_ORACLE_ERROR = fp('0.003')

export const USDC_MAINNET_MAX_TRADE_VOLUME = fp('1e6')
export const USDC_MAINNET_ORACLE_TIMEOUT = bn('86400')
export const USDC_MAINNET_ORACLE_TIMEOUT = bn('82800')
export const USDC_MAINNET_ORACLE_ERROR = fp('0.0025')

export const USDC_BASE_MAX_TRADE_VOLUME = fp('0.5e6')
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/individual-collateral/curve/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const DAI_ORACLE_ERROR = fp('0.0025')

// USDC
export const USDC_USD_FEED = networkConfig['1'].chainlinkFeeds.USDC!
export const USDC_ORACLE_TIMEOUT = bn('86400')
export const USDC_ORACLE_TIMEOUT = bn('82800') // 23h
export const USDC_ORACLE_ERROR = fp('0.0025')

// USDT
Expand Down Expand Up @@ -54,7 +54,7 @@ export const BTC_USD_ORACLE_ERROR = fp('0.005')

// WETH
export const WETH_USD_FEED = networkConfig['1'].chainlinkFeeds.ETH!
export const WETH_ORACLE_TIMEOUT = bn('86400')
export const WETH_ORACLE_TIMEOUT = bn('3600')
export const WETH_ORACLE_ERROR = fp('0.005')

// MIM
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/individual-collateral/ethena/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const USDe_HOLDER = '0x42862F48eAdE25661558AFE0A630b132038553D0'
export const sUSDe_HOLDER = '0x4139cDC6345aFFbaC0692b43bed4D059Df3e6d65'

export const PRICE_TIMEOUT = bn('604800') // 1 week
export const ORACLE_TIMEOUT = bn(86400) // 24h
export const ORACLE_TIMEOUT = bn(82800) // 23 hrs
export const ORACLE_ERROR = fp('0.005') // 0.5%
export const DEFAULT_THRESHOLD = fp('0.05') // 5%
export const DELAY_UNTIL_DEFAULT = bn(259200) // 72h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const MEUSD = networkConfig[chainId].tokens.meUSD!

// USDC
export const USDC_USD_FEED = networkConfig[chainId].chainlinkFeeds.USDC!
export const USDC_ORACLE_TIMEOUT = bn('86400')
export const USDC_ORACLE_TIMEOUT = bn('82800') // 23 hrs
export const USDC_ORACLE_ERROR = fp('0.0025')

// PYUSD
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/individual-collateral/sky/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const SUSDS = networkConfig['31337'].tokens.sUSDS as string
export const SUSDS_HOLDER = '0x2d4d2A025b10C09BDbd794B4FCe4F7ea8C7d7bB4'

export const PRICE_TIMEOUT = bn('604800') // 1 week
export const ORACLE_TIMEOUT = bn(86400) // 24 hours in seconds
export const ORACLE_TIMEOUT = bn(82800) // 23 hrs
export const ORACLE_ERROR = fp('0.003') // 0.3%
export const DEFAULT_THRESHOLD = fp('0.05')
export const DELAY_UNTIL_DEFAULT = bn(86400)
Expand Down
Loading