diff --git a/.github/markets/pr_template.md b/.github/markets/pr_template.md
index c042f84..b6bc4a2 100644
--- a/.github/markets/pr_template.md
+++ b/.github/markets/pr_template.md
@@ -31,6 +31,7 @@ Each json file under the [configs](../../configs) folder correspond to their res
|`disabled_transfer_banner_config` |`DisabledTransferBannerConfig` |false |Config parameters for displaying banner to inform users that transfers for the relevant tokens are disabled |
|`trading_leagues` |`TradingLeague[]` |false |Map of trading league config with their path. |
|`lst_native_aprs` |`LSTNativeAPR[]` |false |List of LST native APR APIs. |
+|`nps_config` | `NPSConfig` | false | Config parameters for managing NPS survey |
## Maintenance Data Structure
|Field |Type |Required |Description |Notes |
@@ -155,3 +156,8 @@ Each json file under the [configs](../../configs) folder correspond to their res
|`api_url` |`string` |true |The API to fetch LST Native APR |
|`lst_denoms` |`object` |true |The key value object for mapping denom of protocol api and carbon lst denom |
+## NPSConfig Data Structure
+|Field |Type |Required |Description |Notes |
+|---|---|---|---|---|
+|`start` |`string` |true |Start time of the NPS survey | This field **MUST** follow the valid ISO 8601 format
e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
+|`end` |`string` |true |End time of the NPS survey | This field **MUST** follow the valid ISO 8601 format
e.g. *2024-01-23T09:00+00:00* (23 Jan 2024, 9am UTC) |
diff --git a/config.schema.json b/config.schema.json
index 977d50b..f659da0 100644
--- a/config.schema.json
+++ b/config.schema.json
@@ -658,6 +658,19 @@
"items": {
"$ref": "#/$defs/lst_native_apr"
}
+ },
+ "nps_config": {
+ "type": "object",
+ "description": "Config parameters for managing NPS survey",
+ "required": ["start", "end"],
+ "properties": {
+ "start": {
+ "$ref": "#/$defs/start"
+ },
+ "end": {
+ "$ref": "#/$defs/end"
+ }
+ }
}
}
-}
\ No newline at end of file
+}
diff --git a/configs/devnet.json b/configs/devnet.json
index 0a4301c..754c3ec 100644
--- a/configs/devnet.json
+++ b/configs/devnet.json
@@ -65,5 +65,9 @@
"label_denom": "dai",
"target_denom" : "dai"
}
- ]
+ ],
+ "nps_config": {
+ "start": "2025-02-02T12:00:00Z",
+ "end": "2025-02-16T12:00:00Z"
+ }
}
\ No newline at end of file
diff --git a/configs/mainnet.json b/configs/mainnet.json
index 5e0d353..ccacddf 100644
--- a/configs/mainnet.json
+++ b/configs/mainnet.json
@@ -547,5 +547,9 @@
"milkTIA": "ibc/16065EE5282C5217685C8F084FC44864C25C706AC37356B0D62811D50B96920F"
}
}
- ]
+ ],
+ "nps_config": {
+ "start": "2025-02-02T12:00:00Z",
+ "end": "2025-02-16T12:00:00Z"
+ }
}
diff --git a/configs/testnet.json b/configs/testnet.json
index f3f0a07..dac2fae 100644
--- a/configs/testnet.json
+++ b/configs/testnet.json
@@ -1,13 +1,7 @@
{
"network": "testnet",
"prelaunch_markets": [],
- "blacklisted_markets": [
- "swth_btc",
- "swth_btc2",
- "swth_nex",
- "swth_nexo",
- "swth_dai"
- ],
+ "blacklisted_markets": [],
"blacklisted_pools": [],
"blacklisted_tokens": [],
"transfer_options": {},
@@ -28,7 +22,7 @@
"external_chain_channels": {},
"additional_ibc_token_config": [],
"demex_trading_league_config": {
- "promoMarkets": ["ATOM_PERP.CGUSD"],
+ "promoMarkets": [],
"currentPrizeSymbol": "USDC",
"currentCompPerpPoolId": 1
},
@@ -66,18 +60,10 @@
{
"label_denom": "swth",
"target_denom" : "swth"
- },
- {
- "label_denom": "usdc",
- "target_denom" : "usdc"
- },
- {
- "label_denom": "eth",
- "target_denom" : "eth"
- },
- {
- "label_denom": "dai",
- "target_denom" : "dai"
}
- ]
+ ],
+ "nps_config": {
+ "start": "2025-02-02T12:00:00Z",
+ "end": "2025-02-16T12:00:00Z"
+ }
}
diff --git a/scripts/check_configs.ts b/scripts/check_configs.ts
index fb90206..c34b5cd 100644
--- a/scripts/check_configs.ts
+++ b/scripts/check_configs.ts
@@ -38,6 +38,7 @@ interface ConfigJSON {
announcement_banner: AnnouncementBanner;
quick_select_deposit_options?: QuickSelectToken[];
lst_native_aprs?: LstNativeAPR[];
+ nps_config?: NPSConfig;
}
interface InvalidEntry {
@@ -162,6 +163,11 @@ interface LstNativeAPR {
lst_denoms: SimpleMap;
}
+interface NPSConfig {
+ start: string;
+ end: string;
+}
+
type OutcomeMap = { [key in CarbonSDK.Network]: boolean }; // true = success, false = failure
const outcomeMap: OutcomeMap = {
@@ -530,6 +536,19 @@ function isValidLSTNativeDenom(lstNativeAPRs: LstNativeAPR[], network: CarbonSDK
return true;
}
+function isValidNPSConfig(npsConfig: NPSConfig, network: CarbonSDK.Network): boolean {
+ const { start, end } = npsConfig;
+ const startTime = new Date(start);
+ const endTime = new Date(end);
+
+ if (endTime < startTime) {
+ console.error(`ERROR: nps_config.end is before nps_config.start in ${network}.json`);
+ return false;
+ }
+
+ return true;
+}
+
async function main() {
for (const net of myArgs) {
let network: CarbonSDK.Network;
@@ -925,6 +944,10 @@ async function main() {
if (jsonData.lst_native_aprs && !isValidLSTNativeDenom(jsonData.lst_native_aprs, network, tokens)) {
outcomeMap[network] = false;
}
+ // check for NPS config
+ if (jsonData.nps_config && !isValidNPSConfig(jsonData.nps_config, network)) {
+ outcomeMap[network] = false;
+ }
}
}
const outcomeArr = Object.values(outcomeMap);