@merkl/api 0.20.32 → 0.20.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/src/eden/index.d.ts +73 -13
  2. package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.d.ts +4 -0
  3. package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +1 -0
  4. package/dist/src/engine/erc20SubTypeProcessors/helpers/spliceTVL.d.ts +1 -0
  5. package/dist/src/engine/erc20SubTypeProcessors/helpers/spliceTVL.js +2 -0
  6. package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.js +1 -0
  7. package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.js +1 -0
  8. package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.js +1 -0
  9. package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.js +3 -0
  10. package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +3 -0
  11. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.js +3 -0
  12. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.js +7 -1
  13. package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.js +7 -1
  14. package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.js +4 -0
  15. package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.js +4 -0
  16. package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.js +1 -0
  17. package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.js +1 -0
  18. package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.js +1 -0
  19. package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.js +1 -0
  20. package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.js +1 -0
  21. package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +1 -0
  22. package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.js +1 -0
  23. package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.js +1 -0
  24. package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.js +4 -0
  25. package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.js +1 -0
  26. package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.js +5 -0
  27. package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +1 -1
  28. package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.js +3 -2
  29. package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.js +1 -0
  30. package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +16 -16
  31. package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.js +27 -23
  32. package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.js +1 -0
  33. package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +1 -0
  34. package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.js +1 -0
  35. package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.js +1 -0
  36. package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.js +1 -0
  37. package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.js +4 -0
  38. package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.js +1 -0
  39. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.js +1 -0
  40. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.js +1 -0
  41. package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.js +2 -1
  42. package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.js +1 -0
  43. package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +4 -0
  44. package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.js +2 -1
  45. package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.js +4 -0
  46. package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.js +1 -0
  47. package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.js +1 -0
  48. package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.js +5 -0
  49. package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.js +3 -0
  50. package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.js +11 -0
  51. package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +11 -0
  52. package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.js +1 -0
  53. package/dist/src/engine/opportunityMetadata/implementations/Clamm.js +6 -7
  54. package/dist/src/engine/opportunityMetadata/implementations/Erc20.d.ts +2 -2
  55. package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +14 -37
  56. package/dist/src/engine/opportunityMetadata/implementations/Euler.d.ts +1 -1
  57. package/dist/src/engine/opportunityMetadata/implementations/Euler.js +3 -2
  58. package/dist/src/engine/opportunityMetadata/implementations/UniswapV4.d.ts +1 -1
  59. package/dist/src/engine/opportunityMetadata/implementations/UniswapV4.js +2 -4
  60. package/dist/src/index.d.ts +13 -1
  61. package/dist/src/modules/v4/campaign/campaign.controller.js +1 -1
  62. package/dist/src/modules/v4/chain/chain.controller.d.ts +2 -0
  63. package/dist/src/modules/v4/chain/chain.model.d.ts +1 -0
  64. package/dist/src/modules/v4/chain/chain.model.js +1 -0
  65. package/dist/src/modules/v4/chain/chain.repository.d.ts +11 -0
  66. package/dist/src/modules/v4/chain/chain.repository.js +4 -1
  67. package/dist/src/modules/v4/chain/chain.service.js +1 -1
  68. package/dist/src/modules/v4/programPayload/programPayload.repository.js +3 -3
  69. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +11 -1
  70. package/dist/src/modules/v4/protocol/protocol.controller.js +2 -1
  71. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -0
  72. package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
  73. package/dist/src/modules/v4/protocol/protocol.repository.js +33 -28
  74. package/dist/src/modules/v4/protocol/protocol.service.js +12 -8
  75. package/dist/src/modules/v4/router.d.ts +13 -1
  76. package/dist/src/utils/generateCardName.d.ts +1 -1
  77. package/dist/src/utils/generateCardName.js +3 -15
  78. package/dist/src/utils/sanitizeChain.d.ts +2 -0
  79. package/dist/src/utils/sanitizeChain.js +6 -0
  80. package/dist/tsconfig.package.tsbuildinfo +1 -1
  81. package/package.json +1 -1
@@ -10,31 +10,31 @@ type callType = {
10
10
  };
11
11
  type callKeysMaverickBP = mandatoryCallKeys & {
12
12
  boostedPositionInformation: string;
13
- tokenA: string;
14
- tokenB: string;
13
+ token0: string;
14
+ token1: string;
15
15
  lensAddress: string;
16
16
  };
