From cdf396428fc0c49678266db72caee452c22481c0 Mon Sep 17 00:00:00 2001 From: Gareth Fuller Date: Fri, 21 Jul 2023 14:26:35 +0100 Subject: [PATCH] refactor: Pool feature metadata --- src/components/chips/BoostedChip.vue | 36 ---- src/components/chips/PoolFeatureChip.vue | 63 ++++++ .../PoolsTable/PoolsTableExtraInfo.spec.ts | 2 +- .../tables/PoolsTable/PoolsTableExtraInfo.vue | 22 +- src/composables/usePoolHelpers.ts | 25 ++- src/composables/usePoolRisks.ts | 10 +- .../{useBoostedPool.ts => useProtocols.ts} | 32 +-- src/lib/config/arbitrum/pools.ts | 74 +++++-- src/lib/config/gnosis-chain/pools.ts | 32 ++- src/lib/config/goerli/pools.ts | 36 +++- src/lib/config/mainnet/pools.ts | 193 +++++++++++++----- src/lib/config/polygon/pools.ts | 109 +++++++--- src/lib/config/zkevm/pools.ts | 26 ++- src/locales/default.json | 1 + src/types/pools.ts | 18 +- 15 files changed, 467 insertions(+), 212 deletions(-) delete mode 100644 src/components/chips/BoostedChip.vue create mode 100644 src/components/chips/PoolFeatureChip.vue rename src/composables/{useBoostedPool.ts => useProtocols.ts} (69%) diff --git a/src/components/chips/BoostedChip.vue b/src/components/chips/BoostedChip.vue deleted file mode 100644 index 3019f4c153..0000000000 --- a/src/components/chips/BoostedChip.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/src/components/chips/PoolFeatureChip.vue b/src/components/chips/PoolFeatureChip.vue new file mode 100644 index 0000000000..b44d8a0880 --- /dev/null +++ b/src/components/chips/PoolFeatureChip.vue @@ -0,0 +1,63 @@ + + + diff --git a/src/components/tables/PoolsTable/PoolsTableExtraInfo.spec.ts b/src/components/tables/PoolsTable/PoolsTableExtraInfo.spec.ts index 6bc4386e53..80b780c581 100644 --- a/src/components/tables/PoolsTable/PoolsTableExtraInfo.spec.ts +++ b/src/components/tables/PoolsTable/PoolsTableExtraInfo.spec.ts @@ -17,7 +17,7 @@ test('Renders boosted pool button with boosted chip', () => { renderInfo(aPool({ id: boostedPoolId })); expect(screen.getByRole('button', { name: 'Boosted' })).toBeInTheDocument(); - expect(screen.getByTestId('boosted-chip')).toBeInTheDocument(); + expect(screen.getByTestId('feature-chip')).toBeInTheDocument(); }); test('Renders NEW pool chip', () => { diff --git a/src/components/tables/PoolsTable/PoolsTableExtraInfo.vue b/src/components/tables/PoolsTable/PoolsTableExtraInfo.vue index 236dfa5637..7399aa75e4 100644 --- a/src/components/tables/PoolsTable/PoolsTableExtraInfo.vue +++ b/src/components/tables/PoolsTable/PoolsTableExtraInfo.vue @@ -2,13 +2,14 @@ import { isLiquidityBootstrapping, isBoosted, + protocolsFor, + isClp, } from '@/composables/usePoolHelpers'; -import { poolMetadata } from '@/lib/config/metadata'; import { Pool } from '@/services/pool/types'; -import { PoolMetadata } from '@/types/pools'; +import { PoolFeature } from '@/types/pools'; import BalChipNew from '@/components/chips/BalChipNew.vue'; -import BoostedChip from '@/components/chips/BoostedChip.vue'; import PoolWarningTooltip from '@/components/pool/PoolWarningTooltip.vue'; +import PoolFeatureChip from '@/components/chips/PoolFeatureChip.vue'; type Props = { pool: Pool; @@ -21,8 +22,19 @@ defineProps();
+ + + + diff --git a/src/composables/usePoolHelpers.ts b/src/composables/usePoolHelpers.ts index 6b13bf1ac4..efc4f4ef71 100644 --- a/src/composables/usePoolHelpers.ts +++ b/src/composables/usePoolHelpers.ts @@ -13,7 +13,11 @@ import { } from '@/lib/utils'; import { includesWstEth } from '@/lib/utils/balancer/lido'; import { configService } from '@/services/config/config.service'; -import { DeprecatedDetails, NewVersionAvailableDetails } from '@/types/pools'; +import { + DeprecatedDetails, + NewVersionAvailableDetails, + PoolFeature, +} from '@/types/pools'; import { AnyPool, Pool, PoolToken, SubPool } from '@/services/pool/types'; import { hasBalEmissions } from './useAPR'; @@ -27,6 +31,7 @@ import { import useNumbers, { FNumFormats, numF } from './useNumbers'; import { dateToUnixTimestamp } from './useTime'; import { poolMetadata } from '@/lib/config/metadata'; +import { Protocol } from './useProtocols'; const POOLS = configService.network.pools; @@ -93,11 +98,25 @@ export function isDeep(pool: Pool): boolean { } export function isBoosted(pool: Pool) { - return !!poolMetadata(pool.id)?.boosted; + return !!Object.keys(poolMetadata(pool.id)?.features || {}).includes( + PoolFeature.Boosted + ); +} + +export function isClp(pool: Pool) { + return !!Object.keys(poolMetadata(pool.id)?.features || {}).includes( + PoolFeature.CLP + ); +} + +export function protocolsFor(pool: Pool, feature: PoolFeature): Protocol[] { + return poolMetadata(pool.id)?.features?.[feature]?.featureProtocols || []; } export function boostedProtocols(pool: Pool) { - return poolMetadata(pool.id)?.boostedProtocols; + if (!isBoosted(pool)) return []; + return poolMetadata(pool.id)?.features?.[PoolFeature.Boosted] + ?.featureProtocols; } /** diff --git a/src/composables/usePoolRisks.ts b/src/composables/usePoolRisks.ts index f173041eb6..98f89337c1 100644 --- a/src/composables/usePoolRisks.ts +++ b/src/composables/usePoolRisks.ts @@ -1,4 +1,4 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; +import { Protocol } from '@/composables/useProtocols'; import { isArbitrum, isGnosis, @@ -93,17 +93,13 @@ export function riskLinks(pool: Pool): Risk[] { export function generateThirdPartyComposabilityRisks(pool): Risk | undefined { const protocols = boostedProtocols(pool); - if ( - protocols?.includes(BoostedProtocol.Tetu) || - protocols?.includes(BoostedProtocol.Idle) - ) + if (protocols?.includes(Protocol.Tetu) || protocols?.includes(Protocol.Idle)) return aLink( RiskKey.Composability, 'Third party DeFi composability risks: May use multiple yield protocols' ); - if (protocols?.includes(BoostedProtocol.Reaper)) - protocols.push(BoostedProtocol.Granary); + if (protocols?.includes(Protocol.Reaper)) protocols.push(Protocol.Granary); if (protocols) { return aLink( diff --git a/src/composables/useBoostedPool.ts b/src/composables/useProtocols.ts similarity index 69% rename from src/composables/useBoostedPool.ts rename to src/composables/useProtocols.ts index 8965599b41..718224b856 100644 --- a/src/composables/useBoostedPool.ts +++ b/src/composables/useProtocols.ts @@ -1,4 +1,4 @@ -export enum BoostedProtocol { +export enum Protocol { Aave = 'aave', Agave = 'agave', Beefy = 'beefy', @@ -15,60 +15,60 @@ export enum BoostedProtocol { Zerovix = '0vix', } -export const boostedProtocolIconPaths: Record = { - [BoostedProtocol.Aave]: new URL( +export const protocolIconPaths: Record = { + [Protocol.Aave]: new URL( '@/assets/images/icons/protocols/aave.svg', import.meta.url ).href, - [BoostedProtocol.Agave]: new URL( + [Protocol.Agave]: new URL( '@/assets/images/icons/protocols/agave.png', import.meta.url ).href, - [BoostedProtocol.Beefy]: new URL( + [Protocol.Beefy]: new URL( '@/assets/images/icons/protocols/beefy.svg', import.meta.url ).href, - [BoostedProtocol.Euler]: new URL( + [Protocol.Euler]: new URL( '@/assets/images/icons/protocols/euler.svg', import.meta.url ).href, - [BoostedProtocol.Yearn]: new URL( + [Protocol.Yearn]: new URL( '@/assets/images/icons/protocols/yearn.svg', import.meta.url ).href, - [BoostedProtocol.Gearbox]: new URL( + [Protocol.Gearbox]: new URL( '@/assets/images/icons/protocols/gearbox.svg', import.meta.url ).href, - [BoostedProtocol.Idle]: new URL( + [Protocol.Idle]: new URL( '@/assets/images/icons/protocols/idle.svg', import.meta.url ).href, - [BoostedProtocol.Morpho]: new URL( + [Protocol.Morpho]: new URL( '@/assets/images/icons/protocols/morpho.svg', import.meta.url ).href, - [BoostedProtocol.Tessera]: new URL( + [Protocol.Tessera]: new URL( '@/assets/images/icons/protocols/tessera.svg', import.meta.url ).href, - [BoostedProtocol.Sturdy]: new URL( + [Protocol.Sturdy]: new URL( '@/assets/images/icons/protocols/sturdy.png', import.meta.url ).href, - [BoostedProtocol.Reaper]: new URL( + [Protocol.Reaper]: new URL( '@/assets/images/icons/protocols/reaper.svg', import.meta.url ).href, - [BoostedProtocol.Granary]: new URL( + [Protocol.Granary]: new URL( '@/assets/images/icons/protocols/granary.svg', import.meta.url ).href, - [BoostedProtocol.Tetu]: new URL( + [Protocol.Tetu]: new URL( '@/assets/images/icons/protocols/tetu.png', import.meta.url ).href, - [BoostedProtocol.Zerovix]: new URL( + [Protocol.Zerovix]: new URL( '@/assets/images/icons/protocols/0vix.svg', import.meta.url ).href, diff --git a/src/lib/config/arbitrum/pools.ts b/src/lib/config/arbitrum/pools.ts index 9d8f842114..44e1af897d 100644 --- a/src/lib/config/arbitrum/pools.ts +++ b/src/lib/config/arbitrum/pools.ts @@ -1,5 +1,5 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { PoolWarning, Pools } from '@/types/pools'; +import { Protocol } from '@/composables/useProtocols'; +import { PoolFeature, PoolWarning, Pools } from '@/types/pools'; const pools: Pools = { IdsMap: {}, @@ -155,62 +155,92 @@ const pools: Pools = { '0x077794c30afeccdf5ad2abc0588e8cee7197b71a000000000000000000000352': { name: 'Balancer Boosted Reaper Granary USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Reaper], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Reaper], + }, + }, }, '0xcba9ff45cfb9ce238afde32b0148eb82cbe635620000000000000000000003fd': { name: 'rETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xd3d5d45f4edf82ba0dfaf061d230766032a10e07000200000000000000000413': { name: 'STG/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x9fb7d6dcac7b6aa20108bad226c35b85a9e31b63000200000000000000000412': { name: 'wstETH/Boosted Aave v3 WETH/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xee02583596aee94cccb7e8ccd3921d955f17982a00000000000000000000040a': { name: 'Balancer Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x5a7f39435fd9c381e4932fa2047c9a5136a5e3e7000000000000000000000400': { name: 'wstETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xd0dc20e6342db2de82692b8dc842301ff9121805000200000000000000000454': { name: 'NFTE/wsteth-Boosted Aave v3 WETH', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xbe0f30217be1e981add883848d0773a86d2d2cd4000000000000000000000471': { name: 'rETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x45c4d1376943ab28802b995acffc04903eb5223f000000000000000000000470': { name: 'wstETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xc6eee8cb7643ec2f05f46d569e9ec8ef8b41b389000000000000000000000475': { name: 'Balancer Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, }, Deep: [ diff --git a/src/lib/config/gnosis-chain/pools.ts b/src/lib/config/gnosis-chain/pools.ts index 1ff4136fc6..dcbb9e9b44 100644 --- a/src/lib/config/gnosis-chain/pools.ts +++ b/src/lib/config/gnosis-chain/pools.ts @@ -1,5 +1,5 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { Pools } from '@/types/pools'; +import { Protocol } from '@/composables/useProtocols'; +import { PoolFeature, Pools } from '@/types/pools'; const pools: Pools = { IdsMap: {}, @@ -68,26 +68,38 @@ const pools: Pools = { '0xfedb19ec000d38d92af4b21436870f115db22725000000000000000000000010': { name: 'Balancer Boosted Agave USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Agave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Agave], + }, + }, }, '0xb973ca96a3f0d61045f53255e319aedb6ed49240000200000000000000000011': { name: 'Balancer Boosted Agave GNO/USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Agave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Agave], + }, + }, }, '0xf48f01dcb2cbb3ee1f6aab0e742c2d3941039d56000200000000000000000012': { name: 'Balancer Boosted Agave GNO/WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Agave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Agave], + }, + }, }, '0x66f33ae36dd80327744207a48122f874634b3ada000100000000000000000013': { name: 'Balancer Boosted Agave WETH/WBTC/USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Agave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Agave], + }, + }, }, }, Deep: [ diff --git a/src/lib/config/goerli/pools.ts b/src/lib/config/goerli/pools.ts index d4e66083ee..9b3c0e699e 100644 --- a/src/lib/config/goerli/pools.ts +++ b/src/lib/config/goerli/pools.ts @@ -1,5 +1,5 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { Pools, RiskKey } from '@/types/pools'; +import { Protocol } from '@/composables/useProtocols'; +import { PoolFeature, Pools, RiskKey } from '@/types/pools'; export const poolIdThatRequiresInternalBalanceExit = '0xd4e7c1f3da1144c9e2cfd1b015eda7652b4a439900000000000000000000046a'; @@ -105,31 +105,45 @@ const pools: Pools = { [boostedPoolId]: { name: 'Balancer Boosted Aave USD', hasIcon: false, - boosted: true, + features: { + [PoolFeature.Boosted]: {}, + }, }, [poolIdWithTwoBoostedProtocols]: { name: 'Boosted Aave and Morpho Test Pool', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave, BoostedProtocol.Morpho], // Two boosted protocols for testing purposes + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave, Protocol.Morpho], + }, + }, }, [reaperBoostedPoolId]: { name: 'Reaper Boosted Test Pool', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Reaper], // Explicit Reaper metadata for testing purposes + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Reaper], + }, + }, }, [tetuBoostedPoolId]: { name: 'Tetu Boosted Test Pool', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Tetu], // Explicit Reaper metadata for testing purposes + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Tetu], + }, + }, }, [idleBoostedPoolId]: { name: 'Idle Boosted Test Pool', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Idle], // Explicit Reaper metadata for testing purposes + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Idle], + }, + }, }, }, Deep: [ diff --git a/src/lib/config/mainnet/pools.ts b/src/lib/config/mainnet/pools.ts index e46a92b421..a3b6fc8473 100644 --- a/src/lib/config/mainnet/pools.ts +++ b/src/lib/config/mainnet/pools.ts @@ -1,5 +1,5 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { PoolWarning, Pools } from '@/types/pools'; +import { Protocol } from '@/composables/useProtocols'; +import { PoolFeature, PoolWarning, Pools } from '@/types/pools'; const pools: Pools = { IdsMap: { @@ -345,20 +345,29 @@ const pools: Pools = { '0x7b50775383d3d6f0215a8f290f2c9e2eebbeceb20000000000000000000000fe': { name: 'Balancer Boosted Aave USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xa13a9247ea42d743238089903570127dda72fe4400000000000000000000035d': { name: 'Balancer Boosted Aave USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x50cf90b954958480b8df7958a9e965752f62712400000000000000000000046f': { name: 'Balancer Boosted Euler USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Euler], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Euler], + }, + }, }, '0x06df3b2bbb68adc8b0e302443692037ed9f91b42000000000000000000000063': { name: 'Balancer Stable USD', @@ -371,146 +380,218 @@ const pools: Pools = { '0x60683b05e9a39e3509d8fdb9c959f23170f8a0fa000000000000000000000489': { name: 'Balancer Idle JuniorBY Boosted StablePool', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Idle], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Idle], + }, + }, }, '0x20b156776114e8a801e9767d90c6ccccc8adf398000000000000000000000499': { name: 'Balancer Boosted Yearn USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Yearn], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Yearn], + }, + }, }, '0x99c88ad7dc566616548adde8ed3effa730eb6c3400000000000000000000049a': { name: 'Balancer Boosted Gearbox USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Gearbox], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Gearbox], + }, + }, }, '0x133d241f225750d2c92948e464a5a80111920331000000000000000000000476': { name: 'Euler Boosted USD/DOLA', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Euler], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Euler], + }, + }, }, '0x483006684f422a9448023b2382615c57c5ecf18f000000000000000000000488': { name: 'Euler Boosted USD/TUSD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Euler], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Euler], + }, + }, }, '0xb5e3de837f869b0248825e0175da73d4e8c3db6b000200000000000000000474': { name: 'Euler Boosted USD/rETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Euler], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Euler], + }, + }, }, '0xa718042e5622099e5f0ace4e7122058ab39e1bbe000200000000000000000475': { name: 'Euler Boosted USD/TEMPLE', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Euler], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Euler], + }, + }, }, '0x4fd4687ec38220f805b6363c3c1e52d0df3b5023000200000000000000000473': { name: 'Euler Boosted USD/wstETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Euler], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Euler], + }, + }, }, '0x779d01f939d78a918a3de18cc236ee89221dfd4e0000000000000000000004c7': { name: 'Balancer Boosted Sturdy USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Sturdy], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Sturdy], + }, + }, }, '0xcaa052584b462198a5a9356c28bce0634d65f65c0000000000000000000004db': { name: 'Balancer Boosted Morpho-Aave USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Morpho, BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Morpho, Protocol.Aave], + }, + }, }, '0xfebb0bbf162e64fb9d0dfe186e517d84c395f016000000000000000000000502': { name: 'Balancer Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xe0fcbf4d98f0ad982db260f86cf28b49845403c5000000000000000000000504': { name: 'wstETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x639883476960a23b38579acfd7d71561a0f408cf000200000000000000000505': { name: 'STG/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x04248aabca09e9a1a3d5129a7ba05b7f17de768400000000000000000000050e': { name: 'qETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x02d928e68d8f10c0358566152677db51e1e2dc8c00000000000000000000051e': { name: 'swETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xf57c794f42da72b38c8f610ff3b5e8502e48cbde00000000000000000000055c': { name: 'DOLA/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x9001cbbd96f54a658ff4e6e65ab564ded76a543100000000000000000000050a': { name: 'cbETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x481c5fc05d63a58aa2f0f2aa417c021b5d419cb200000000000000000000056a': { name: 'rETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xd7edb56f63b2a0191742aea32df1f98ca81ed9c600000000000000000000058e': { name: 'wstETH/Boosted Morpho Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Morpho], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Morpho], + }, + }, }, '0x4cbde5c4b4b53ebe4af4adb85404725985406163000000000000000000000595': { name: 'ETHx/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xc443c15033fcb6cf72cc24f1bda0db070ddd9786000000000000000000000593': { name: 'Balancer Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x41503c9d499ddbd1dcdf818a1b05e9774203bf46000000000000000000000594': { name: 'wstETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xc2b021133d1b0cf07dba696fd5dd89338428225b000000000000000000000598': { name: 'GHO/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xe2d16b0a39f3fbb4389a0e8f1efcbecfb3d1e6e10000000000000000000005a7': { name: 'DUSD/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, }, Deep: [ diff --git a/src/lib/config/polygon/pools.ts b/src/lib/config/polygon/pools.ts index eb0984b04e..a7412f18b8 100644 --- a/src/lib/config/polygon/pools.ts +++ b/src/lib/config/polygon/pools.ts @@ -1,5 +1,5 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { PoolWarning, Pools } from '@/types/pools'; +import { Protocol } from '@/composables/useProtocols'; +import { PoolFeature, PoolWarning, Pools } from '@/types/pools'; const pools: Pools = { IdsMap: { @@ -221,92 +221,137 @@ const pools: Pools = { '0x48e6b98ef6329f8f0a30ebb8c7c960330d64808500000000000000000000075b': { name: 'Balancer Boosted Aave USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xb3d658d5b95bf04e2932370dd1ff976fe18dd66a000000000000000000000ace': { name: 'Balancer Boosted Tetu USD', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Tetu], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Tetu], + }, + }, }, '0x71bd10c2a590b5858f5576550c163976a48af906000000000000000000000b27': { name: 'Balancer Boosted Tetu MATIC', hasIcon: true, - boosted: true, - boostedProtocols: [BoostedProtocol.Tetu], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Tetu], + }, + }, }, '0x216690738aac4aa0c4770253ca26a28f0115c595000000000000000000000b2c': { name: 'stMATIC/Boosted Aave v3 WMATIC', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xe78b25c06db117fdf8f98583cdaaa6c92b79e917000000000000000000000b2b': { name: 'maticX/Boosted Aave v3 WMATIC', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x4a77ef015ddcd972fd9ba2c7d5d658689d090f1a000000000000000000000b38': { name: 'wstETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xd00f9ca46ce0e4a63067c4657986f0167b0de1e5000000000000000000000b42': { name: 'frxETH/Boosted Aave v3 WETH', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x8fbd0f8e490735cfc3abf4f29cbddd5c3289b9a7000000000000000000000b5b': { name: 'FRAX/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xb371aa09f5a110ab69b39a84b5469d29f9b22b76000000000000000000000b37': { name: 'Balancer Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x8fd39252d683fdb60bddd4df4b53c9380b496d59000200000000000000000b45': { name: 'wstETH/Boosted Aave v3 WETH/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x7f4f4942f2a14b6ab7b08b10ada1aacede4ee8d4000200000000000000000b44': { name: 'stMATIC/Boosted Aave v3 wMATIC/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x3efb91c4f9b103ee45885695c67794591916f34e000200000000000000000b43': { name: '2BRL/Boosted Aave v3 USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xac2cae8d2f78a4a8f92f20dbe74042cd0a8d5af3000000000000000000000be2': { name: 'stMATIC/Boosted Aave v3 WMATIC', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0x402cfdb7781fa85d52f425352661128250b79e12000000000000000000000be3': { name: 'maticX/Boosted Aave v3 WMATIC', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, '0xb266ac3b7c98d7bcb28731dac0ef42dba1b276be000000000000000000000be4': { name: 'truMATIC/Boosted Aave v3 WMATIC', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Aave], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Aave], + }, + }, }, }, Deep: [ diff --git a/src/lib/config/zkevm/pools.ts b/src/lib/config/zkevm/pools.ts index 8606fb730a..4b17a9ff54 100644 --- a/src/lib/config/zkevm/pools.ts +++ b/src/lib/config/zkevm/pools.ts @@ -1,5 +1,5 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; -import { Pools, RiskKey } from '@/types/pools'; +import { Protocol } from '@/composables/useProtocols'; +import { PoolFeature, Pools, RiskKey } from '@/types/pools'; const pools: Pools = { IdsMap: {}, @@ -78,25 +78,33 @@ const pools: Pools = { '0xe274c9deb6ed34cfe4130f8d0a8a948dea5bb28600000000000000000000000d': { name: 'Balancer Boosted 0vix USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Zerovix], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Zerovix], + }, + }, }, '0x68a69c596b3839023c0e08d09682314f582314e5000200000000000000000011': { name: 'wstETH/weth/Boosted 0vix USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Zerovix], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Zerovix], + }, + }, }, '0x9e2d87f904862671eb49cb358e74284762cc9f42000200000000000000000013': { name: 'wstETH/Boosted 0vix USD', hasIcon: false, - boosted: false, }, '0x6f34a44fce1506352a171232163e7716dd073ade000200000000000000000015': { name: 'rETH/Boosted 0vix USD', hasIcon: false, - boosted: true, - boostedProtocols: [BoostedProtocol.Zerovix], + features: { + [PoolFeature.Boosted]: { + featureProtocols: [Protocol.Zerovix], + }, + }, }, }, Deep: [ diff --git a/src/locales/default.json b/src/locales/default.json index db3d1208b3..178516cb2e 100644 --- a/src/locales/default.json +++ b/src/locales/default.json @@ -112,6 +112,7 @@ "builtOnBalancer": "Built on Balancer protocol", "boosted": "Boosted", "boostedTooltip": "This pool has a Boosted Pool component. In addition to accumulating swap fees, Boosted pools also generate yield for LPs by lending excess liquidity to other yield generating DeFi protocols.", + "clpTooltip": "Designed for capital efficiency, ‘Concentrated Liquidity Pools’ (CLPs) are a class of AMMs that price the exchange of assets within a defined range. As such, any CLP only provides liquidity for trading activity restricted to this specific region.", "buy": "Buy", "build": "Build", "blog": "Blog", diff --git a/src/types/pools.ts b/src/types/pools.ts index 20278a3f98..d78281bfee 100644 --- a/src/types/pools.ts +++ b/src/types/pools.ts @@ -1,4 +1,4 @@ -import { BoostedProtocol } from '@/composables/useBoostedPool'; +import { Protocol } from '@/composables/useProtocols'; export type FactoryType = | 'oracleWeightedPool' @@ -13,11 +13,21 @@ export type FactoryType = | 'gyroE' | 'erc4626Linear'; +export enum PoolFeature { + Boosted = 'boosted', + CLP = 'clp', +} + +export type PoolFeatures = { + [key in PoolFeature]?: { + featureProtocols?: Protocol[]; + }; +}; + export type PoolMetadata = { name?: string; hasIcon?: boolean; - boosted?: boolean; - boostedProtocols?: BoostedProtocol[]; + features?: PoolFeatures; }; export enum RiskKey { @@ -37,7 +47,7 @@ export enum RiskKey { Weighted = 'weighted-pools', Stable = 'stable-pools', ComposableStable = 'composable-pools', - MetaStable = 'composable-pools', + MetaStable = 'meta-stable-pools', Boosted = 'boosted-pools', Arbitrum = 'arbitrum', Polygon = 'polygon',