From 236dcb7f42debdde3ae8ba3686b199e2f8312b55 Mon Sep 17 00:00:00 2001 From: zhoujia6139 Date: Tue, 14 Nov 2023 10:54:21 +0800 Subject: [PATCH 1/4] chore: add GHOST --- helpers/types.ts | 3 +++ market-config/auctionStrategies.ts | 10 ++++++++++ market-config/index.ts | 4 ++++ market-config/mocks.ts | 2 ++ market-config/reservesConfigs.ts | 18 ++++++++++++++++++ market-config/timeLockStrategies.ts | 12 ++++++++++++ 6 files changed, 49 insertions(+) diff --git a/helpers/types.ts b/helpers/types.ts index 5e6c1842e..66adde721 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -511,6 +511,7 @@ export interface iAssetBase { EXRP: T; uBAYC: T; uPPG: T; + GHOST: T; } export type iAssetsWithoutETH = Omit, "ETH">; @@ -578,6 +579,7 @@ export type iParaSpacePoolAssets = Pick< | "EXRP" | "uBAYC" | "uPPG" + | "GHOST" >; export type iMultiPoolsAssets = iAssetCommon | iParaSpacePoolAssets; @@ -626,6 +628,7 @@ export enum ERC20TokenContractId { WMATIC = "WMATIC", uBAYC = "uBAYC", uPPG = "uPPG", + GHOST = "GHOST", } export enum ERC721TokenContractId { diff --git a/market-config/auctionStrategies.ts b/market-config/auctionStrategies.ts index 79df5d8dd..a0e7b48ab 100644 --- a/market-config/auctionStrategies.ts +++ b/market-config/auctionStrategies.ts @@ -231,6 +231,16 @@ export const auctionStrategyEXRP: IAuctionStrategyParams = { tickLength: "900", }; +export const auctionStrategyGHOST: IAuctionStrategyParams = { + name: "auctionStrategyGHOST", + maxPriceMultiplier: utils.parseUnits("3", 18).toString(), + minExpPriceMultiplier: utils.parseUnits("1.2", 18).toString(), + minPriceMultiplier: utils.parseUnits("0.8", 18).toString(), + stepLinear: utils.parseUnits("0.06875", 18).toString(), + stepExp: utils.parseUnits("0.0285474001559822", 18).toString(), + tickLength: "900", +}; + export const auctionStrategyLinear: IAuctionStrategyParams = { name: "auctionStrategyLinear", maxPriceMultiplier: utils.parseUnits("3", 18).toString(), diff --git a/market-config/index.ts b/market-config/index.ts index 06ee039fa..1d6826676 100644 --- a/market-config/index.ts +++ b/market-config/index.ts @@ -78,6 +78,7 @@ import { strategyEXRP, strategyuBAYC, strategyuPPG, + strategyGHOST, } from "./reservesConfigs"; export const CommonConfig: Pick< @@ -385,6 +386,7 @@ export const GoerliConfig: IParaSpaceConfiguration = { BLOCKS: strategyBLOCKS, uBAYC: strategyuBAYC, uPPG: strategyuPPG, + GHOST: strategyGHOST, }, DelegationRegistry: "0x00000000000076A84feF008CDAbe6409d2FE638B", }; @@ -898,6 +900,7 @@ export const MainnetConfig: IParaSpaceConfiguration = { BLOCKS: "0x059EDD72Cd353dF5106D2B9cC5ab83a52287aC3a", uBAYC: "0x1e610de0d7acfa1d820024948a91d96c5c9ce6b9", uPPG: "0x30F7c830e0C2f4bEC871DF809D73E27eF19EB151", + GHOST: "0x9401518f4ebba857baa879d9f76e1cc8b31ed197", }, YogaLabs: { ApeCoinStaking: "0x5954aB967Bc958940b7EB73ee84797Dc8a2AFbb9", @@ -993,6 +996,7 @@ export const MainnetConfig: IParaSpaceConfiguration = { BLOCKS: strategyBLOCKS, uBAYC: strategyuBAYC, uPPG: strategyuPPG, + GHOST: strategyGHOST, }, Mocks: undefined, Oracle: MainnetOracleConfig, diff --git a/market-config/mocks.ts b/market-config/mocks.ts index 6d4fdc362..bc1bcb3dd 100644 --- a/market-config/mocks.ts +++ b/market-config/mocks.ts @@ -66,6 +66,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = { EXRP: parseEther("0.2").toString(), uBAYC: parseEther("0.000002768").toString(), uPPG: parseEther("0.000000477").toString(), + GHOST: parseEther("0.5").toString(), }; export const MOCK_CHAINLINK_AGGREGATORS_USD_PRICES = { @@ -132,6 +133,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_USD_PRICES = { EXRP: parseUnits("170", 8).toString(), uBAYC: parseUnits("0.005", 8).toString(), uPPG: parseUnits("0.004", 8).toString(), + GHOST: parseUnits("1000", 8).toString(), }; export const MOCK_TOKEN_MINT_VALUE = { diff --git a/market-config/reservesConfigs.ts b/market-config/reservesConfigs.ts index 70c0ea388..3546d45b6 100644 --- a/market-config/reservesConfigs.ts +++ b/market-config/reservesConfigs.ts @@ -23,6 +23,7 @@ import { auctionStrategyZero, auctionStrategyEXRP, auctionStrategyUniswapV3, + auctionStrategyGHOST, } from "./auctionStrategies"; import { rateStrategyAAVE, @@ -114,6 +115,7 @@ import { timeLockStrategyEXRP, timeLockStrategyuPPG, timeLockStrategyuBAYC, + timeLockStrategyGHOST, } from "./timeLockStrategies"; export const strategyDAI: IReserveParams = { @@ -1111,3 +1113,19 @@ export const strategyuPPG: IReserveParams = { borrowCap: "0", supplyCap: "0", }; + +export const strategyGHOST: IReserveParams = { + strategy: rateStrategyNFT, + auctionStrategy: auctionStrategyGHOST, + timeLockStrategy: timeLockStrategyGHOST, + baseLTVAsCollateral: "2000", + liquidationProtocolFeePercentage: "0", + liquidationThreshold: "3500", + liquidationBonus: "10500", + borrowingEnabled: false, + reserveDecimals: "0", + xTokenImpl: eContractid.NTokenImpl, + reserveFactor: "0", + borrowCap: "0", + supplyCap: "1000", +}; diff --git a/market-config/timeLockStrategies.ts b/market-config/timeLockStrategies.ts index 14fa32282..85fe6a8ac 100644 --- a/market-config/timeLockStrategies.ts +++ b/market-config/timeLockStrategies.ts @@ -760,3 +760,15 @@ export const timeLockStrategyEXRP: ITimeLockStrategyParams = { poolPeriodLimit: "100", period: "86400", }; + +export const timeLockStrategyGHOST: ITimeLockStrategyParams = { + name: "timeLockStrategyGHOST", + minThreshold: "20", + midThreshold: "50", + minWaitTime: "12", + midWaitTime: "7200", + maxWaitTime: "21600", + poolPeriodWaitTime: "600", + poolPeriodLimit: "100", + period: "86400", +}; From 019e9a58067da83d8e8ecabe6501738f8395e718 Mon Sep 17 00:00:00 2001 From: zhoujia6139 Date: Tue, 14 Nov 2023 15:45:19 +0800 Subject: [PATCH 2/4] chore: add contract verify id --- helpers/hardhat-constants.ts | 4 ++-- helpers/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/hardhat-constants.ts b/helpers/hardhat-constants.ts index ef66a0b05..2f288210b 100644 --- a/helpers/hardhat-constants.ts +++ b/helpers/hardhat-constants.ts @@ -491,6 +491,7 @@ export const eContractidToContractName = { MockBendDaoLendPool: "MockLendPool", PositionMoverLogic: "PositionMoverLogic", PoolPositionMoverImpl: "PoolPositionMover", + GHOST: "MintableERC721", }; export const XTOKEN_TYPE_UPGRADE_WHITELIST = @@ -498,5 +499,4 @@ export const XTOKEN_TYPE_UPGRADE_WHITELIST = .split(/\s?,\s?/) .map((x) => +x); export const XTOKEN_SYMBOL_UPGRADE_WHITELIST = - process.env.XTOKEN_SYMBOL_UPGRADE_WHITELIST?.trim() - .split(/\s?,\s?/); + process.env.XTOKEN_SYMBOL_UPGRADE_WHITELIST?.trim().split(/\s?,\s?/); diff --git a/helpers/types.ts b/helpers/types.ts index 66adde721..758b17f64 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -628,7 +628,6 @@ export enum ERC20TokenContractId { WMATIC = "WMATIC", uBAYC = "uBAYC", uPPG = "uPPG", - GHOST = "GHOST", } export enum ERC721TokenContractId { @@ -654,6 +653,7 @@ export enum ERC721TokenContractId { KODA = "KODA", BLOCKS = "BLOCKS", EXRP = "EXRP", + GHOST = "GHOST", } export enum NTokenContractId { From 862c83bb503034cfae8bfe2b10af57a3a6891bcd Mon Sep 17 00:00:00 2001 From: zhoujia6139 Date: Sat, 18 Nov 2023 09:42:11 +0800 Subject: [PATCH 3/4] chore: update ghost config --- helpers/hardhat-constants.ts | 1 + market-config/reservesConfigs.ts | 6 +++--- market-config/timeLockStrategies.ts | 24 ++++++++++++------------ scripts/upgrade/ntoken.ts | 6 ++++-- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/helpers/hardhat-constants.ts b/helpers/hardhat-constants.ts index 2f288210b..c02769a30 100644 --- a/helpers/hardhat-constants.ts +++ b/helpers/hardhat-constants.ts @@ -489,6 +489,7 @@ export const eContractidToContractName = { EXRP: "MintableERC721", WGLMR: "MintableERC721", MockBendDaoLendPool: "MockLendPool", + AggregatorGHOST:"ERC721OracleWrapper", PositionMoverLogic: "PositionMoverLogic", PoolPositionMoverImpl: "PoolPositionMover", GHOST: "MintableERC721", diff --git a/market-config/reservesConfigs.ts b/market-config/reservesConfigs.ts index 3546d45b6..1756c2d0b 100644 --- a/market-config/reservesConfigs.ts +++ b/market-config/reservesConfigs.ts @@ -1116,11 +1116,11 @@ export const strategyuPPG: IReserveParams = { export const strategyGHOST: IReserveParams = { strategy: rateStrategyNFT, - auctionStrategy: auctionStrategyGHOST, + auctionStrategy: auctionStrategyBEANZ, timeLockStrategy: timeLockStrategyGHOST, - baseLTVAsCollateral: "2000", + baseLTVAsCollateral: "3000", liquidationProtocolFeePercentage: "0", - liquidationThreshold: "3500", + liquidationThreshold: "6500", liquidationBonus: "10500", borrowingEnabled: false, reserveDecimals: "0", diff --git a/market-config/timeLockStrategies.ts b/market-config/timeLockStrategies.ts index 85fe6a8ac..51bed4125 100644 --- a/market-config/timeLockStrategies.ts +++ b/market-config/timeLockStrategies.ts @@ -689,6 +689,18 @@ export const timeLockStrategyBEANZ: ITimeLockStrategyParams = { period: "86400", }; +export const timeLockStrategyGHOST: ITimeLockStrategyParams = { + name: "timeLockStrategyGHOST", + minThreshold: "5", + midThreshold: "20", + minWaitTime: "12", + midWaitTime: "7200", + maxWaitTime: "21600", + poolPeriodWaitTime: "600", + poolPeriodLimit: "40", + period: "86400", +}; + export const timeLockStrategyDEGODS: ITimeLockStrategyParams = { name: "timeLockStrategyDEGODS", minThreshold: "4", @@ -760,15 +772,3 @@ export const timeLockStrategyEXRP: ITimeLockStrategyParams = { poolPeriodLimit: "100", period: "86400", }; - -export const timeLockStrategyGHOST: ITimeLockStrategyParams = { - name: "timeLockStrategyGHOST", - minThreshold: "20", - midThreshold: "50", - minWaitTime: "12", - midWaitTime: "7200", - maxWaitTime: "21600", - poolPeriodWaitTime: "600", - poolPeriodLimit: "100", - period: "86400", -}; diff --git a/scripts/upgrade/ntoken.ts b/scripts/upgrade/ntoken.ts index ba3ca36f6..21713a50b 100644 --- a/scripts/upgrade/ntoken.ts +++ b/scripts/upgrade/ntoken.ts @@ -76,12 +76,14 @@ export const upgradeNToken = async (verify = false) => { continue; } - if (XTOKEN_SYMBOL_UPGRADE_WHITELIST && !XTOKEN_SYMBOL_UPGRADE_WHITELIST.includes(symbol)) { + if ( + XTOKEN_SYMBOL_UPGRADE_WHITELIST && + !XTOKEN_SYMBOL_UPGRADE_WHITELIST.includes(symbol) + ) { console.log(symbol + "not in XTOKEN_SYMBOL_UPGRADE_WHITELIST, skip..."); continue; } - if (xTokenType == XTokenType.NTokenBAYC) { if (!nTokenBAYCImplementationAddress) { console.log("deploy NTokenBAYC implementation"); From cf87bbefefb793cf59f389117e932677f198aef3 Mon Sep 17 00:00:00 2001 From: zhoujia6139 Date: Sat, 18 Nov 2023 09:43:41 +0800 Subject: [PATCH 4/4] chore: fix lint --- helpers/hardhat-constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/hardhat-constants.ts b/helpers/hardhat-constants.ts index c02769a30..ff68875b4 100644 --- a/helpers/hardhat-constants.ts +++ b/helpers/hardhat-constants.ts @@ -489,7 +489,7 @@ export const eContractidToContractName = { EXRP: "MintableERC721", WGLMR: "MintableERC721", MockBendDaoLendPool: "MockLendPool", - AggregatorGHOST:"ERC721OracleWrapper", + AggregatorGHOST: "ERC721OracleWrapper", PositionMoverLogic: "PositionMoverLogic", PoolPositionMoverImpl: "PoolPositionMover", GHOST: "MintableERC721",