17
17
  type dataRawMaverickBP = callKeysMaverickBP & {
18
- amountA: string;
19
- amountB: string;
20
- decimalsTokenA: string;
21
- decimalsTokenB: string;
18
+ amount0: string;
19
+ amount1: string;
20
+ decimalsToken0: string;
21
+ decimalsToken1: string;
22
22
  bpInfoReturnData: {
23
23
  [key: string]: string | number;
24
24
  };
25
- symbolTokenA: string;
26
- symbolTokenB: string;
25
+ symbolToken0: string;
26
+ symbolToken1: string;
27
27
  };
28
28
  type dataTypeMaverickBP = dataType & {
29
- amountA: number;
30
- amountB: number;
31
- decimalsTokenA: number;
32
- decimalsTokenB: number;
29
+ amount0: number;
30
+ amount1: number;
31
+ decimalsToken0: number;
32
+ decimalsToken1: number;
33
33
  lensAddress: string;
34
- symbolTokenA: string;
35
- symbolTokenB: string;
36
- tokenA: string;
37
- tokenB: string;
34
+ symbolToken0: string;
35
+ symbolToken1: string;
36
+ token0: string;
37
+ token1: string;
38
38
  };
39
39
  export declare class MaverickBPProcessor extends GenericProcessor<callKeysMaverickBP, dataRawMaverickBP, dataTypeMaverickBP> {
40
40
  rounds: {
@@ -14,24 +14,24 @@ export class MaverickBPProcessor extends GenericProcessor {
14
14
  ],
15
15
  round2: [
16
16
  {
17
- key: "symbolTokenA",
17
+ key: "symbolToken0",
18
18
  call: "symbol",
19
- target: "tokenA",
19
+ target: "token0",
20
20
  },
21
21
  {
22
- key: "symbolTokenB",
22
+ key: "symbolToken1",
23
23
  call: "symbol",
24
- target: "tokenB",
24
+ target: "token1",
25
25
  },
26
26
  {
27
- key: "decimalsTokenA",
27
+ key: "decimalsToken0",
28
28
  call: "decimals",
29
- target: "tokenA",
29
+ target: "token0",
30
30
  },
31
31
  {
32
- key: "decimalsTokenB",
32
+ key: "decimalsToken1",
33
33
  call: "decimals",
34
- target: "tokenB",
34
+ target: "token1",
35
35
  },
36
36
  ],
37
37
  round3: [],
@@ -41,34 +41,38 @@ export class MaverickBPProcessor extends GenericProcessor {
41
41
  typeInfo.lensAddress = MAVERICK_ZKSYNC_BP_LENS_ADDRESS;
42
42
  }
43
43
  processingRound2(typeInfo) {
44
- typeInfo.tokenA = typeInfo.bpInfoReturnData.tokenA;
45
- typeInfo.tokenB = typeInfo.bpInfoReturnData.tokenB;
46
- typeInfo.amountA = typeInfo.bpInfoReturnData.amountA.toString();
47
- typeInfo.amountB = typeInfo.bpInfoReturnData.amountB.toString();
44
+ typeInfo.token0 = typeInfo.bpInfoReturnData.tokenA;
45
+ typeInfo.token1 = typeInfo.bpInfoReturnData.tokenB;
46
+ typeInfo.amount0 = typeInfo.bpInfoReturnData.amountA.toString();
47
+ typeInfo.amount1 = typeInfo.bpInfoReturnData.amountB.toString();
48
48
  }
49
49
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
50
50
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
51
- const decimalsTokenA = Number(typeInfo.decimalsTokenA);
52
- const decimalsTokenB = Number(typeInfo.decimalsTokenB);
53
- const amountA = BN2Number(typeInfo.amountA, 18);
54
- const amountB = BN2Number(typeInfo.amountB, 18);
55
- const tokenAPRice = (await pricer.get({ symbol: typeInfo.symbolTokenA })) ?? 0;
56
- const tokenBPrice = (await pricer.get({ symbol: typeInfo.symbolTokenB })) ?? 0;
57
- const tvl = tokenAPRice * amountA + tokenBPrice * amountB;
51
+ const decimalsToken0 = Number(typeInfo.decimalsToken0);
52
+ const decimalsToken1 = Number(typeInfo.decimalsToken1);
53
+ const amount0 = BN2Number(typeInfo.amount0, 18);
54
+ const amount1 = BN2Number(typeInfo.amount1, 18);
55
+ const token0PRice = (await pricer.get({ symbol: typeInfo.symbolToken0 })) ?? 0;
56
+ const token1Price = (await pricer.get({ symbol: typeInfo.symbolToken1 })) ?? 0;
57
+ const tvl = token0PRice * amount0 + token1Price * amount1;
58
58
  const priceTargetToken = tvl / totalSupply;
59
59
  const { bpInfoReturnData, ...rest } = typeInfo;
60
60
  return {
61
61
  ...rest,
62
62
  blacklistedSupply,
63
- amountA,
64
- amountB,
65
- decimalsTokenA,
66
- decimalsTokenB,
63
+ amount0,
64
+ amount1,
65
+ decimalsToken0,
66
+ decimalsToken1,
67
67
  cardName: generateCardName(type, typeInfo, campaign),
68
68
  priceTargetToken: priceTargetToken,
69
69
  totalSupply,
70
70
  tvl,
71
71
  whitelistedSupplyTargetToken,
72
+ tokensDisplay: [
73
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0 },
74
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1 },
75
+ ],
72
76
  };
