@merkl/api 0.16.2 → 0.16.3

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,7 +1,7 @@
1
1
  import { merklChainDataWithCache } from "../../merklChainData";
2
2
  import { TokenRepository } from "../../../modules/v4/token/token.repository";
3
3
  import { log } from "../../../utils/logger";
4
- import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
4
+ import { BN2Number, BalancerPoolInterface, BalancerV3StablePoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
5
5
  import { Pricer } from "../../../utils/pricer";
6
6
  import { getLastEligibilityRatio } from "../utils/getLastEligibilityRatio";
7
7
  import { getTVL } from "./ERC20SubTypes/helpers/getTVL";
@@ -55,6 +55,11 @@ export async function ERC20DynamicData(chainId, campaigns) {
55
55
  callData: LayerBankERC20Interface.encodeFunctionData("owner"),
56
56
  target: targetToken,
57
57
  },
58
+ {
59
+ allowFailure: true,
60
+ callData: BalancerV3StablePoolInterface.encodeFunctionData("getVault"),
61
+ target: targetToken,
62
+ },
58
63
  ];
59
64
  callsRounds1.push(...typeStruct.calls);
60
65
  tokenTypesByCampaign[campaign.campaignId] = typeStruct;
@@ -26,6 +26,7 @@ const factoryAddresses = {
26
26
  "0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a": tokenType.curveNPool, // Curve Corn 3crypto Factory
27
27
  "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8": tokenType.curveNPool, // Curve Arbitrum 3crypto Factory
28
28
  "0xA5961898870943c68037F6848d2D866Ed2016bcB": tokenType.curveNPool, // Curve Base
29
+ "0xB255D6A720BB7c39fee173cE22113397119cB930": tokenType.katana, // Katana Ronin
29
30
  };
