Skip to content

Commit

Permalink
Merge pull request #38 from Gearbox-protocol/deploy-config
Browse files Browse the repository at this point in the history
Deploy config
  • Loading branch information
0xmikko authored Aug 19, 2023
2 parents 398f17b + 0b17c12 commit 8dab444
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 20 deletions.
113 changes: 93 additions & 20 deletions config/usdcMTconfig.ts
Original file line number Diff line number Diff line change
@@ -1,61 +1,134 @@
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);
const POOL_DIVIDER = BigInt(1);

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) * USDC_DECIMALS,
accountAmount: BigInt(1_000_000) * POOL_DECIMALS,
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) * POOL_DECIMALS / POOL_DIVIDER,
},
UNI: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(5000000000000),
limit: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER,
},
LINK: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER,
},
FXS: {
minRate: 10,
maxRate: 300,
LDO: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(5e5) * POOL_DECIMALS / POOL_DIVIDER,
},
RPL: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(5000000000000),
limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER,
},
LQTY: {
CRV: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(25e4) * POOL_DECIMALS / POOL_DIVIDER,
},
APE: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER,
},
CVX: {
minRate: 10,
maxRate: 300,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(5000000000000),
limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER,
},
FXS: {
minRate: 0,
maxRate: 3000,
quotaIncreaseFee: 0,
limit: BigInt(3e5) * POOL_DECIMALS / POOL_DIVIDER,
},
},
creditManagers: [
{
degenNft: false,
expirationDate: undefined,
minDebt: BigInt(1e5) * BigInt(1e6),
maxDebt: BigInt(1e6) * BigInt(1e6),
minDebt: BigInt(1e4) * POOL_DECIMALS / POOL_DIVIDER,
maxDebt: BigInt(1e6) * POOL_DECIMALS / POOL_DIVIDER,
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"],
Expand Down
59 changes: 59 additions & 0 deletions config/wbtcTconfig.ts
Original file line number Diff line number Diff line change
@@ -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());
65 changes: 65 additions & 0 deletions config/wethMTconfig.ts
Original file line number Diff line number Diff line change
@@ -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());

0 comments on commit 8dab444

Please sign in to comment.