73
77
  }
74
78
  }
@@ -25,6 +25,7 @@ export class MetamorphoProcessor extends GenericProcessor {
25
25
  blacklistedSupply,
26
26
  priceTargetToken: underlyingTokenPrice,
27
27
  cardName: generateCardName(type, typeInfo, campaign),
28
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
28
29
  };
29
30
  }
30
31
  computeRound3(index, type, typeInfo, calls) {
@@ -61,6 +61,7 @@ export class NoLinkVaultProcessor extends GenericProcessor {
61
61
  tvl,
62
62
  blacklistedSupply,
63
63
  cardName: generateCardName(type, typeInfo, campaign),
64
+ tokensDisplay: [{ symbol: typeInfo.baseSymbol, address: typeInfo.base }],
64
65
  };
65
66
  }
66
67
  computeRound1(type, typeInfo) {
@@ -24,6 +24,7 @@ export class PendleProcessor extends GenericProcessor {
24
24
  priceTargetToken: priceTargetToken,
25
25
  cardName: generateCardName(type, typeInfo, campaign),
26
26
  blacklistedSupply,
27
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
27
28
  };
28
29
  }
29
30
  }
@@ -24,6 +24,7 @@ export class PendleYTProcessor extends GenericProcessor {
24
24
  priceTargetToken: priceTargetToken,
25
25
  cardName: generateCardName(type, typeInfo, campaign),
26
26
  blacklistedSupply,
27
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
27
28
  };
28
29
  }
29
30
  }
@@ -36,6 +36,7 @@ export class RadiantProcessor extends GenericProcessor {
36
36
  tvl,
37
37
  cardName: generateCardName(type, typeInfo, campaign),
38
38
  symbolUnderlyingToken: finalSymbol,
39
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlyingToken }],
39
40
  };
40
41
  }
41
42
  computeRound3(index, type, typeInfo, calls) {
@@ -62,6 +62,10 @@ export class RfxProcessor extends GenericProcessor {
62
62
  tvl,
63
63
  symbolShortToken: typeInfo.symbolShortToken,
64
64
  symbolLongToken: typeInfo.symbolLongToken,
65
+ tokensDisplay: [
66
+ { symbol: typeInfo.symbolShortToken, address: typeInfo.shortToken },
67
+ { symbol: typeInfo.symbolLongToken, address: typeInfo.longToken },
68
+ ],
65
69
  };
66
70
  }
67
71
  }
@@ -22,6 +22,7 @@ export class SatlayerProcessor extends GenericProcessor {
22
22
  cardName: generateCardName(type, typeInfo, campaign),
23
23
  blacklistedSupply,
24
24
  totalSupply,
25
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
25
26
  };
26
27
  }
27
28
  }
@@ -36,6 +36,7 @@ export class SpectraProcessor extends GenericProcessor {
36
36
  blacklistedSupply,
37
37
  priceTargetToken,
38
38
  cardName: generateCardName(type, typeInfo, campaign),
39
+ tokensDisplay: [{ address: poolData.lpt.address }],
39
40
  };
40
41
  }
41
42
  }
@@ -34,6 +34,7 @@ export class SpectraYTProcessor extends GenericProcessor {
34
34
  blacklistedSupply,
35
35
  priceTargetToken,
36
36
  cardName: generateCardName(type, typeInfo, campaign),
37
+ tokensDisplay: [{ address: poolData.yt.address }],
37
38
  };
38
39
  }
39
40
  }