30
31
  export function getTypeFromFactoryAddress(address) {
31
32
  if (factoryAddresses[address]) {
@@ -86,7 +86,10 @@ export declare enum tokenType {
86
86
  vicuna_lending = "vicuna_lending",
87
87
  vicuna_borrowing = "vicuna_borrowing",
88
88
  spectra_lpt = "spectra_lpt",
89
- spectra_yt = "spectra_yt"
89
+ spectra_yt = "spectra_yt",
90
+ hourglass = "hourglass",
91
+ katana = "katana",
92
+ balancerV3 = "balancerV3"
90
93
  }
91
94
  export declare const tokenTypeToProtocol: {
92
95
  [key in tokenType]: {
@@ -88,6 +88,9 @@ export var tokenType;
88
88
  tokenType["vicuna_borrowing"] = "vicuna_borrowing";
89
89
  tokenType["spectra_lpt"] = "spectra_lpt";
90
90
  tokenType["spectra_yt"] = "spectra_yt";
91
+ tokenType["hourglass"] = "hourglass";
92
+ tokenType["katana"] = "katana";
93
+ tokenType["balancerV3"] = "balancerV3";
91
94
  })(tokenType || (tokenType = {}));
92
95
  export const tokenTypeToProtocol = {
93
96
  [tokenType.aave_borrowing]: { protocol: "Aave", action: OpportunityAction.BORROW },
@@ -176,4 +179,7 @@ export const tokenTypeToProtocol = {
176
179
  [tokenType.spectra_lpt]: { protocol: "Spectra", action: OpportunityAction.POOL },
177
180
  [tokenType.spectra_yt]: { protocol: "Spectra", action: OpportunityAction.POOL },
178
181
  [tokenType.rfx_slv]: { protocol: "RFX", action: OpportunityAction.POOL },
182
+ [tokenType.hourglass]: { protocol: "Hourglass", action: OpportunityAction.HOLD },
183
+ [tokenType.katana]: { protocol: "Katana", action: OpportunityAction.POOL },
184
+ [tokenType.balancerV3]: { protocol: "Balancer", action: OpportunityAction.POOL },
179
185
  };
@@ -0,0 +1,44 @@
1
+ import type { Pricer } from "../../../../../utils/pricer";
2
+ import { type Campaign, type CampaignParameters } from "@sdk";
3
+ import type { BigNumber } from "ethers";
4
+ import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
5
+ import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
6
+ type callType = {
7
+ key: keyof dataRawBalancerV3;
8
+ call: string;
9
+ target: keyof callKeysBalancerV3;
10
+ metaData?: keyof callKeysBalancerV3 | string;
11
+ optional?: boolean;
12
+ };
13
+ type callKeysBalancerV3 = mandatoryCallKeys & {
14
+ [key: `token${number}`]: string;
15
+ [key: `symbolToken${number}`]: string;
16
+ [key: `decimalsToken${number}`]: string;
17
+ [key: `${number}`]: string;
18
+ name: string;
19
+ };
20
+ type dataRawBalancerV3 = callKeysBalancerV3 & {
21
+ numberTokens: number;
22
+ [key: `balanceToken${number}`]: BigNumber;
23
+ tokenInfo: {
24
+ tokens: string[];
25
+ tokenInfo: string[][];
26
+ balancesRaw: BigNumber[];
27
+ lastBalancesLiveScaled18: BigNumber[];
28
+ };
29
+ };
30
+ type dataTypeBalancerV3 = dataType & {
31
+ numberTokens: number;
32
+ };
33
+ export declare class BalancerV3PoolProcessor extends GenericProcessor<callKeysBalancerV3, dataRawBalancerV3, dataTypeBalancerV3> {
34
+ rounds: {
35
+ round1: callType[];
36
+ round2: callType[];
37
+ round3: callType[];
38
+ round4: callType[];
39
+ };
40
+ processingRound2(typeInfo: dataRawBalancerV3): void;
41
+ computeRound3(index: number, type: tokenType, typeInfo: dataRawBalancerV3, calls: string[]): tokenTypeStruct;
42
+ processingRound5(_index: number, type: tokenType, typeInfo: dataRawBalancerV3, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeBalancerV3>;
43
+ }
44
+ export {};
@@ -0,0 +1,69 @@
1
+ import { generateCardName } from "../../../../../utils/generateCardName";
2
+ import { BN2Number } from "@sdk";
3
+ import { GenericProcessor } from "./GenericProcessor";
4
+ const matchSingleNumber = (input) => {
5
+ const regex = /^\d+$/;
6
+ return regex.test(input);
7
+ };
8
+ export class BalancerV3PoolProcessor extends GenericProcessor {
9
+ rounds = {
10
+ round1: [
11
+ { key: "numberTokens", call: "getTokens", target: "tokenAddress" },
12
+ { key: "tokenInfo", call: "getTokenInfo", target: "tokenAddress" },
13
+ ],
14
+ round2: [],
15
+ round3: [],
16
+ round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
17
+ };
18
+ // override computeRound1(): void {}
19
+ processingRound2(typeInfo) {
20
+ typeInfo.numberTokens = Number(typeInfo.numberTokens);
21
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
22
+ typeInfo[`token${i}`] = typeInfo.tokenInfo.tokens[i];
23
+ this.rounds.round2 = this.rounds.round2.concat([
24
+ { key: `symbolToken${i}`, call: "symbol", target: `token${i}` },
25
+ { key: `decimalsToken${i}`, call: "decimals", target: `token${i}` },
26
+ ]);
27
+ typeInfo[`balanceToken${i}`] = typeInfo.tokenInfo.balancesRaw[i];
28
+ }
29
+ }
30
+ computeRound3(index, type, typeInfo, calls) {
31
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
32
+ this.rounds.round2 = this.rounds.round2.concat([
33
+ { key: `symbolToken${i}`, call: "symbol", target: `token${i}` },
34
+ { key: `decimalsToken${i}`, call: "decimals", target: `token${i}` },
35
+ ]);
36
+ }
37
+ return super.computeRound3(index, type, typeInfo, calls);
38
+ }
39
+ async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
40
+ const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
41
+ let tvl = 0;
42
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
43
+ const symbol = typeInfo[`symbolToken${i}`];
44
+ const price = (await pricer.get({ symbol: symbol })) ?? 0;
45
+ const decimals = Number(typeInfo[`decimalsToken${i}`]);
46
+ const amount = BN2Number(typeInfo[`balanceToken${i}`], decimals);
47
+ tvl += amount * price;
48
+ }
49
+ const priceTargetToken = tvl / totalSupply;
50
+ // Remove all keys that start with a number or balanceToken
51
+ for (const key in typeInfo) {
52
+ if (key.startsWith("balanceToken") ||
53
+ key.startsWith("decimalsToken") ||
54
+ matchSingleNumber(key) ||
55
+ key.startsWith("tokenInfo")) {
56
+ delete typeInfo[key];
57
+ }
58
+ }
59
+ return {
60
+ ...typeInfo,
61
+ totalSupply,
62
+ tvl,
63
+ whitelistedSupplyTargetToken,
64
+ blacklistedSupply,
65
+ priceTargetToken,
66
+ cardName: generateCardName(type, typeInfo, campaign),
67
+ };
68
+ }
69
+ }
@@ -0,0 +1,36 @@
1
+ import type { Pricer } from "../../../../../utils/pricer";
2
+ import { type Campaign, type CampaignParameters } from "@sdk";
3
+ import type { BigNumber } from "ethers";
4
+ import type { tokenType } from "../helpers/tokenType";
5
+ import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
6
+ type callType = {
7
+ key: keyof dataRawHourglass;
8
+ call: string;
9
+ target: keyof callKeysHourglass;
10
+ metaData?: keyof callKeysHourglass;
11
+ };
12
+ export type callKeysHourglass = mandatoryCallKeys & {
13
+ depositor: string;
14
+ underlying: string;
15
+ symbolUnderlyingToken: string;
16
+ decimalsUnderlying: string;
17
+ balanceOfUnderlying: string;
18
+ };
19
+ type dataRawHourglass = callKeysHourglass & {};
20
+ type dataTypeHourglass = dataType & {
21
+ underlying: string;
22
+ symbolUnderlyingToken: string;
23
+ decimalsUnderlying: number;
24
+ priceTargetToken: number;
25
+ balanceOfUnderlying: BigNumber;
26
+ };
27
+ export declare class HourglassProcessor extends GenericProcessor<callKeysHourglass, dataRawHourglass, dataTypeHourglass> {
28
+ rounds: {
29
+ round1: callType[];
30
+ round2: callType[];
31
+ round3: callType[];
32
+ round4: callType[];
33
+ };
34
+ processingRound5(_index: number, type: tokenType, typeInfo: dataRawHourglass, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeHourglass>;
35
+ }
36
+ export {};
@@ -0,0 +1,31 @@
1
+ import { generateCardName } from "../../../../../utils/generateCardName";
2
+ import { BN2Number } from "@sdk";
3
+ import { GenericProcessor } from "./GenericProcessor";
4
+ export class HourglassProcessor extends GenericProcessor {
5
+ rounds = {
6
+ round1: [{ key: "depositor", call: "depositor", target: "tokenAddress" }],
7
+ round2: [{ key: "underlying", call: "underlying", target: "depositor" }],
8
+ round3: [
9
+ { key: "symbolUnderlyingToken", call: "symbol", target: "underlying" },
10
+ { key: "decimalsUnderlying", call: "decimals", target: "underlying" },
11
+ { key: "balanceOfUnderlying", call: "balanceOf", target: "underlying", metaData: "depositor" },
12
+ ],
13
+ round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
14
+ };
15
+ // // override computeRound1(): void {}
16
+ async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
17
+ const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
18
+ const priceUnderlying = (await pricer.get({ symbol: typeInfo.symbolUnderlyingToken })) ?? 0;
19
+ const tvl = BN2Number(typeInfo.balanceOfUnderlying, Number(typeInfo.decimalsUnderlying)) * priceUnderlying;
20
+ const priceTargetToken = tvl / totalSupply;
21
+ return {
22
+ ...typeInfo,
23
+ whitelistedSupplyTargetToken,
24
+ tvl: tvl,
25
+ priceTargetToken,
26
+ cardName: generateCardName(type, typeInfo, campaign),
27
+ blacklistedSupply,
28
+ totalSupply,
29
+ };
30
+ }
31
+ }
@@ -5,6 +5,7 @@ import { AssetProcessor } from "./AssetProcessor";
5
5
  import { AuraProcessor } from "./AuraProcessor";
