From de0f0a5c63040b8238ef3cf2fd9d2818f0e04643 Mon Sep 17 00:00:00 2001 From: traceurl <25892474+traceurl@users.noreply.github.com> Date: Fri, 26 Jan 2024 22:21:42 +0800 Subject: [PATCH 1/2] deploy new D3RateManager --- config/arbitrum-config.ts | 2 +- config/avax-config.ts | 2 +- config/bsc-config.ts | 2 +- config/eth-config.ts | 2 +- config/op-config.ts | 2 +- config/polygon-config.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/arbitrum-config.ts b/config/arbitrum-config.ts index e221b23..0e05554 100644 --- a/config/arbitrum-config.ts +++ b/config/arbitrum-config.ts @@ -14,7 +14,7 @@ const ARBITRUM_CONFIG = { daiAddress: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", dodoAddress: "0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581", D3Oracle: "0xea924da08563A07D646fd03067474D9143B0b4a9", - D3RateManager: "0x7979EaDe558dE8E41CedEffd32E5589fdF228850", + D3RateManager: "0x3E2D410DA287f6f5eAFc59638c40CC944881c532", D3MMLiquidationRouter: "0xdc4d484A75A47170a54616b472946b8D013a2935", D3Vault: "0xBAf350b14ed48429A7772F7D05B2CFc6620744D9", D3UserQuota: "0x3b43d078Dc0B1c57C862990Ec8d7e22A184EabBE", diff --git a/config/avax-config.ts b/config/avax-config.ts index 4ca98e0..2f3e8da 100644 --- a/config/avax-config.ts +++ b/config/avax-config.ts @@ -12,7 +12,7 @@ const AVAX_CONFIG = { }, deployedAddress: { D3Oracle: "0xB5c7BA1EAde74800cD6cf5F56b1c4562De373780", - D3RateManager: "0x4aAe1d041C01078725dB016BA4D4F72455CaF931", + D3RateManager: "0x62bd398b79Af8531FDfCF0a19e6027aB9048dA8C", D3MMLiquidationRouter: "0x3dD629473A2eD7f3C6299FFD9F3e0C283d073f11", D3Vault: "0xEAC4BFef7D1c872Ed705B01856af7f9802adC596", D3UserQuota: "0xb546Add98c71D97Bb65De60B91021617AcD1262C", diff --git a/config/bsc-config.ts b/config/bsc-config.ts index 3fb468d..e336618 100644 --- a/config/bsc-config.ts +++ b/config/bsc-config.ts @@ -10,7 +10,7 @@ const BSC_CONFIG = { }, deployedAddress: { D3Oracle: "0x829Ea84E6bfc67821971C0E1B55981efcE6A7550", - D3RateManager: "0xE43A0452C9f701A465Ece610e1f300D73088F29A", + D3RateManager: "0x6486c9fBBA47b94015f8A21EFB23Ca6c758980f8", D3MMLiquidationRouter: "0x30352E6d2BD3D29D2151E4750CC96B1bEE4c2114", D3Vault: "0x3f4eF3763E0b6edB2b3237e29BD7e23Bd168bD46", D3UserQuota: "0x67119E13FE9D9c5aCE5ab882bE5D5a35402209DC", diff --git a/config/eth-config.ts b/config/eth-config.ts index 5c8108a..1694e00 100644 --- a/config/eth-config.ts +++ b/config/eth-config.ts @@ -11,7 +11,7 @@ const ETH_CONFIG = { deployedAddress: { DODOApprove: "0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149", D3Oracle: "0x2F66C5aAF006Bd9c51615D617589C16c0ed35fD3", - D3RateManager: "0xCDA4a6cc5997002B87f28D46852F9F0aA0f3c897", + D3RateManager: "0x65ff7C643fa2F84639AdA46557c64f6DEf8b35e3", D3MMLiquidationRouter: "0x200D866Edf41070DE251Ef92715a6Ea825A5Eb80", D3Vault: "0x49186E32fEd50fd6B5604A2618c7B0b03Cd41414", D3UserQuota: "0x5fa9e06111814840398ceF6E9563d400F6ed3a8d", diff --git a/config/op-config.ts b/config/op-config.ts index 1454830..3b17098 100644 --- a/config/op-config.ts +++ b/config/op-config.ts @@ -8,7 +8,7 @@ const OP_CONFIG = { }, deployedAddress: { D3Oracle: "0xf5Ec1a19e1570bDf0A3AaA6585274f27027270b1", - D3RateManager: "0x44023441f2Bad375b6b5C6354B03c3E9AD01E269", + D3RateManager: "0x1506b54A1c0eA1B2F4a84866Ec5776F7F6e7f0B1", D3FeeRateModel: "0x65934e2f228Fde069A6255F46E6A15Bc9DE38545", D3MMLiquidationRouter: "0xa1609A1fa7DC16c025feA194c02b2822441b8c10", D3PoolQuota: "0x5fe43C0EbfE66b83C10A9A37AD1E4aC640AAAA65", diff --git a/config/polygon-config.ts b/config/polygon-config.ts index 4fdba33..ad3d2f5 100644 --- a/config/polygon-config.ts +++ b/config/polygon-config.ts @@ -13,7 +13,7 @@ const POLYGON_CONFIG = { daiAddress: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063", dodoAddress: "0xe4Bf2864ebeC7B7fDf6Eeca9BaCAe7cDfDAffe78", D3Oracle: "0xCe670438dADb080d7aae65FDAfF51355aA30535e", - D3RateManager: "0x7dEdA1C0996e9A2Dd80C8Ff9b6C5406BBa1BDb9d", + D3RateManager: "0x3ae87c7963A7199B52dD6C19193e0094E6DbAcBc", D3MMLiquidationRouter: "0x45b3Be51c0C6d8C621C883F36A63340D365565f5", D3Vault: "0x224fEce8104771478a3A4CE6D92ab1538d3659ee", D3UserQuota: "0x34a3d05a582eaDF0B8D81AcD4e20e861755Aa668", From c5aac740af9ac39d1a9da18a15045f27439479d1 Mon Sep 17 00:00:00 2001 From: traceurl <25892474+traceurl@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:41:50 +0800 Subject: [PATCH 2/2] update rate --- deploy/arbitrum/000_deploy_contracts.ts | 22 ++++++++++------------ deploy/avax/000_deploy_contracts.ts | 14 +++++++------- deploy/bsc/000_deploy_contracts.ts | 8 ++++---- deploy/eth/000_deploy_contracts.ts | 4 ++-- deploy/op/000_deploy_contracts.ts | 6 +++--- deploy/polygon/000_deploy_contracts.ts | 16 +++++----------- 6 files changed, 31 insertions(+), 39 deletions(-) diff --git a/deploy/arbitrum/000_deploy_contracts.ts b/deploy/arbitrum/000_deploy_contracts.ts index fb65546..fa934a4 100644 --- a/deploy/arbitrum/000_deploy_contracts.ts +++ b/deploy/arbitrum/000_deploy_contracts.ts @@ -152,34 +152,32 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if (shouldSet) { const D3RateManager = await ethers.getContractAt("D3RateManager", rateManagerAddress); - sleep(10) - console.log("setStableCurve for WBTC...") - await D3RateManager.setStableCurve(config.deployedAddress.wbtcAddress, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.deployedAddress.wbtcAddress, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); - sleep(10) + await sleep(10) console.log("setStableCurve for WETH...") - await D3RateManager.setStableCurve(config.deployedAddress.wethAddress, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.deployedAddress.wethAddress, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); - sleep(10) + await sleep(10) console.log("setStableCurve for DAI...") - await D3RateManager.setStableCurve(config.deployedAddress.daiAddress, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.deployedAddress.daiAddress, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDT...") - await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDC...") - await D3RateManager.setStableCurve(config.defaultAddress.USDC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDCe...") - await D3RateManager.setStableCurve(config.defaultAddress.USDCe, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDCe, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); - sleep(10) + await sleep(10) console.log("setStableCurve for DODO...") - await D3RateManager.setStableCurve(config.deployedAddress.dodoAddress, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.deployedAddress.dodoAddress, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); } } diff --git a/deploy/avax/000_deploy_contracts.ts b/deploy/avax/000_deploy_contracts.ts index 740c73a..8270625 100644 --- a/deploy/avax/000_deploy_contracts.ts +++ b/deploy/avax/000_deploy_contracts.ts @@ -143,25 +143,25 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const D3RateManager = await ethers.getContractAt("D3RateManager", rateManagerAddress); console.log("setStableCurve for WBTC...") - await D3RateManager.setStableCurve(config.defaultAddress.WBTC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WBTC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for BTC...") - await D3RateManager.setStableCurve(config.defaultAddress.BTCb, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.BTCb, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for ETH...") - await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDT...") - await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDTe...") - await D3RateManager.setStableCurve(config.defaultAddress.USDTe, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDTe, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDC...") - await D3RateManager.setStableCurve(config.defaultAddress.USDC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for WAVAX...") - await D3RateManager.setStableCurve(config.defaultAddress.WAVAX, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WAVAX, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); } } diff --git a/deploy/bsc/000_deploy_contracts.ts b/deploy/bsc/000_deploy_contracts.ts index f88daea..9d88034 100644 --- a/deploy/bsc/000_deploy_contracts.ts +++ b/deploy/bsc/000_deploy_contracts.ts @@ -117,16 +117,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const D3RateManager = await ethers.getContractAt("D3RateManager", rateManagerAddress); console.log("setStableCurve for BTC...") - await D3RateManager.setStableCurve(config.defaultAddress.BTCB, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.BTCB, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for ETH...") - await D3RateManager.setStableCurve(config.defaultAddress.ETH, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.ETH, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for BNB...") - await D3RateManager.setStableCurve(config.defaultAddress.WBNB, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WBNB, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDT...") - await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); } } diff --git a/deploy/eth/000_deploy_contracts.ts b/deploy/eth/000_deploy_contracts.ts index 6cfaea1..25da19d 100644 --- a/deploy/eth/000_deploy_contracts.ts +++ b/deploy/eth/000_deploy_contracts.ts @@ -102,12 +102,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { sleep(10) console.log("setStableCurve for WETH...") - await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); sleep(10) console.log("setStableCurve for WstETH...") - await D3RateManager.setStableCurve(config.defaultAddress.wstETH, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.wstETH, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); } } diff --git a/deploy/op/000_deploy_contracts.ts b/deploy/op/000_deploy_contracts.ts index c655e6a..4872a70 100644 --- a/deploy/op/000_deploy_contracts.ts +++ b/deploy/op/000_deploy_contracts.ts @@ -106,13 +106,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const D3RateManager = await ethers.getContractAt("D3RateManager", rateManagerAddress); console.log("setStableCurve for WBTC...") - await D3RateManager.setStableCurve(config.defaultAddress.WBTC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WBTC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for ETH...") - await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDT...") - await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); } } diff --git a/deploy/polygon/000_deploy_contracts.ts b/deploy/polygon/000_deploy_contracts.ts index 48d5b16..b7d3021 100644 --- a/deploy/polygon/000_deploy_contracts.ts +++ b/deploy/polygon/000_deploy_contracts.ts @@ -130,26 +130,20 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if (shouldSet) { const D3RateManager = await ethers.getContractAt("D3RateManager", rateManagerAddress); - sleep(10) - console.log("setStableCurve for WETH...") - await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); - - sleep(10) + await D3RateManager.setStableCurve(config.defaultAddress.WETH, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDT...") - await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); - - sleep(10) + await D3RateManager.setStableCurve(config.defaultAddress.USDT, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for USDC...") - await D3RateManager.setStableCurve(config.defaultAddress.USDC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.USDC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for WBTC...") - await D3RateManager.setStableCurve(config.defaultAddress.WBTC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WBTC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); console.log("setStableCurve for WMATIC...") - await D3RateManager.setStableCurve(config.defaultAddress.WMATIC, padZeros(20, 16), padZeros(1, 18), padZeros(2, 18), padZeros(80, 16)); + await D3RateManager.setStableCurve(config.defaultAddress.WMATIC, padZeros(2, 16), padZeros(10, 16), padZeros(50, 16), padZeros(80, 16)); } }