@@ -4,7 +4,7 @@ export class SpliceProcessor extends GenericProcessor {
4
4
  // override computeRound1(): void {}
5
5
  async processingRound5(_index, _type, typeInfo, _calls, campaign, _pricer) {
6
6
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
7
- const { symbolUnderlyingToken, priceTargetToken, tvl } = await fetchSpliceInformation(campaign.campaignParameters.targetToken);
7
+ const { symbolUnderlyingToken, address, priceTargetToken, tvl } = await fetchSpliceInformation(campaign.campaignParameters.targetToken);
8
8
  return {
9
9
  ...typeInfo,
10
10
  totalSupply,
@@ -14,6 +14,7 @@ export class SpliceProcessor extends GenericProcessor {
14
14
  blacklistedSupply,
15
15
  cardName: `Supply ${symbolUnderlyingToken} on Splice`,
16
16
  tokenAddress: typeInfo.tokenAddress,
17
+ tokensDisplay: [{ symbol: symbolUnderlyingToken, address: address }],
17
18
  };
18
19
  }
19
20
  computeRound3(index, type, typeInfo, calls) {
@@ -32,6 +32,7 @@ export class SturdySiloProcessor extends GenericProcessor {
32
32
  sharePrice,
33
33
  priceTargetToken,
34
34
  cardName: generateCardName(type, typeInfo, campaign),
35
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
35
36
  };
36
37
  }
37
38
  }
@@ -74,6 +74,10 @@ export class TempestVaultProcessor extends GenericProcessor {
74
74
  totalSupply,
75
75
  tvl,
76
76
  whitelistedSupplyTargetToken,
77
+ tokensDisplay: [
78
+ { symbol: typeInfo.symbolToken0, address: typeInfo.addressToken0 },
79
+ { symbol: typeInfo.symbolToken1, address: typeInfo.addressToken1 },
80
+ ],
77
81
  };
78
82
  }
79
83
  }
@@ -16,7 +16,7 @@ export class TorosProcessor extends GenericProcessor {
16
16
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
17
17
  const priceTargetToken = BN2Number(typeInfo.tokenPrice, 18);
18
18
  const tvl = priceTargetToken * totalSupply;
19
- let symbolUnderlyingToken = "unknow";
19
+ let symbolUnderlyingToken = "unknown";
20
20
  const match = typeInfo.name.match(/\b[A-Z]+\b/g);
21
21
  symbolUnderlyingToken = match ? match[0] : "unknown";
22
22
  return {
@@ -28,6 +28,7 @@ export class TorosProcessor extends GenericProcessor {
28
28
  priceTargetToken,
29
29
  symbolUnderlyingToken,
30
30
  cardName: generateCardName(type, typeInfo, campaign),
31
+ tokensDisplay: [{ symbol: symbolUnderlyingToken, address: typeInfo.tokenAddress }],
31
32
  };
32
33
  }
33
34
  }
@@ -63,6 +63,10 @@ export class UniswapProcessor extends GenericProcessor {
63
63
  decimalsToken1,
64
64
  balanceToken0,
65
65
  balanceToken1,
66
+ tokensDisplay: [
67
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0 },
68
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1 },
69
+ ],
66
70
  };
67
71
  }
68
72
  }
@@ -30,6 +30,7 @@ export class VicunaProcessor extends GenericProcessor {
30
30
  blacklistedSupply,
31
31
  priceTargetToken,
32
32
  cardName: generateCardName(type, typeInfo, campaign),
33
+ tokensDisplay: [{ symbol: campaign.campaignParameters.symbolTargetToken, address: typeInfo.tokenAddress }],
33
34
  };
34
35
  }
35
36
  }
@@ -35,6 +35,7 @@ export class WoofiProcessor extends GenericProcessor {
35
35
  cardName: generateCardName(type, typeInfo, campaign),
36
36
  pricePerShare,
37
37
  tvl,
38
+ tokensDisplay: [{ symbol: typeInfo.symbolUnderlyingToken, address: typeInfo.underlying }],
38
39
  };
39
40
  }
40
41
  }
@@ -50,6 +50,11 @@ export class ZkSwapThreePoolProcessor extends GenericProcessor {
50
50
  totalSupply,
51
51
  tvl,
52
52
  whitelistedSupplyTargetToken,
53
+ tokensDisplay: [
54
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0Address },
55
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1Address },
56
+ { symbol: typeInfo.symbolToken2, address: typeInfo.token2Address },
57
+ ],
53
58
  };
54
59
  }
55
60
  }
@@ -60,6 +60,7 @@ export class CurveNPoolProcessor extends GenericProcessor {
60
60
  hardcodedSymbol = "ETH";
61
61
  if (typeInfo.name.includes("STABLE"))
62
62
  hardcodedSymbol = "USDC";
63
+ const tokensDisplay = [];
63
64
  for (let i = 0; i < typeInfo.numberTokens; i++) {
64
65
  const symbol = typeInfo[`symbolToken${i}`];
65
66
  let price = (await pricer.get({ symbol: symbol })) ?? 0;
@@ -71,6 +72,7 @@ export class CurveNPoolProcessor extends GenericProcessor {
71
72
  price = (await pricer.get({ symbol: hardcodedSymbol })) ?? 0;
72
73
  }
73
74
  }
75
+ tokensDisplay.push({ symbol: symbol, address: typeInfo[`token${i}`] });
74
76
  const decimals = Number(typeInfo[`decimalsToken${i}`]);
75
77
  const amount = BN2Number(typeInfo[`balanceToken${i}`], decimals);
76
78
  tvl += amount * price;
@@ -90,6 +92,7 @@ export class CurveNPoolProcessor extends GenericProcessor {
90
92
  blacklistedSupply,
91
93
  priceTargetToken,
92
94
  cardName: generateCardName(type, typeInfo, campaign),
95
+ tokensDisplay,
93
96
  };
94
97
  }
