diff --git a/config.schema.json b/config.schema.json index 8954e52..1053cbd 100644 --- a/config.schema.json +++ b/config.schema.json @@ -301,6 +301,15 @@ "type": "string", "description": "The message shown on the banner describing markets being removed" }, + "action_trigger_date": { + "type": "string", + "description": "The date and time when the action in the banner message is triggered. The past_tense_text will not be shown if this value is omitted", + "pattern": "^\\d{4}(-\\d\\d(-\\d\\d(T\\d\\d:\\d\\d(:\\d\\d)?(\\.\\d+)?(([+-]\\d\\d:\\d\\d)|Z)?)?)?)?$" + }, + "past_tense_text": { + "type": "string", + "description": "The alternative message shown after the date of markets being added or removed has passed" + }, "added_markets": { "type": "string", "description": "The message shown on the banner describing markets being added" @@ -405,6 +414,9 @@ "added_markets": { "$ref": "#/$defs/added_markets" }, + "past_tense_text": { + "$ref": "#/$defs/past_tense_text" + }, "subtext": { "$ref": "#/$defs/subtext" } diff --git a/configs/mainnet.json b/configs/mainnet.json index 91de82c..ba3868d 100644 --- a/configs/mainnet.json +++ b/configs/mainnet.json @@ -369,22 +369,30 @@ }, "banners": [ { - "perp_pool_id": "8", - "show_until": "2024-07-29T08:00+00:00", + "perp_pool_id": "9", + "show_until": "2024-08-25T08:00+00:00", "title": "New Markets added", - "added_markets": "ETC Perp Market will be added to this Perp Pool on 24 Jul, 08:00 AM UTC. This banner will disappear on 29 Jul." + "added_markets": "CRV will be added to this Perp Pool on 22 Aug, 08:00 AM UTC. This banner will disappear on 25 Aug." }, { - "perp_pool_id": "9", - "show_until": "2024-07-29T08:00+00:00", + "perp_pool_id": "7", + "show_until": "2024-08-25T08:00+00:00", "title": "New Markets added", - "added_markets": "LDO Perp Market will be added to this Perp Pool on 24 Jul, 08:00 AM UTC. This banner will disappear on 29 Jul." + "added_markets": "SUN will be added to this Perp Pool on 22 Aug, 08:00 AM UTC. This banner will disappear on 25 Aug." }, { - "perp_pool_id": "1", - "show_until": "2024-07-15T08:00+00:00", + "perp_pool_id": "4", + "show_until": "2024-08-30T08:00+00:00", "title": "New Markets added", - "removed_markets": "[Ticker] Perp Market will be added to this Perp Pool on [Date]. This banner will disappear on [Date] 08:00 AM UTC." + "added_markets": "On 20 Aug, 08:00 AM UTC, this perp pool was renamed to 'Modular'. MNT, MANTA, ARB, OP were added to this Perp Pool" + }, + { + "perp_pool_id": "6", + "show_until": "2024-08-30T08:00+00:00", + "title": "Markets removed", + "removed_markets": "On 20 Aug 8AM UTC, all markets in this perp pool will be moved to the Celestia Perp Pool to consolidate liquidity.", + "action_trigger_date": "2024-08-20T08:00+00:00", + "past_tense_text": "On 20 Aug 8AM UTC, all markets in this perp pool have been moved to the Celestia Perp Pool to consolidate liquidity." } ] }, diff --git a/scripts/check_configs.ts b/scripts/check_configs.ts index 32d32ca..5f1dc6d 100644 --- a/scripts/check_configs.ts +++ b/scripts/check_configs.ts @@ -50,6 +50,8 @@ interface PerpPoolBanner { title: string; removed_markets?: string; added_markets?: string; + action_trigger_date?: string; + past_tense_text?: string; subtext?: string; } @@ -96,7 +98,7 @@ interface Incentives { interface PerpPoolConfig { incentives: Incentives - banners: PerpPoolBanner + banners: PerpPoolBanner[] } type OutcomeMap = { [key in CarbonSDK.Network]: boolean }; // true = success, false = failure @@ -236,13 +238,13 @@ function isValidAdditionalIbcTokenConfig(addTokenConfigArr: AdditionalIbcTokenCo } function isValidDemexTradingLeagueConfig( - demexTradingLeagueConfig: DemexTradingLeagueConfig, - network: CarbonSDK.Network, + demexTradingLeagueConfig: DemexTradingLeagueConfig, + network: CarbonSDK.Network, marketIds: string[], blacklistedMarkets: string[], perpPoolIds: string[], tokenSymbols: string[]) { - + const hasInvalidPromoMarkets = checkValidEntries(demexTradingLeagueConfig.promoMarkets, marketIds); if (hasInvalidPromoMarkets.status && hasInvalidPromoMarkets.entry) { let listOfInvalidMarkets: string = hasInvalidPromoMarkets.entry.join(', '); @@ -256,7 +258,7 @@ function isValidDemexTradingLeagueConfig( console.error(`ERROR: ${network}.json has the following duplicated promo market entries in demex_trading_league_config: ${listOfDuplicates}. Please make sure to only input each market once in ${network}`); return false; } - + const hasBlacklistedMarketsInPromo = checkBlacklistedMarkets(demexTradingLeagueConfig.promoMarkets, blacklistedMarkets); if (hasBlacklistedMarketsInPromo.status && hasBlacklistedMarketsInPromo.entry) { let listOfBlacklistedMarkets: string = hasBlacklistedMarketsInPromo.entry.join(", "); @@ -556,13 +558,13 @@ async function main() { const hasDuplicateLinks = checkDuplicateEntries(distributorsArr) if (hasDuplicateLinks.status && hasDuplicateLinks.entry) { let listOfDuplicates: string = hasDuplicateLinks.entry.join(", "); - console.error(`ERROR: ${network}.json has the following duplicated distributors in the perp pools incentives configs: ${listOfDuplicates}. Please make sure to only input each link once in ${network}`); + console.error(`ERROR: ${network}.json has the following duplicated distributors in the perp_pools incentives configs: ${listOfDuplicates}. Please make sure to only input each link once in ${network}`); outcomeMap[network] = false; } distributorsArr.forEach((address) => { if (!checkAddressIsEVM(address)) { - console.error(`ERROR: ${network}.json has invalid EVM address in perp pools incentives configs: ${address}`); + console.error(`ERROR: ${network}.json has invalid EVM address in perp_pools incentives configs: ${address}`); outcomeMap[network] = false; } }) @@ -571,19 +573,15 @@ async function main() { const proxy = perpPoolConfig.incentives.proxy if (proxy) { if (!checkAddressIsEVM(proxy)) { - console.error(`ERROR: ${network}.json has invalid EVM address in perp pools incentives proxy configs: ${proxy}`); + console.error(`ERROR: ${network}.json has invalid EVM address in perp_pools incentives proxy configs: ${proxy}`); outcomeMap[network] = false; } } } + if (perpPoolConfig.banners) { const banners = perpPoolConfig.banners // Checking perp pool banners - const perpPoolsQuery = await sdk.query.perpspool.PoolInfoAll({ - pagination: PageRequest.fromPartial({ - limit: new Long(10000), - }), - }) const perpPoolIds = perpPoolsQuery.pools.map((pool) => pool.poolId.toString()) const perpPoolBannerIds = Object.values(banners).map((banner) => banner.perp_pool_id) @@ -593,7 +591,7 @@ async function main() { if (hasInvalidPerpPoolBannerIds.status && hasInvalidPerpPoolBannerIds.entry) { let listOfInvalidIds: string = hasInvalidPerpPoolBannerIds.entry.join(", "); - console.error(`ERROR: ${network}.json has the following invalid perp pool ids under the perp_pool_banners field: ${listOfInvalidIds}`) + console.error(`ERROR: ${network}.json has the following invalid perp pool ids under the perp_pools banners field: ${listOfInvalidIds}`) outcomeMap[network] = false; }