@merkl/api 0.20.6 → 0.20.7

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.
@@ -1,5 +1,8 @@
1
1
  import { Campaign, type CampaignDynamicData, ChainId } from "@sdk";
2
2
  import { Elysia } from "elysia";
3
+ /**
4
+ * @deprecated Used only for the v3/campaigns route
5
+ */
3
6
  export type CampaignsCacheUpdaterReturnType = {
4
7
  [type_mainParameter: string]: {
5
8
  [campaignId: string]: CampaignDynamicData<Campaign>;
@@ -1,4 +1,7 @@
1
1
  import type Elysia from "elysia";
2
+ /**
3
+ * @deprecated Used only for the v3/opportunity route
4
+ */
2
5
  export declare const opportunityUpdater: (app: Elysia) => Elysia<"", false, {
3
6
  decorator: {};
4
7
  store: {};
@@ -1,6 +1,9 @@
1
1
  // @ts-nocheck
2
2
  import { OpportunityConvertorService } from "@/modules/v4/opportunity/opportunity.converter";
3
3
  import { log } from "../../utils/logger";
4
+ /**
5
+ * @deprecated Used only for the v3/opportunity route
6
+ */
4
7
  export const opportunityUpdater = (app) => {
5
8
  return app.get("/v3/updateOpportunities", async () => {
6
9
  log.info("✅ opportunity cache updated successfully");
@@ -75,7 +75,11 @@ export class ClammMetadata {
75
75
  if (mainProtocolId?.includes("stryke"))
76
76
  mainProtocolId = "stryke";
77
77
  else if (mainProtocolId?.includes("quickswap"))
78
- mainProtocolId = "quickswap";
78
+ mainProtocolId = "quick-swap";
79
+ else if (mainProtocolId?.includes("quick-swap"))
80
+ mainProtocolId = "quick-swap";
81
+ else if (mainProtocolId?.includes("sushi-swap"))
82
+ mainProtocolId = "sushiswap";
79
83
  if (!!mainProtocolId) {
80
84
  // Make sure the protocol exist in the correct type
81
85
  const protocol = (await ProtocolService.findMany({ id: mainProtocolId }))?.[0];
@@ -136,13 +140,13 @@ export class ClammMetadata {
136
140
  return "https:/app.horiza.io/liquidity";
137
141
  }
138
142
  case AMM.QuickswapAlgebra: {
139
- return `https://quickswap.exchange/pools?currency0=${params.token0}&currency1=${params.token1}`;
143
+ return `https://quickswap.exchange/#/pools?currency0=${params.token0}&currency1=${params.token1}`;
140
144
  }
141
145
  case AMM.QuickswapUni: {
142
- return `https://quickswap.exchange/pools?currency0=${params.token0}&currency1=${params.token1}`;
146
+ return `https://quickswap.exchange/#/pools?currency0=${params.token0}&currency1=${params.token1}`;
143
147
  }
144
148
  case AMM.QuickswapAlgebraV1_2: {
145
- return `https://quickswap.exchange/pools?currency0=${params.token0}&currency1=${params.token1}`;
149
+ return `https://quickswap.exchange/#/pools?currency0=${params.token0}&currency1=${params.token1}`;
146
150
  }
147
151
  case AMM.Swapr: {
148
152
  return "https://v3.swapr.eth.limo/#/swap";
@@ -287,7 +287,7 @@ export class OpportunityRepository {
287
287
  MainProtocol: true,
288
288
  Protocols: true,
289
289
  Tokens: {
290
- where: !withTest ? { isTest: false, isPoint: withPoints } : undefined,
290
+ where: !withTest ? { isTest: false } : undefined,
291
291
  },
292
292
  },
293
293
  where: { id },
@@ -342,7 +342,7 @@ export class OpportunityRepository {
342
342
  },
343
343
  Protocols: true,
344
344
  Tokens: {
345
- where: !withTest ? { isTest: false, isPoint: withPoints } : undefined,
345
+ where: !withTest ? { isTest: false } : undefined,
346
346
  },
347
347
  },
348
348
  ...args,
@@ -1,5 +1,6 @@
1
1
  import { tokenType } from "@/engine/erc20SubTypeProcessors/helpers/tokenType";
2
2
  import { ChainId } from "@sdk";
3
+ import { capitalize } from "lodash";
3
4
  export const stakingContractToStakingSymbol = {
4
5
  "0x18eeD20f71BEf84B605253C89A7576E3634134C0": "CyberStaking",
5
6
  "0x68754d29f2e97B837Cb622ccfF325adAC27E9977": "Karak",
@@ -39,21 +40,21 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
39
40
  case tokenType.pancakeswap:
40
41
  case tokenType.traderJoe:
41
42
  case tokenType.katana:
42
- return `Provide liquidity to ${typeInfo.protocol} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}`;
43
+ return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}`;
43
44
  case tokenType.pendleYT:
44
- return `Hold ${typeInfo.protocol} ${typeInfo.name}`;
45
+ return `Hold ${capitalize(typeInfo.protocol)} ${typeInfo.name}`;
45
46
  case tokenType.pendle:
46
- return `Provide ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
47
+ return `Provide ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
47
48
  case tokenType.balancerGauge:
48
- return `${typeInfo.protocol} ${symbols.join("-")}`;
49
+ return `${capitalize(typeInfo.protocol)} ${symbols.join("-")}`;
49
50
  case tokenType.beraborrow_gauge:
50
51
  case tokenType.beratrax_vault:
51
- return `Deposit ${symbols.join("-")} on ${typeInfo.protocol}`;
52
+ return `Deposit ${symbols.join("-")} on ${capitalize(typeInfo.protocol)}`;
52
53
  case tokenType.balancerPool: {
53
54
  if (campaign.computeChainId === ChainId.SONIC) {
54
55
  typeInfo.protocol = "Beets";
55
56
  }
56
- let cardName = `Provide liquidity to ${typeInfo.protocol} ${symbols.join("-")}`;
57
+ let cardName = `Provide liquidity to ${capitalize(typeInfo.protocol)} ${symbols.join("-")}`;
57
58
  if (typeInfo.vault === "0xFB43069f6d0473B85686a85F4Ce4Fc1FD8F00875") {
58
59
  cardName = `Provide liquidity to Jellyverse Pool ${symbols.join("-")}`;
59
60
  }
@@ -63,23 +64,23 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
63
64
  if (campaign.computeChainId === ChainId.SONIC) {
64
65
  typeInfo.protocol = "Beets";
65
66
  }
66
- return `Provide liquidity to ${typeInfo.protocol} Boosted ${symbols.join("-")}`;
67
+ return `Provide liquidity to ${capitalize(typeInfo.protocol)} Boosted ${symbols.join("-")}`;
67
68
  }
68
69
  case tokenType.aura:
69
- return `Provide liquidity to ${typeInfo.protocol} ${symbols.join("-")}`;
70
+ return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${symbols.join("-")}`;
70
71
  case tokenType.gearbox:
71
- return `${typeInfo.protocol} ${typeInfo.symbolUnderlyingToken} Deposit`;
72
+ return `${capitalize(typeInfo.protocol)} ${typeInfo.symbolUnderlyingToken} Deposit`;
72
73
  case tokenType.compound:
73
- return `Lend ${typeInfo.symbolBaseToken} on ${typeInfo.protocol}`;
74
+ return `Lend ${typeInfo.symbolBaseToken} on ${capitalize(typeInfo.protocol)}`;
74
75
  case tokenType.radiant_lend: {
75
76
  let cardToken = typeInfo.symbolUnderlyingToken;
76
77
  if (campaign.campaignParameters.symbolTargetToken.startsWith("r")) {
77
78
  cardToken = campaign.campaignParameters.symbolTargetToken.substring(1);
78
79
  }
79
- return `Lend ${cardToken} on ${typeInfo.protocol}`;
80
+ return `Lend ${cardToken} on ${capitalize(typeInfo.protocol)}`;
80
81
  }
81
82
  case tokenType.rfx:
82
- return `Supply ${typeInfo.symbolShortToken}-${typeInfo.symbolLongToken} on ${typeInfo.protocol}`;
83
+ return `Supply ${typeInfo.symbolShortToken}-${typeInfo.symbolLongToken} on ${capitalize(typeInfo.protocol)}`;
83
84
  case tokenType.radiant_borrow:
84
85
  case tokenType.aave_borrowing:
85
86
  case tokenType.vicuna_borrowing:
@@ -91,7 +92,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
91
92
  case tokenType.takotako_borrowing:
92
93
  case tokenType.lendle_borrowing:
93
94
  case tokenType.euler_borrow:
94
- return `Borrow ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
95
+ return `Borrow ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
95
96
  case tokenType.ionic:
96
97
  case tokenType.layerbank:
97
98
  case tokenType.moonwell:
@@ -109,45 +110,45 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
109
110
  case tokenType.venus:
110
111
  case tokenType.reactor_fusion:
111
112
  case tokenType.euler_lend:
112
- return `Supply ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
113
+ return `Supply ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
113
114
  case tokenType.metamorpho:
114
- return `Supply to ${typeInfo.name} on ${typeInfo.protocol}`;
115
+ return `Supply to ${typeInfo.name} on ${capitalize(typeInfo.protocol)}`;
115
116
  case tokenType.sturdy_aggregator:
116
- return `Supply ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol} ${typeInfo.name}`;
117
+ return `Supply ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)} ${typeInfo.name}`;
117
118
  case tokenType.sturdy_silo:
118
- return `Supply ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol} ${typeInfo.symbolCollateral} Silo`;
119
+ return `Supply ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)} ${typeInfo.symbolCollateral} Silo`;
119
120
  case tokenType.curve:
120
121
  case tokenType.curve_2:
121
- return `Provide liquidity to ${typeInfo.protocol} ${Object.values(typeInfo.poolTokens).join("-")}`;
122
+ return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${Object.values(typeInfo.poolTokens).join("-")}`;
122
123
  case tokenType.fluid:
123
- return `Lend ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
124
+ return `Lend ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
124
125
  case tokenType.enzyme:
125
- return `Supply to the ${typeInfo.name} on ${typeInfo.protocol}`;
126
+ return `Supply to the ${typeInfo.name} on ${capitalize(typeInfo.protocol)}`;
126
127
  case tokenType.filament:
127
- return `Earn Yield on ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
128
+ return `Earn Yield on ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
128
129
  case tokenType.silostaking:
129
- return `Stake ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
130
+ return `Stake ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
130
131
  case tokenType.beefy:
131
- return `Provide liquidity to ${typeInfo.protocol} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}`;
132
+ return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}`;
132
133
  case tokenType.toros:
133
- return `${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken}) on ${typeInfo.protocol}`;
134
+ return `${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken}) on ${capitalize(typeInfo.protocol)}`;
134
135
  case tokenType.ironcladStaking:
135
- return `Stake ${campaign.campaignParameters.symbolTargetToken} on ${typeInfo.protocol}`;
136
+ return `Stake ${campaign.campaignParameters.symbolTargetToken} on ${capitalize(typeInfo.protocol)}`;
136
137
  case tokenType.woofi:
137
- return `Supercharge ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
138
+ return `Supercharge ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
138
139
  case tokenType.maverickBoostedPosition:
139
140
  return `Maverick Boosted Position ${campaign.campaignParameters.symbolTargetToken}`;
140
141
  case tokenType.zkSwapThreePool:
141
- return `Provide liquidity to ${typeInfo.protocol} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}-${typeInfo.symbolToken2}`;
142
+ return `Provide liquidity to ${capitalize(typeInfo.protocol)} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}-${typeInfo.symbolToken2}`;
142
143
  case tokenType.maha:
143
- return `Stake ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} LP on ${typeInfo.protocol}`;
144
+ return `Stake ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} LP on ${capitalize(typeInfo.protocol)}`;
144
145
  case tokenType.tempest:
145
146
  case tokenType.tempestStaking:
146
- return `Deposit into ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} vault on ${typeInfo.protocol}`;
147
+ return `Deposit into ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} vault on ${capitalize(typeInfo.protocol)}`;
147
148
  case tokenType.holdstation:
148
- return `Hold vault token ${campaign.campaignParameters.symbolTargetToken} on ${typeInfo.protocol}`;
149
+ return `Hold vault token ${campaign.campaignParameters.symbolTargetToken} on ${capitalize(typeInfo.protocol)}`;
149
150
  case tokenType.cpmmGamma:
150
- return `Provide ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} on ${typeInfo.protocol}`;
151
+ return `Provide ${typeInfo.symbolToken0}-${typeInfo.symbolToken1} on ${capitalize(typeInfo.protocol)}`;
151
152
  case tokenType.crosscurve:
152
153
  if (typeInfo.name.toLowerCase() === "eywa/usdt") {
153
154
  return `Curve ${typeInfo.name}`;
@@ -162,7 +163,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
162
163
  return `Deposit liquidity on ${parsedNameForCard.replace("BALANCER", "Beets")} vault on Vicuna`;
163
164
  }
164
165
  case tokenType.satlayer:
165
- return `Restake ${typeInfo.symbolUnderlyingToken} on ${typeInfo.protocol}`;
166
+ return `Restake ${typeInfo.symbolUnderlyingToken} on ${capitalize(typeInfo.protocol)}`;
166
167
  case tokenType.veda:
167
168
  return `Deposit into ${typeInfo.name.replace("Ether.Fi", "Veda")}`;
168
169
  case tokenType.concrete: