diff --git a/README.md b/README.md index 879fc0f..cf0a3a8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The YAML file includes details for multiple objects (PT, YT, LP), each correspon - name: The name of the protocol. - icon: The protocol’s logo (circular logo in PNG). The string on this field should be the same as the name of the logo file uploaded. Size limit for logo is 20KB. - - category: The protocol's category. It must belong to one of the following categories: `money market`, `vault` or `liquid locker`. If no category is specified, the protocol will automatically default to the `others` type. + - category: The protocol's category. It must belong to one of the following categories: `Money Market`, `Yield Strategy`, `Liquid Locker` or `Others`. - metadata: This section contains detailed information about the protocol's integration assets. #### Asset fields @@ -26,7 +26,7 @@ The YAML file includes details for multiple objects (PT, YT, LP), each correspon ```yaml name: Protocol Name 2 icon: logo.png -category: 'vault' +category: 'Yield Strategy' metadata: pt: - chainId: 1 diff --git a/const.js b/const.js index 3e4a291..99d91ea 100644 --- a/const.js +++ b/const.js @@ -1,7 +1,6 @@ -const DEFAULT_PROTOCOL_CATEGORY = 'others'; -const PROTOCOL_CATEGORIES = ['money market', 'vault', 'liquid locker']; +// categories need to be lowercase strings +const PROTOCOL_CATEGORIES = ['money market', 'yield strategy', 'liquid locker', 'others']; module.exports = { - DEFAULT_PROTOCOL_CATEGORY, PROTOCOL_CATEGORIES, } \ No newline at end of file diff --git a/merge-config.js b/merge-config.js index c3df586..d2cfb23 100644 --- a/merge-config.js +++ b/merge-config.js @@ -2,7 +2,6 @@ const fs = require('fs'); const path = require('path'); const crypto = require('crypto'); const yaml = require("js-yaml"); -const {DEFAULT_PROTOCOL_CATEGORY} = require("./const"); async function run() { const protocolsPath = path.join(__dirname, 'protocols'); @@ -59,7 +58,7 @@ function formatProtocolConfig(config) { id, name, icon, - category: category ?? DEFAULT_PROTOCOL_CATEGORY, + category: category.toLowerCase(), metadata: { pt: formatMetadataAssets(pt), yt: formatMetadataAssets(yt), diff --git a/protocols/avalon-finance/config.yaml b/protocols/avalon-finance/config.yaml index 7a12d00..eb362de 100644 --- a/protocols/avalon-finance/config.yaml +++ b/protocols/avalon-finance/config.yaml @@ -1,5 +1,6 @@ name: Avalon Finance icon: logo.png +category: Money Market metadata: pt: # Ethereum PT-corn-SolvBTC.BBN-26DEC2024 diff --git a/protocols/beefy/config.yaml b/protocols/beefy/config.yaml index 0a20d6e..bd5caae 100644 --- a/protocols/beefy/config.yaml +++ b/protocols/beefy/config.yaml @@ -1,5 +1,6 @@ name: Beefy icon: logo.png +category: Yield Strategy metadata: pt: [] yt: [] diff --git a/protocols/cega/config.yaml b/protocols/cega/config.yaml index 7df3719..d14df95 100644 --- a/protocols/cega/config.yaml +++ b/protocols/cega/config.yaml @@ -1,5 +1,6 @@ name: Cega icon: logo.png +category: Yield Strategy metadata: pt: [] yt: diff --git a/protocols/contango/config.yaml b/protocols/contango/config.yaml index 458c895..8947a62 100644 --- a/protocols/contango/config.yaml +++ b/protocols/contango/config.yaml @@ -1,5 +1,6 @@ name: Contango icon: logo.png +category: Yield Strategy metadata: pt: - chainId: 1 diff --git a/protocols/euler/config.yaml b/protocols/euler/config.yaml index 87dd73b..61cec9a 100644 --- a/protocols/euler/config.yaml +++ b/protocols/euler/config.yaml @@ -1,5 +1,6 @@ name: Euler icon: logo.png +category: Money Market metadata: pt: - chainId: 1 diff --git a/protocols/form/config.yaml b/protocols/form/config.yaml index 0d178f0..ed3f890 100644 --- a/protocols/form/config.yaml +++ b/protocols/form/config.yaml @@ -1,5 +1,6 @@ name: Form icon: logo.png +category: Others metadata: pt: - chainId: 1 diff --git a/protocols/index-coop/config.yaml b/protocols/index-coop/config.yaml index 4e12773..a154d95 100644 --- a/protocols/index-coop/config.yaml +++ b/protocols/index-coop/config.yaml @@ -1,5 +1,6 @@ name: Index Coop icon: logo.png +category: Yield Strategy metadata: pt: - chainId: 1 diff --git a/protocols/marginly/config.yaml b/protocols/marginly/config.yaml index c164ee9..f072b4e 100644 --- a/protocols/marginly/config.yaml +++ b/protocols/marginly/config.yaml @@ -1,5 +1,6 @@ name: Marginly icon: marginly-logo.png +category: Yield Strategy metadata: pt: - chainId: 1 diff --git a/protocols/morpho/config.yaml b/protocols/morpho/config.yaml index b6abcdf..ff22b0a 100644 --- a/protocols/morpho/config.yaml +++ b/protocols/morpho/config.yaml @@ -1,5 +1,6 @@ name: Morpho icon: logo.png +category: Money Market metadata: pt: - chainId: 1 diff --git a/protocols/origami/config.yaml b/protocols/origami/config.yaml index b50d99e..4d0517d 100644 --- a/protocols/origami/config.yaml +++ b/protocols/origami/config.yaml @@ -1,5 +1,6 @@ name: Origami icon: logo.png +category: Yield Strategy metadata: pt: - chainId: 1 diff --git a/protocols/pichi/config.yaml b/protocols/pichi/config.yaml index f94092f..199a40e 100644 --- a/protocols/pichi/config.yaml +++ b/protocols/pichi/config.yaml @@ -1,5 +1,6 @@ name: Pichi icon: logo.png +category: Others metadata: pt: - chainId: 1 diff --git a/protocols/silo/config.yaml b/protocols/silo/config.yaml index 8a04be5..5ba0065 100644 --- a/protocols/silo/config.yaml +++ b/protocols/silo/config.yaml @@ -1,5 +1,6 @@ name: Silo icon: logo.png +category: Money Market metadata: pt: - chainId: 1 diff --git a/protocols/timeswap/config.yaml b/protocols/timeswap/config.yaml index ea833a6..65c86f8 100644 --- a/protocols/timeswap/config.yaml +++ b/protocols/timeswap/config.yaml @@ -1,5 +1,6 @@ name: Timeswap icon: logo.png +category: Money Market metadata: pt: - chainId: 42161 diff --git a/protocols/venus/config.yaml b/protocols/venus/config.yaml index 12b9ed8..8f6ccc7 100644 --- a/protocols/venus/config.yaml +++ b/protocols/venus/config.yaml @@ -1,5 +1,6 @@ name: Venus Protocol icon: venus.png +category: Money Market metadata: pt: - chainId: 1 diff --git a/protocols/yearn/config.yaml b/protocols/yearn/config.yaml index 3a3553d..c84cdd2 100644 --- a/protocols/yearn/config.yaml +++ b/protocols/yearn/config.yaml @@ -1,5 +1,6 @@ name: yearn icon: logo.png +category: Yield Strategy metadata: pt: - chainId: 1 diff --git a/protocols/zerolend/config.yaml b/protocols/zerolend/config.yaml index b5be79c..48ffa41 100644 --- a/protocols/zerolend/config.yaml +++ b/protocols/zerolend/config.yaml @@ -1,5 +1,6 @@ name: ZeroLend icon: logo.png +category: Money Market metadata: pt: - chainId: 1 diff --git a/validate-config.js b/validate-config.js index f67308e..2e3ea17 100644 --- a/validate-config.js +++ b/validate-config.js @@ -17,12 +17,8 @@ function isKebabCase(str) { } function validateCategory(protocol, category) { - if (category === undefined) { - return; - } - - if (!mustBeNonEmptyString(category) || !PROTOCOL_CATEGORIES.includes(category)) { - throw new Error(`protocol ${protocol}: invalid field 'category', category must be one of the values (${PROTOCOL_CATEGORIES.join(', ')}) or left unset`); + if (!mustBeNonEmptyString(category) || !PROTOCOL_CATEGORIES.includes(category.toLowerCase())) { + throw new Error(`protocol ${protocol}: invalid field 'category', category must be case-insensitive one of the values (${PROTOCOL_CATEGORIES.join(', ')})`); } }