95
98
  }
@@ -23,6 +23,7 @@ export class CurveProcessor extends GenericProcessor {
23
23
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
24
24
  const lp_price = BN2Number(typeInfo.lp_price, 18);
25
25
  let priceTargetToken = lp_price;
26
+ let tokensDisplay = [];
26
27
  if (typeInfo.token2) {
27
28
  typeInfo.poolTokens = {
28
29
  [typeInfo.token0]: typeInfo.symbolToken0,
@@ -30,6 +31,11 @@ export class CurveProcessor extends GenericProcessor {
30
31
  [typeInfo.token2]: typeInfo.symbolToken2,
31
32
  };
32
33
  typeInfo.numberTokens = 3;
34
+ tokensDisplay = [
35
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0 },
36
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1 },
37
+ { symbol: typeInfo.symbolToken2, address: typeInfo.token2 },
38
+ ];
33
39
  }
34
40
  else {
35
41
  typeInfo.poolTokens = {
@@ -37,6 +43,10 @@ export class CurveProcessor extends GenericProcessor {
37
43
  [typeInfo.token1]: typeInfo.symbolToken1,
38
44
  };
39
45
  typeInfo.numberTokens = 2;
46
+ tokensDisplay = [
47
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0 },
48
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1 },
49
+ ];
40
50
  }
41
51
  if (type === tokenType.curve_2) {
42
52
  const prices = [];
@@ -65,6 +75,7 @@ export class CurveProcessor extends GenericProcessor {
65
75
  blacklistedSupply,
66
76
  priceTargetToken,
67
77
  cardName: generateCardName(type, typeInfo, campaign),
78
+ tokensDisplay,
68
79
  };
69
80
  }
70
81
  }
@@ -31,18 +31,28 @@ export class StakedCurveProcessor extends GenericProcessor {
31
31
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
32
32
  const lp_price = BN2Number(typeInfo.lp_price, 18);
33
33
  let priceTargetToken = lp_price;
34
+ let tokensDisplay = [];
34
35
  if (typeInfo.token2) {
35
36
  typeInfo.poolTokens = {
36
37
  [typeInfo.token0]: typeInfo.symbolToken0,
37
38
  [typeInfo.token1]: typeInfo.symbolToken1,
38
39
  [typeInfo.token2]: typeInfo.symbolToken2,
39
40
  };
41
+ tokensDisplay = [
42
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0 },
43
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1 },
44
+ { symbol: typeInfo.symbolToken2, address: typeInfo.token2 },
45
+ ];
40
46
  }
41
47
  else {
42
48
  typeInfo.poolTokens = {
43
49
  [typeInfo.token0]: typeInfo.symbolToken0,
44
50
  [typeInfo.token1]: typeInfo.symbolToken1,
45
51
  };
52
+ tokensDisplay = [
53
+ { symbol: typeInfo.symbolToken0, address: typeInfo.token0 },
54
+ { symbol: typeInfo.symbolToken1, address: typeInfo.token1 },
55
+ ];
46
56
  }
47
57
  if (type === tokenType.curve_2) {
48
58
  const prices = [];
@@ -72,6 +82,7 @@ export class StakedCurveProcessor extends GenericProcessor {
72
82
  blacklistedSupply,
73
83
  priceTargetToken,
74
84
  cardName: generateCardName(type, typeInfo, campaign),
85
+ tokensDisplay,
75
86
  };
76
87
  }
77
88
  }
@@ -44,6 +44,7 @@ export class xU308Processor extends GenericProcessor {
44
44
  priceTargetToken,
45
45
  totalSupply,
46
46
  cardName: generateCardName(type, typeInfo, campaign),
47
+ tokensDisplay: [{ symbol: campaign.campaignParameters.symbolTargetToken, address: typeInfo.tokenAddress }],
47
48
  };
48
49
  }
49
50
  }
@@ -2,8 +2,9 @@ import { protocolIdList } from "@/modules/v4/protocol/protocol.model";
2
2
  import { ProtocolService } from "@/modules/v4/protocol/protocol.service";
