From 9f7d55852e26ce6818a6b8ab3b2f7529d8600316 Mon Sep 17 00:00:00 2001 From: apeir99n Date: Wed, 16 Aug 2023 21:21:30 +0400 Subject: [PATCH 1/4] usdc config --- config/usdcMTconfig.ts | 106 ++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 17 deletions(-) diff --git a/config/usdcMTconfig.ts b/config/usdcMTconfig.ts index 273d4585..97e8dd41 100644 --- a/config/usdcMTconfig.ts +++ b/config/usdcMTconfig.ts @@ -13,49 +13,121 @@ export const config: PoolV3DeployConfig = { withdrawalFee: 0, expectedLiquidityLimit: BigInt(0), irm: { - U1: 8000, + U1: 7000, U2: 9000, Rbase: 0, - Rslope1: 100, - Rslope2: 1000, + Rslope1: 150, + Rslope2: 400, Rslope3: 10000, isBorrowingMoreU2Forbidden: true, }, ratesAndLimits: { - CVX: { - minRate: 10, - maxRate: 300, + MKR: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(1e6) * BigInt(1e6), + }, + UNI: { + minRate: 0, + maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(5000000000000), + limit: BigInt(1e6) * BigInt(1e6), + }, + LINK: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(1e6) * BigInt(1e6), }, - FXS: { - minRate: 10, - maxRate: 300, + LDO: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(5e5) * BigInt(1e6), + }, + RPL: { + minRate: 0, + maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(5000000000000), + limit: BigInt(3e5) * BigInt(1e6), }, - LQTY: { + CRV: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(25e4) * BigInt(1e6), + }, + APE: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(3e5) * BigInt(1e6), + }, + CVX: { minRate: 10, - maxRate: 300, + maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(5000000000000), + limit: BigInt(3e5) * BigInt(1e6), + }, + FXS: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(3e5) * BigInt(1e6), }, }, creditManagers: [ { degenNft: false, expirationDate: undefined, - minDebt: BigInt(1e5) * BigInt(1e6), + minDebt: BigInt(1e4) * BigInt(1e6), maxDebt: BigInt(1e6) * BigInt(1e6), poolLimit: BigInt(0), collateralTokens: [ + { + token: "WETH", + lt: 8700, + }, + { + token: "WBTC", + lt: 8700, + }, + { + token: "MKR", + lt: 8500, + }, + { + token: "UNI", + lt: 8500, + }, + { + token: "LINK", + lt: 8500, + }, + { + token: "LDO", + lt: 8500, + }, + { + token: "RPL", + lt: 8500, + }, + { + token: "CRV", + lt: 8500, + }, + { + token: "APE", + lt: 8500, + }, { token: "CVX", - lt: 2500, + lt: 8500, }, { token: "FXS", - lt: 2000, + lt: 8500, }, ], adapters: ["UNISWAP_V3_ROUTER"], From e704db0a61cad08aa75717c19cb243db1fc87766 Mon Sep 17 00:00:00 2001 From: apeir99n Date: Wed, 16 Aug 2023 21:36:23 +0400 Subject: [PATCH 2/4] update pool_decimals --- config/usdcMTconfig.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/usdcMTconfig.ts b/config/usdcMTconfig.ts index 97e8dd41..6524d697 100644 --- a/config/usdcMTconfig.ts +++ b/config/usdcMTconfig.ts @@ -1,7 +1,7 @@ import { PoolV3CoreConfigurator } from "@gearbox-protocol/sdk-gov/lib/state/poolV3Core"; import { PoolV3DeployConfig } from "@gearbox-protocol/sdk-gov/lib/state/poolV3DeployConfig"; -const USDC_DECIMALS = BigInt(1e6); +const POOL_DECIMALS = BigInt(1e6); export const config: PoolV3DeployConfig = { id: "mainnet-usdc-mt-v3", @@ -9,7 +9,7 @@ export const config: PoolV3DeployConfig = { name: "Diesel USDC V3 pool", network: "Mainnet", underlying: "USDC", - accountAmount: BigInt(1_000_000) * USDC_DECIMALS, + accountAmount: BigInt(1_000_000) * POOL_DECIMALS, withdrawalFee: 0, expectedLiquidityLimit: BigInt(0), irm: { @@ -26,63 +26,63 @@ export const config: PoolV3DeployConfig = { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(1e6) * BigInt(1e6), + limit: BigInt(1e6) * POOL_DECIMALS, }, UNI: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(1e6) * BigInt(1e6), + limit: BigInt(1e6) * POOL_DECIMALS, }, LINK: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(1e6) * BigInt(1e6), + limit: BigInt(1e6) * POOL_DECIMALS, }, LDO: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(5e5) * BigInt(1e6), + limit: BigInt(5e5) * POOL_DECIMALS, }, RPL: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * BigInt(1e6), + limit: BigInt(3e5) * POOL_DECIMALS, }, CRV: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(25e4) * BigInt(1e6), + limit: BigInt(25e4) * POOL_DECIMALS, }, APE: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * BigInt(1e6), + limit: BigInt(3e5) * POOL_DECIMALS, }, CVX: { minRate: 10, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * BigInt(1e6), + limit: BigInt(3e5) * POOL_DECIMALS, }, FXS: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * BigInt(1e6), + limit: BigInt(3e5) * POOL_DECIMALS, }, }, creditManagers: [ { degenNft: false, expirationDate: undefined, - minDebt: BigInt(1e4) * BigInt(1e6), - maxDebt: BigInt(1e6) * BigInt(1e6), + minDebt: BigInt(1e4) * POOL_DECIMALS, + maxDebt: BigInt(1e6) * POOL_DECIMALS, poolLimit: BigInt(0), collateralTokens: [ { From fa6c891b99e93e35c354f37d2f4c7acd432268e7 Mon Sep 17 00:00:00 2001 From: apeir99n Date: Wed, 16 Aug 2023 21:52:40 +0400 Subject: [PATCH 3/4] added pool_devider --- config/usdcMTconfig.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/config/usdcMTconfig.ts b/config/usdcMTconfig.ts index 6524d697..968e6e94 100644 --- a/config/usdcMTconfig.ts +++ b/config/usdcMTconfig.ts @@ -2,6 +2,7 @@ import { PoolV3CoreConfigurator } from "@gearbox-protocol/sdk-gov/lib/state/pool import { PoolV3DeployConfig } from "@gearbox-protocol/sdk-gov/lib/state/poolV3DeployConfig"; const POOL_DECIMALS = BigInt(1e6); +const POOL_DIVIDER = BigInt(1); export const config: PoolV3DeployConfig = { id: "mainnet-usdc-mt-v3", @@ -26,63 +27,63 @@ export const config: PoolV3DeployConfig = { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(1e6) * POOL_DECIMALS, + limit: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER, }, UNI: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(1e6) * POOL_DECIMALS, + limit: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER, }, LINK: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(1e6) * POOL_DECIMALS, + limit: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER, }, LDO: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(5e5) * POOL_DECIMALS, + limit: BigInt(5e5) * POOL_DECIMALS / POOL_DIVIDER, }, RPL: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * POOL_DECIMALS, + limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER, }, CRV: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(25e4) * POOL_DECIMALS, + limit: BigInt(25e4) * POOL_DECIMALS / POOL_DIVIDER, }, APE: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * POOL_DECIMALS, + limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER, }, CVX: { minRate: 10, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * POOL_DECIMALS, + limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER, }, FXS: { minRate: 0, maxRate: 3000, quotaIncreaseFee: 0, - limit: BigInt(3e5) * POOL_DECIMALS, + limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER, }, }, creditManagers: [ { degenNft: false, expirationDate: undefined, - minDebt: BigInt(1e4) * POOL_DECIMALS, - maxDebt: BigInt(1e6) * POOL_DECIMALS, + minDebt: BigInt(1e4) * POOL_DECIMALS / POOL_DIVIDER, + maxDebt: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER, poolLimit: BigInt(0), collateralTokens: [ { From 0b17c12b9cf27e1eab9111742c78547ac59f9397 Mon Sep 17 00:00:00 2001 From: apeir99n Date: Thu, 17 Aug 2023 09:11:01 +0400 Subject: [PATCH 4/4] added weth, wbtc configs --- config/wbtcTconfig.ts | 59 ++++++++++++++++++++++++++++++++++++++ config/wethMTconfig.ts | 65 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 config/wbtcTconfig.ts create mode 100644 config/wethMTconfig.ts diff --git a/config/wbtcTconfig.ts b/config/wbtcTconfig.ts new file mode 100644 index 00000000..5beb5853 --- /dev/null +++ b/config/wbtcTconfig.ts @@ -0,0 +1,59 @@ +import { PoolV3CoreConfigurator } from "@gearbox-protocol/sdk-gov/lib/state/poolV3Core"; +import { PoolV3DeployConfig } from "@gearbox-protocol/sdk-gov/lib/state/poolV3DeployConfig"; + +const POOL_DECIMALS = BigInt(1e6); +const POOL_DIVIDER = BigInt(29000); + +export const config: PoolV3DeployConfig = { + id: "mainnet-usdc-mt-v3", + symbol: "dUSDCV3", + name: "Diesel USDC V3 pool", + network: "Mainnet", + underlying: "USDC", + accountAmount: BigInt(1_000_000) * POOL_DECIMALS, + withdrawalFee: 0, + expectedLiquidityLimit: BigInt(0), + irm: { + U1: 7000, + U2: 9000, + Rbase: 0, + Rslope1: 100, + Rslope2: 300, + Rslope3: 10000, + isBorrowingMoreU2Forbidden: true, + }, + ratesAndLimits: { + USDC: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(30e6) * POOL_DECIMALS / POOL_DIVIDER, + }, + }, + creditManagers: [ + { + degenNft: false, + expirationDate: undefined, + minDebt: BigInt(1e4) * POOL_DECIMALS / POOL_DIVIDER, + maxDebt: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER, + poolLimit: BigInt(0), + collateralTokens: [ + { + token: "WETH", + lt: 8700, + }, + { + token: "USDC", + lt: 8700, + }, + ], + adapters: ["UNISWAP_V3_ROUTER"], + }, + ], + supportsQuotas: false, +}; + +const poolCfg = PoolV3CoreConfigurator.new(config); +console.error(poolCfg.toString()); + +console.log(poolCfg.deployConfig()); diff --git a/config/wethMTconfig.ts b/config/wethMTconfig.ts new file mode 100644 index 00000000..78980db2 --- /dev/null +++ b/config/wethMTconfig.ts @@ -0,0 +1,65 @@ +import { PoolV3CoreConfigurator } from "@gearbox-protocol/sdk-gov/lib/state/poolV3Core"; +import { PoolV3DeployConfig } from "@gearbox-protocol/sdk-gov/lib/state/poolV3DeployConfig"; + +const POOL_DECIMALS = BigInt(1e18); +const POOL_DIVIDER = BigInt(1800); + +export const config: PoolV3DeployConfig = { + id: "mainnet-usdc-mt-v3", + symbol: "dUSDCV3", + name: "Diesel USDC V3 pool", + network: "Mainnet", + underlying: "USDC", + accountAmount: BigInt(1_000_000) * POOL_DECIMALS, + withdrawalFee: 0, + expectedLiquidityLimit: BigInt(0), + irm: { + U1: 7000, + U2: 9000, + Rbase: 0, + Rslope1: 100, + Rslope2: 200, + Rslope3: 10000, + isBorrowingMoreU2Forbidden: true, + }, + ratesAndLimits: { + stETH: { + minRate: 0, + maxRate: 200, + quotaIncreaseFee: 0, + limit: BigInt(30e6) * POOL_DECIMALS / POOL_DIVIDER, + }, + USDC: { + minRate: 0, + maxRate: 3000, + quotaIncreaseFee: 0, + limit: BigInt(30e6) * POOL_DECIMALS / POOL_DIVIDER, + }, + }, + creditManagers: [ + { + degenNft: false, + expirationDate: undefined, + minDebt: BigInt(1e4) * POOL_DECIMALS / POOL_DIVIDER, + maxDebt: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER, + poolLimit: BigInt(0), + collateralTokens: [ + { + token: "WBTC", + lt: 8700, + }, + { + token: "USDC", + lt: 8700, + }, + ], + adapters: ["UNISWAP_V3_ROUTER"], + }, + ], + supportsQuotas: false, +}; + +const poolCfg = PoolV3CoreConfigurator.new(config); +console.error(poolCfg.toString()); + +console.log(poolCfg.deployConfig());