6
6
  import { BalancerGaugeProcessor } from "./BalancerGaugeProcessor";
7
7
  import { BalancerPoolProcessor } from "./BalancerPoolProcessor";
8
+ import { BalancerV3PoolProcessor } from "./BalancerV3PoolProcessor";
8
9
  import { BeefyProcessor } from "./BeefyProcessor";
9
10
  import { CompoundProcessor } from "./CompoundProcessor";
10
11
  import { ERC4626Processor } from "./ERC4626Processor";
@@ -18,6 +19,7 @@ import { GammaProcessor } from "./GammaProcessor";
18
19
  import { GearboxProcessor } from "./GearboxProcessor";
19
20
  import { GenericProcessor } from "./GenericProcessor";
20
21
  import { HoldStationProcessor } from "./HoldStationProcessor";
22
+ import { HourglassProcessor } from "./HourglassProcessor";
21
23
  import { MaverickBPProcessor } from "./MaverickBPProcessor";
22
24
  import { MetamorphoProcessor } from "./MetamorphoProcessor";
23
25
  import { NoLinkVaultProcessor } from "./NoLinkVaultProcessor";
@@ -127,4 +129,7 @@ export const processorMapping = {
127
129
  [tokenType.spectra_lpt]: SpectraProcessor,
128
130
  [tokenType.spectra_yt]: SpectraYTProcessor,
129
131
  [tokenType.rfx_slv]: ERC4626Processor,
132
+ [tokenType.hourglass]: HourglassProcessor,
133
+ [tokenType.katana]: UniswapProcessor,
134
+ [tokenType.balancerV3]: BalancerV3PoolProcessor,
130
135
  };