3
3
  import { camelToKebabCase } from "@/utils/caseChanges";
4
4
  import { log } from "@/utils/logger";
5
+ import { sanitizeChainName } from "@/utils/sanitizeChain";
5
6
  import { OpportunityAction } from "@db/api";
6
- import { AMM, ChainId, NETWORK_LABELS, almName, ammName, } from "@sdk";
7
+ import { AMM, ChainId, almName, ammName, } from "@sdk";
7
8
  import { getAddress } from "viem";
8
9
  export const uniswapV3OkuChains = {
9
10
  [ChainId.BLAST]: "blast",
@@ -110,20 +111,18 @@ export class ClammMetadata {
110
111
  };
111
112
  }
112
113
  static generateUrl(computeChainId, params) {
113
- const sanitizeChain = (computeChain) => NETWORK_LABELS[computeChain]?.toLowerCase().replaceAll(" ", "");
114
114
  const sanitizeFee = (poolFee) => Number(poolFee) * 10000;
115
115
  const ammLinkMap = {
116
116
  UniswapV3: ({ poolAddress }) => {
117
117
  const availableOnOku = Object.keys(uniswapV3OkuChains).includes(computeChainId?.toString());
118
118
  if (availableOnOku)
119
119
  return `https://oku.trade/app/${uniswapV3OkuChains[computeChainId]}/liquidity/${params.poolAddress} `;
120
- const chainLabel = computeChainId === ChainId.MAINNET ? "ethereum/" : `${sanitizeChain(computeChainId)}/`;
121
- return `https://app.uniswap.org/explore/pools/${chainLabel}${poolAddress?.toLowerCase()}`;
120
+ return `https://app.uniswap.org/explore/pools/${sanitizeChainName(computeChainId)}/${poolAddress?.toLowerCase()}`;
122
121
  },
123
122
  //Pool address mappings
124
123
  Sonex: ({ poolAddress }) => `https://app.sonex.so/explore/pools/${poolAddress}`,
125
124
  KYO: ({ poolAddress }) => `https://app.kyo.finance/liquidity/${poolAddress}`,
126
- SushiSwapV3: ({ poolAddress }) => `https://www.sushi.com/${sushiswapv3Chains[computeChainId] ?? sanitizeChain(computeChainId)}/pool/v3/${poolAddress}`,
125
+ SushiSwapV3: ({ poolAddress }) => `https://www.sushi.com/${sushiswapv3Chains[computeChainId] ?? sanitizeChainName(computeChainId)}/pool/v3/${poolAddress}`,
127
126
  Swapr: ({ poolAddress }) => `https://v3.swapr.eth.limo/#/info/pools/${poolAddress}`,
128
127
  Crust: ({ poolAddress }) => `https://v1.crust.finance/liquidity/${poolAddress}`,
129
128
  ThirdTrade: ({ poolAddress }) => `https://third.trade/pool/${poolAddress}`,
@@ -139,12 +138,12 @@ export class ClammMetadata {
139
138
  zkSwap: ({ token0, token1 }) => `https://www.zkswap.finance/add/${token0}/${token1}/2000?chain=${computeChainId}`,
140
139
  Velodrome: ({ token0, token1 }) => `https://velodrome.finance/pools?token0=${token0}&token1=${token1}&type=1&chain=${computeChainId}`,
141
140
  //Token address and pool fess
142
- PancakeSwapV3: ({ token0, token1, poolFee }) => `https://pancakeswap.finance/add/${token0}/${token1}/${sanitizeFee(poolFee)}?chain=${pancakeswapChains[computeChainId] ?? sanitizeChain(computeChainId)}`,
141
+ PancakeSwapV3: ({ token0, token1, poolFee }) => `https://pancakeswap.finance/add/${token0}/${token1}/${sanitizeFee(poolFee)}?chain=${pancakeswapChains[computeChainId] ?? sanitizeChainName(computeChainId)}`,
143
142
  BaseSwap: ({ token0, token1, poolFee }) => `https://${computeChainId === ChainId.MODE ? "swapmode" : "baseswap"}.fi/addV3?currencyIdA=${token0}&currencyIdB=${token1}&feeAmount=${sanitizeFee(poolFee)}`,
144
143
  Voltage: ({ token0, token1, poolFee }) => `https://app.voltage.finance/add/${token0}/${token1}?version=v3&feeAmount=${sanitizeFee(poolFee)}`,
145
144
  Izumi: ({ token0, token1, poolFee }) => `https://${computeChainId === ChainId.ROOTSTOCK ? "woodswap.org" : "izumi.finance"}/trade/add-liquidity/?token0=${token0}&token1=${token1}&chainId=${computeChainId}&fee=${Number(poolFee) * 10000}`,
146
145
  SupswapV3: ({ token0, token1, poolFee }) => `https://supswap.xyz/add/${token0}/${token1}/${sanitizeFee(poolFee)}`,
147
- Iguana: ({ token0, token1, poolFee }) => `https://www.iguanadex.com/add/${token0}/${token1}/${sanitizeFee(poolFee)}?chain=${sanitizeChain(computeChainId)}`,
146
+ Iguana: ({ token0, token1, poolFee }) => `https://www.iguanadex.com/add/${token0}/${token1}/${sanitizeFee(poolFee)}?chain=${sanitizeChainName(computeChainId)}`,
148
147
  //Token symbols
149
148
  Stryke: ({ symbolToken0, symbolToken1 }) => `https://www.stryke.xyz/en/trade/arbitrum/${symbolToken0}-${symbolToken1}`,
150
149
  StrykePCS: ({ symbolToken0, symbolToken1 }) => `https://pancakeswap.stryke.xyz/${symbolToken0}-${symbolToken1}?mode=LP`,
@@ -1,4 +1,4 @@
1
- import { Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
1
+ import { type CampaignDynamicData, Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
2
2
  import type { MetadataBuilder } from "../interface";
3
3
  type campaignType = CampaignEnum.ERC20;
4
4
  export declare class Erc20Metadata implements MetadataBuilder<campaignType> {
@@ -13,6 +13,6 @@ export declare class Erc20Metadata implements MetadataBuilder<campaignType> {
13
13
  depositUrl: any;
14
14
  explorerAddress: `0x${string}`;
15
15
  }>;
16
- static generateUrl(_computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"]): any;
16
+ static generateUrl(_computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"], dynamicData: CampaignDynamicData<campaignType>): any;
17
17
  }
18
18
  export {};
@@ -1,6 +1,6 @@
1
1
  import { dynamicDataBuilderFactory } from "@/engine/dynamicData/factory";
2
2
  import { log } from "@/utils/logger";
3
- import { Campaign as CampaignEnum } from "@sdk";
3
+ import { Campaign as CampaignEnum, } from "@sdk";
4
4
  import { getAddress } from "viem";
5
5
  import { ProtocolService } from "../../../modules/v4/protocol/protocol.service";
6
6
  export class Erc20Metadata {
@@ -8,7 +8,8 @@ export class Erc20Metadata {
8
8
  let action = "HOLD";
9
9
  let name = `Hold ${params.symbolTargetToken}`;
10
10
  let mainProtocolId = undefined;
11
- const tokens = [{ chainId: computeChainId, address: params.targetToken }];
11
+ let depositUrl = params.url;
12
+ let tokens = [{ chainId: computeChainId, address: params.targetToken }];
12
13
  try {
13
14
  const [dynamicData] = await dynamicDataBuilderFactory(CampaignEnum.ERC20).build(computeChainId, [
14
15
  {
@@ -20,6 +21,10 @@ export class Erc20Metadata {
20
21
  campaignParameters: params,
21
22
  },
22
23
  ]);
24
+ tokens = dynamicData?.typeInfo?.tokensDisplay?.map((token) => ({
25
+ chainId: computeChainId,
26
+ address: token.address,
27
+ }));
23
28
  action = dynamicData?.typeInfo?.action ?? action;
24
29
  name = dynamicData?.typeInfo?.cardName;
25
30
  mainProtocolId = dynamicData?.typeInfo?.protocol?.toLowerCase().replace(" ", "");
@@ -27,39 +32,7 @@ export class Erc20Metadata {
27
32
  if (!!protocol) {
28
33
  mainProtocolId = protocol?.id;
29
34
  }
30
- // Case of lending protocols and receipt tokens
31
- if (!!dynamicData && !!dynamicData.typeInfo?.underlying) {
32
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.underlying });
33
- }
34
- // Case of perps protocols
35
- if (!!dynamicData && !!dynamicData.typeInfo?.shortToken && !!dynamicData.typeInfo?.longToken) {
36
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.shortToken });
37
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.longToken });
38
- }
39
- // Case of weird AMMs
40
- if (!!dynamicData && !!dynamicData.typeInfo?.tokenA && !!dynamicData.typeInfo?.tokenB) {
41
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.tokenA });
42
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.tokenB });
43
- }
44
- // Case of AMMs
45
- if (!!dynamicData && !!dynamicData.typeInfo?.token0 && !!dynamicData.typeInfo?.token1) {
46
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token0 });
47
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token1 });
48
- }
49
- // Case of quad vaults
50
- if (!!dynamicData && !!dynamicData.typeInfo?.token2 && !!dynamicData.typeInfo?.token3) {
51
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token2 });
52
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token3 });
53
- }
54
- // Case of tripools
55
- if (!!dynamicData &&
56
- !!dynamicData.typeInfo?.token0Address &&
57
- !!dynamicData.typeInfo?.token1Address &&
58
- !!dynamicData.typeInfo?.token2Address) {
59
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token0Address });
60
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token1Address });
61
- tokens.push({ chainId: computeChainId, address: dynamicData.typeInfo.token2Address });
62
- }
35
+ depositUrl = Erc20Metadata.generateUrl(computeChainId, params, dynamicData);
63
36
  }