@@ -8,6 +8,8 @@ import { processorMapping } from "./processor/processorMapping";
8
8
  function satisfiesNameConditions(name, type) {
9
9
  const lowerCaseName = name.toLowerCase();
10
10
  switch (type) {
11
+ case tokenType.hourglass:
12
+ return lowerCaseName.startsWith("ct-hourglass");
11
13
  case tokenType.fraxlend:
12
14
  return lowerCaseName.includes("fraxlend interest bearing");
13
15
  case tokenType.sturdy_aggregator:
@@ -244,6 +246,13 @@ function parseForBalancer(calls, targetToken, name) {
244
246
  catch (e) {
245
247
  // Not a balancer pool
246
248
  }
249
+ try {
250
+ decodeReturnValue(calls.vault, "getVault");
251
+ return generateResult(tokenType.balancerV3, name, targetToken, {});
252
+ }
253
+ catch (e) {
254
+ // Not a balancer v3 pool
255
+ }
247
256
  }
248
257
  function checkAgainstHardcoded(calls, chainId, targetToken) {
249
258
  // Check for balancer pools
@@ -284,6 +293,7 @@ export function getTokenTypeRound1(calls, targetToken, index, campaign) {
284
293
  poolId: returnValueOfCalls[index + 3],
285
294
  creator: returnValueOfCalls[index + 4],
286
295
  owner: returnValueOfCalls[index + 5],
296
+ vault: returnValueOfCalls[index + 6],
287
297
  };
288
298
  let result = parseForFactory(returnValue, targetToken);
289
299
  if (result)
@@ -1,4 +1,4 @@
1
- import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
1
+ import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
2
2
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
3
3
  export function decodeCall(calls, index, key, type) {
4
4
  const returnData = calls[index];
@@ -117,6 +117,8 @@ export function decodeReturnValue(returnData, key, type) {
117
117
  case tokenType.euler_lend:
118
118
  case tokenType.maha:
119
119
  return EulerInterface.decodeFunctionResult("asset", returnData)[0];
120
+ case tokenType.hourglass:
121
+ return HourglassVedaLockDepositorV2Interface.decodeFunctionResult("getUnderlying", returnData)[0];
120
122
  default:
121
123
  throw new Error(`Need tokenType for this key ${key}, or type ${type} not matched`);
122
124
  }
@@ -271,6 +273,12 @@ export function decodeReturnValue(returnData, key, type) {
271
273
  return SyncSwapClassicPoolInterface.decodeFunctionResult("reserve1", returnData)[0];
272
274
  case "asset":
273
275
  return ERC4626Interface.decodeFunctionResult("asset", returnData)[0];
276
+ case "depositor":
277
+ return HourglassERC20TBTInterface.decodeFunctionResult("depositor", returnData)[0];
278
+ case "getTokens":
279
+ return BalancerV3StablePoolInterface.decodeFunctionResult("getTokens", returnData)[0].length;
280
+ case "getTokenInfo":
281
+ return BalancerV3StablePoolInterface.decodeFunctionResult("getTokenInfo", returnData);
274
282
  default:
275
283
  throw new Error(`Key not recognized for ${key}`);
276
284
  }
@@ -1,5 +1,5 @@
1
1
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
- import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
2
+ import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerV3StablePoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, HourglassERC20TBTInterface, HourglassVedaLockDepositorV2Interface, IonicInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
3
3
  export function createCall(target, key, type, metaData) {
4
4
  switch (key) {
5
5
  case "SY":
@@ -148,6 +148,12 @@ export function createCall(target, key, type, metaData) {
148
148
  case tokenType.vicuna_borrowing:
149
149
  case tokenType.vicuna_lending:
150
150
  return { allowFailure: true, callData: AaveInterface.encodeFunctionData("UNDERLYING_ASSET_ADDRESS"), target };
151
+ case tokenType.hourglass:
152
+ return {
153
+ allowFailure: true,
154
+ callData: HourglassVedaLockDepositorV2Interface.encodeFunctionData("getUnderlying"),
155
+ target,
156
+ };
151
157
  default:
152
158
  throw new Error(`Need tokenType for this key ${key}, or unknown type ${type}`);
153
159
  }
@@ -417,6 +423,24 @@ export function createCall(target, key, type, metaData) {
417
423
  callData: SyncSwapClassicPoolInterface.encodeFunctionData("reserve1"),
418
424
  target: target,
419
425
  };
426
+ case "depositor":
427
+ return {
428
+ allowFailure: true,
429
+ callData: HourglassERC20TBTInterface.encodeFunctionData("depositor"),
430
+ target: target,
431
+ };
432
+ case "getTokens":
433
+ return {
434
+ allowFailure: true,
435
+ callData: BalancerV3StablePoolInterface.encodeFunctionData("getTokens"),
436
+ target: target,
437
+ };
438
+ case "getTokenInfo":
439
+ return {
440
+ allowFailure: true,
441
+ callData: BalancerV3StablePoolInterface.encodeFunctionData("getTokenInfo"),
442
+ target: target,
443
+ };
420
444
  default:
421
445
  throw new Error(`Unknown key ${key}`);
422
446
  }
@@ -1,3 +1,3 @@
1
1
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
- import type { Campaign, CampaignParameters } from "@sdk";
2
+ import { type Campaign, type CampaignParameters } from "@sdk";
3
3
  export declare function generateCardName(type: tokenType, typeInfo: any, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, symbols?: string[], displayName?: string): string;
@@ -1,4 +1,5 @@
1
1
  import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
2
+ import { ChainId } from "@sdk";
2
3
  export function generateCardName(type, typeInfo, campaign, symbols = [""], displayName) {
3
4
  switch (type) {
4
5
  case tokenType.uniswapv2:
@@ -15,6 +16,7 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
15
16
  case tokenType.syncswap:
16
17
  case tokenType.pancakeswap:
17
18
  case tokenType.traderJoe:
19
+ case tokenType.katana:
18
20
  return `Provide liquidity to ${typeInfo.protocol} ${typeInfo.symbolToken0}-${typeInfo.symbolToken1}`;
19
21
  case tokenType.pendleYT:
20
22
  return `Hold ${typeInfo.protocol} ${typeInfo.name}`;
@@ -23,12 +25,25 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
23
25
  case tokenType.balancerGauge:
24
26
  return `${typeInfo.protocol} ${symbols.join("-")}`;
25
27
  case tokenType.balancerPool: {
28
+ if (campaign.computeChainId === ChainId.SONIC) {
29
+ typeInfo.protocol = "Beets";
30
+ }
26
31
  let cardName = `Provide liquidity to ${typeInfo.protocol} ${symbols.join("-")}`;
27
32
  if (typeInfo.vault === "0xFB43069f6d0473B85686a85F4Ce4Fc1FD8F00875") {
28
33
  cardName = `Provide liquidity to Jellyverse Pool ${symbols.join("-")}`;
29
34
  }
30
35
  return cardName;
31
36
  }
37
+ case tokenType.balancerV3: {
38
+ const symbols = [];
39
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
40
+ symbols.push(typeInfo[`symbolToken${i}`]);
41
+ }
42
+ if (campaign.computeChainId === ChainId.SONIC) {
43
+ typeInfo.protocol = "Beets";
44
+ }
45
+ return `Provide liquidity to ${typeInfo.protocol} ${symbols.join("-")}`;
46
+ }
32
47
  case tokenType.aura:
33
48
  return `Provide liquidity to ${typeInfo.protocol} ${symbols.join("-")}`;
34
49
  case tokenType.gearbox:
@@ -144,6 +159,8 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
144
159
  return `Provide liquidity on Spectra to ${typeInfo.name}`;
145
160
  case tokenType.spectra_yt:
146
161
  return `Hold Spectra ${typeInfo.name}`;
162
+ case tokenType.hourglass:
163
+ return `Deposit ${typeInfo.symbolUnderlyingToken} into Hourglass`;
147
164
  default:
148
165
  // OVERRIDE
149
166
  switch (typeInfo.tokenAddress) {