64
37
  catch {
65
38
  log.warn(`failed to fetch dynamic data for ERC20 campaign ${campaignId}`);
@@ -72,11 +45,15 @@ export class Erc20Metadata {
72
45
  name,
73
46
  tokens,
74
47
  mainProtocol: mainProtocolId,
75
- depositUrl: Erc20Metadata.generateUrl(computeChainId, params),
48
+ depositUrl,
76
49
  explorerAddress: getAddress(params.targetToken),
77
50
  };
78
51
  }
79
- static generateUrl(_computeChainId, params) {
52
+ static generateUrl(_computeChainId, params, dynamicData) {
53
+ const erc20type = dynamicData.typeInfo?.type;
54
+ if (erc20type === "gearbox") {
55
+ return `https://app.gearbox.fi/pools/${params.targetToken}`;
56
+ }
80
57
  return params.url;
81
58
  }
82
59
  }
@@ -14,6 +14,6 @@ export declare class EulerMetadata implements MetadataBuilder<campaignType> {
14
14
  depositUrl: string;
15
15
  explorerAddress: `0x${string}`;
16
16
  }>;
17
- static generateUrl(_computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"]): string;
17
+ static generateUrl(computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"]): string;
18
18
  }
19
19
  export {};
@@ -1,5 +1,6 @@
1
1
  import { dynamicDataBuilderFactory } from "@/engine/dynamicData/factory";
2
2
  import { log } from "@/utils/logger";
3
+ import { sanitizeChainName } from "@/utils/sanitizeChain";
3
4
  import { OpportunityAction } from "@db/api";
4
5
  import { Campaign as CampaignEnum } from "@sdk";
5
6
  import { getAddress } from "viem";
@@ -34,7 +35,7 @@ export class EulerMetadata {
34
35
  explorerAddress: getAddress(params.targetToken),
35
36
  };
36
37
  }
37
- static generateUrl(_computeChainId, params) {
38
- return `https://app.euler.finance/vault/${params.evkAddress}`;
38
+ static generateUrl(computeChainId, params) {
39
+ return `https://app.euler.finance/vault/${params.evkAddress}?network=${sanitizeChainName(computeChainId)}`;
39
40
  }
40
41
  }
@@ -1,5 +1,5 @@
1
1
  import type { ProtocolId } from "@/modules/v4/protocol/protocol.model";
2
- import { type Campaign as CampaignEnum, type CampaignParameters, ChainId } from "@sdk";
2
+ import type { Campaign as CampaignEnum, CampaignParameters, ChainId } from "@sdk";
3
3
  import type { MetadataBuilder } from "../interface";
4
4
  type campaignType = CampaignEnum.UNISWAP_V4;
5
5
  export declare class UniswapV4Metadata implements MetadataBuilder<campaignType> {
@@ -1,5 +1,5 @@
1
+ import { sanitizeChainName } from "@/utils/sanitizeChain";
1
2
  import { OpportunityAction } from "@db/api";
2
- import { ChainId, NETWORK_LABELS } from "@sdk";
3
3
  import { getAddress } from "viem";
4
4
  export class UniswapV4Metadata {
5
5
  async build(computeChainId, params, _subType) {
@@ -30,8 +30,6 @@ export class UniswapV4Metadata {
30
30
  };
31
31
  }
32
32
  static generateUrl(computeChainId, params) {
33
- const sanitizeChain = (computeChain) => NETWORK_LABELS[computeChain]?.toLowerCase().replaceAll(" ", "");
34
- const chainLabel = computeChainId === ChainId.MAINNET ? "ethereum/" : `${sanitizeChain(computeChainId)}/`;
35
- return `https://app.uniswap.org/explore/pools/${chainLabel}${params.poolId}`;
33
+ return `https://app.uniswap.org/explore/pools/${sanitizeChainName(computeChainId)}/${params.poolId}`;
36
34
  }
37
35
  }