@merkl/api 0.10.209 → 0.10.211

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/dist/database/api/.generated/edge.js +6 -4
  2. package/dist/database/api/.generated/index-browser.js +3 -1
  3. package/dist/database/api/.generated/index.d.ts +3 -1
  4. package/dist/database/api/.generated/index.js +6 -4
  5. package/dist/database/api/.generated/package.json +1 -1
  6. package/dist/database/api/.generated/schema.prisma +2 -0
  7. package/dist/database/api/.generated/wasm.js +3 -1
  8. package/dist/database/api/seeder/resources/protocol.d.ts +27 -0
  9. package/dist/database/api/seeder/resources/protocol.js +16 -0
  10. package/dist/src/eden/index.d.ts +201 -9
  11. package/dist/src/entities/opportunity.js +37 -1
  12. package/dist/src/index.d.ts +77 -3
  13. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -1
  14. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +4 -0
  15. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/curveNPoolProcessor.d.ts +39 -0
  16. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/curveNPoolProcessor.js +81 -0
  17. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +2 -0
  18. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +2 -0
  19. package/dist/src/libs/campaigns/campaignTypes/EigenLayerDynamicData.d.ts +3 -0
  20. package/dist/src/libs/campaigns/campaignTypes/EigenLayerDynamicData.js +67 -0
  21. package/dist/src/libs/campaigns/campaignsDynamicData.js +4 -0
  22. package/dist/src/libs/positions/EigenLayer/index.d.ts +6 -0
  23. package/dist/src/libs/positions/EigenLayer/index.js +53 -0
  24. package/dist/src/libs/positions/ajna/index.d.ts +4 -39
  25. package/dist/src/libs/positions/ajna/index.js +2 -2
  26. package/dist/src/libs/positions/badger/index.d.ts +3 -24
  27. package/dist/src/libs/positions/badger/index.js +1 -1
  28. package/dist/src/libs/positions/index.js +4 -0
  29. package/dist/src/libs/positions/morpho/index.d.ts +4 -38
  30. package/dist/src/libs/positions/prepareFetch.js +29 -1
  31. package/dist/src/libs/positions/types.d.ts +55 -0
  32. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +2 -2
  33. package/dist/src/modules/v4/campaign/campaign.model.d.ts +4 -0
  34. package/dist/src/modules/v4/campaign/campaign.model.js +2 -0
  35. package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +1 -0
  36. package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +1 -0
  37. package/dist/src/modules/v4/dynamicData/dynamicData.service.js +1 -0
  38. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -1
  39. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -0
  40. package/dist/src/modules/v4/opportunity/opportunity.service.js +3 -0
  41. package/dist/src/modules/v4/opportunity/subservices/getEigenLayerMetadata.service.d.ts +3 -0
  42. package/dist/src/modules/v4/opportunity/subservices/getEigenLayerMetadata.service.js +9 -0
  43. package/dist/src/modules/v4/programPayload/index.d.ts +3 -0
  44. package/dist/src/modules/v4/programPayload/index.js +3 -0
  45. package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +93 -0
  46. package/dist/src/modules/v4/programPayload/programPayload.controller.js +38 -0
  47. package/dist/src/modules/v4/programPayload/programPayload.model.d.ts +122 -0
  48. package/dist/src/modules/v4/programPayload/programPayload.model.js +130 -0
  49. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +39 -0
  50. package/dist/src/modules/v4/programPayload/programPayload.repository.js +359 -0
  51. package/dist/src/modules/v4/programPayload/programPayload.service.d.ts +8 -0
  52. package/dist/src/modules/v4/programPayload/programPayload.service.js +92 -0
  53. package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
  54. package/dist/src/modules/v4/protocol/protocol.model.js +2 -0
  55. package/dist/src/modules/v4/router.d.ts +77 -3
  56. package/dist/src/modules/v4/router.js +3 -1
  57. package/dist/src/utils/decodeCalls.js +5 -3
  58. package/dist/src/utils/encodeCalls.js +11 -13
  59. package/dist/src/utils/generateCardName.js +2 -0
  60. package/dist/tsconfig.package.tsbuildinfo +1 -1
  61. package/package.json +1 -1
@@ -371,7 +371,7 @@ declare const eden: {
371
371
  index: {
372
372
  post: (body: {
373
373
  name?: string | undefined;
374
- type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4";
374
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER";
375
375
  tokens: {
376
376
  chainId: number;
377
377
  address: string;
@@ -592,7 +592,7 @@ declare const eden: {
592
592
  get: (options: {
593
593
  headers?: Record<string, unknown> | undefined;
594
594
  query: {
595
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
595
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
596
596
  items?: number | undefined;
597
597
  subType?: number | undefined;
598
598
  page?: number | undefined;
@@ -661,7 +661,7 @@ declare const eden: {
661
661
  get: (options: {
662
662
  headers?: Record<string, unknown> | undefined;
663
663
  query: {
664
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
664
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
665
665
  items?: number | undefined;
666
666
  subType?: number | undefined;
667
667
  page?: number | undefined;
@@ -1975,6 +1975,7 @@ declare const eden: {
1975
1975
  cardName: string;
1976
1976
  blacklistedSupply: number;
1977
1977
  priceTargetToken: number;
1978
+ type: string;
1978
1979
  };
1979
1980
  }>>;
1980
1981
  };
@@ -2092,6 +2093,64 @@ declare const eden: {
2092
2093
  })[];
2093
2094
  }>>;
2094
2095
  }) & {};
2096
+ "program-payload": {
2097
+ index: {
2098
+ get: (options: {
2099
+ headers?: Record<string, unknown> | undefined;
2100
+ query: {
2101
+ creator: string;
2102
+ startTimestamp: number;
2103
+ endTimestamp: number;
2104
+ campaign: string;
2105
+ distributionChainId: number;
2106
+ amount: string;
2107
+ rewardToken: string;
2108
+ program: string;
2109
+ };
2110
+ fetch?: RequestInit | undefined;
2111
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2112
+ [x: string]: any;
2113
+ 200: any;
2114
+ }>>;
2115
+ };
2116
+ config: {
2117
+ get: (options: {
2118
+ headers?: Record<string, unknown> | undefined;
2119
+ query: {
2120
+ creator: string;
2121
+ startTimestamp: number;
2122
+ endTimestamp: number;
2123
+ campaign: string;
2124
+ distributionChainId: number;
2125
+ amount: string;
2126
+ rewardToken: string;
2127
+ program: string;
2128
+ };
2129
+ fetch?: RequestInit | undefined;
2130
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2131
+ [x: string]: any;
2132
+ 200: any;
2133
+ }>>;
2134
+ };
2135
+ program: {
2136
+ get: (options: {
2137
+ headers?: Record<string, unknown> | undefined;
2138
+ query: {
2139
+ creator: string;
2140
+ startTimestamp: number;
2141
+ endTimestamp: number;
2142
+ distributionChainId: number;
2143
+ amount: string;
2144
+ rewardToken: string;
2145
+ program: string;
2146
+ };
2147
+ fetch?: RequestInit | undefined;
2148
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2149
+ [x: string]: any;
2150
+ 200: any;
2151
+ }>>;
2152
+ };
2153
+ };
2095
2154
  };
2096
2155
  v3: {
2097
2156
  app: {
@@ -2824,7 +2883,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2824
2883
  post: {
2825
2884
  body: {
2826
2885
  name?: string | undefined;
2827
- type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4";
2886
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER";
2828
2887
  tokens: {
2829
2888
  chainId: number;
2830
2889
  address: string;
@@ -3371,7 +3430,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3371
3430
  body: unknown;
3372
3431
  params: {};
3373
3432
  query: {
3374
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
3433
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
3375
3434
  items?: number | undefined;
3376
3435
  subType?: number | undefined;
3377
3436
  page?: number | undefined;
@@ -3443,7 +3502,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3443
3502
  body: unknown;
3444
3503
  params: {};
3445
3504
  query: {
3446
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
3505
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
3447
3506
  items?: number | undefined;
3448
3507
  subType?: number | undefined;
3449
3508
  page?: number | undefined;
@@ -5129,6 +5188,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5129
5188
  cardName: string;
5130
5189
  blacklistedSupply: number;
5131
5190
  priceTargetToken: number;
5191
+ type: string;
5132
5192
  };
5133
5193
  };
5134
5194
  };
@@ -5284,6 +5344,79 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5284
5344
  };
5285
5345
  };
5286
5346
  };
5347
+ } & {
5348
+ v4: {
5349
+ "program-payload": {
5350
+ index: {
5351
+ get: {
5352
+ body: unknown;
5353
+ params: {};
5354
+ query: {
5355
+ creator: string;
5356
+ startTimestamp: number;
5357
+ endTimestamp: number;
5358
+ campaign: string;
5359
+ distributionChainId: number;
5360
+ amount: string;
5361
+ rewardToken: string;
5362
+ program: string;
5363
+ };
5364
+ headers: unknown;
5365
+ response: {
5366
+ [x: string]: any;
5367
+ 200: any;
5368
+ };
5369
+ };
5370
+ };
5371
+ };
5372
+ } & {
5373
+ "program-payload": {
5374
+ config: {
5375
+ get: {
5376
+ body: unknown;
5377
+ params: {};
5378
+ query: {
5379
+ creator: string;
5380
+ startTimestamp: number;
5381
+ endTimestamp: number;
5382
+ campaign: string;
5383
+ distributionChainId: number;
5384
+ amount: string;
5385
+ rewardToken: string;
5386
+ program: string;
5387
+ };
5388
+ headers: unknown;
5389
+ response: {
5390
+ [x: string]: any;
5391
+ 200: any;
5392
+ };
5393
+ };
5394
+ };
5395
+ };
5396
+ } & {
5397
+ "program-payload": {
5398
+ program: {
5399
+ get: {
5400
+ body: unknown;
5401
+ params: {};
5402
+ query: {
5403
+ creator: string;
5404
+ startTimestamp: number;
5405
+ endTimestamp: number;
5406
+ distributionChainId: number;
5407
+ amount: string;
5408
+ rewardToken: string;
5409
+ program: string;
5410
+ };
5411
+ headers: unknown;
5412
+ response: {
5413
+ [x: string]: any;
5414
+ 200: any;
5415
+ };
5416
+ };
5417
+ };
5418
+ };
5419
+ };
5287
5420
  } & {
5288
5421
  v3: {
5289
5422
  app: {
@@ -6414,7 +6547,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6414
6547
  index: {
6415
6548
  post: (body: {
6416
6549
  name?: string | undefined;
6417
- type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4";
6550
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER";
6418
6551
  tokens: {
6419
6552
  chainId: number;
6420
6553
  address: string;
@@ -6635,7 +6768,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6635
6768
  get: (options: {
6636
6769
  headers?: Record<string, unknown> | undefined;
6637
6770
  query: {
6638
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
6771
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
6639
6772
  items?: number | undefined;
6640
6773
  subType?: number | undefined;
6641
6774
  page?: number | undefined;
@@ -6704,7 +6837,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6704
6837
  get: (options: {
6705
6838
  headers?: Record<string, unknown> | undefined;
6706
6839
  query: {
6707
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
6840
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
6708
6841
  items?: number | undefined;
6709
6842
  subType?: number | undefined;
6710
6843
  page?: number | undefined;
@@ -8018,6 +8151,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8018
8151
  cardName: string;
8019
8152
  blacklistedSupply: number;
8020
8153
  priceTargetToken: number;
8154
+ type: string;
8021
8155
  };
8022
8156
  }>>;
8023
8157
  };
@@ -8135,6 +8269,64 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
8135
8269
  })[];
8136
8270
  }>>;
8137
8271
  }) & {};
8272
+ "program-payload": {
8273
+ index: {
8274
+ get: (options: {
8275
+ headers?: Record<string, unknown> | undefined;
8276
+ query: {
8277
+ creator: string;
8278
+ startTimestamp: number;
8279
+ endTimestamp: number;
8280
+ campaign: string;
8281
+ distributionChainId: number;
8282
+ amount: string;
8283
+ rewardToken: string;
8284
+ program: string;
8285
+ };
8286
+ fetch?: RequestInit | undefined;
8287
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
8288
+ [x: string]: any;
8289
+ 200: any;
8290
+ }>>;
8291
+ };
8292
+ config: {
8293
+ get: (options: {
8294
+ headers?: Record<string, unknown> | undefined;
8295
+ query: {
8296
+ creator: string;
8297
+ startTimestamp: number;
8298
+ endTimestamp: number;
8299
+ campaign: string;
8300
+ distributionChainId: number;
8301
+ amount: string;
8302
+ rewardToken: string;
8303
+ program: string;
8304
+ };
8305
+ fetch?: RequestInit | undefined;
8306
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
8307
+ [x: string]: any;
8308
+ 200: any;
8309
+ }>>;
8310
+ };
8311
+ program: {
8312
+ get: (options: {
8313
+ headers?: Record<string, unknown> | undefined;
8314
+ query: {
8315
+ creator: string;
8316
+ startTimestamp: number;
8317
+ endTimestamp: number;
8318
+ distributionChainId: number;
8319
+ amount: string;
8320
+ rewardToken: string;
8321
+ program: string;
8322
+ };
8323
+ fetch?: RequestInit | undefined;
8324
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
8325
+ [x: string]: any;
8326
+ 200: any;
8327
+ }>>;
8328
+ };
8329
+ };
8138
8330
  };
8139
8331
  v3: {
8140
8332
  app: {
@@ -211,6 +211,7 @@ export const extractOpportunities = {
211
211
  "koi",
212
212
  "pancakeswap",
213
213
  "tempest",
214
+ "cross_curve",
214
215
  ],
215
216
  borrow: ["radiant_borrow", "aave_borrowing", "euler_borrow"],
216
217
  lend: [
@@ -344,7 +345,7 @@ export const extractOpportunities = {
344
345
  return opportunity;
345
346
  },
346
347
  [Campaign.BADGER]: (campaign, campaigns, prices) => {
347
- const { chainId, tvl, campaignSubType, campaignParameters: params, computeChainId } = campaign;
348
+ const { chainId, tvl, campaignParameters: params, computeChainId } = campaign;
348
349
  const { active, all } = campaigns;
349
350
  const aprBreakdown = active.reduce((res, campaign) => {
350
351
  res[`Campaign ${campaign.campaignId.slice(0, 8)}`] = {
@@ -378,6 +379,41 @@ export const extractOpportunities = {
378
379
  };
379
380
  return opportunity;
380
381
  },
382
+ [Campaign.EIGENLAYER]: (campaign, campaigns, prices) => {
383
+ const { chainId, tvl, campaignParameters: params, computeChainId } = campaign;
384
+ const { active, all } = campaigns;
385
+ const aprBreakdown = active.reduce((res, campaign) => {
386
+ res[`Campaign ${campaign.campaignId.slice(0, 8)}`] = {
387
+ value: campaign.apr ?? 0,
388
+ address: campaign.campaignId,
389
+ type: EAprBreakdownType.DETAILS,
390
+ };
391
+ return res;
392
+ }, {});
393
+ // @Hugo WIP todo for aprBreakdown2
394
+ const aprBreakdown2 = getCampaignsApr(active);
395
+ const opportunity = {
396
+ id: `${Campaign.EIGENLAYER}_${campaign.mainParameter}`,
397
+ platform: "EigenLayer strategy",
398
+ name: ["EigenLayer", "strategy for", params.symbolUnderlyingToken].join(" "),
399
+ chainId: !computeChainId ? chainId : computeChainId,
400
+ distributionChainId: chainId,
401
+ tvl,
402
+ action: "lend",
403
+ subtype: 0,
404
+ status: getStatus(all),
405
+ tags: getTags(campaigns.all),
406
+ dailyrewards: getDailyRewards(active, prices),
407
+ tokenIcons: [params.symbolUnderlyingToken],
408
+ campaigns: { ...campaigns, type: Campaign.EIGENLAYER, ids: campaigns.all.map(c => c.campaignId) },
409
+ rewardTokenIcons: getRewardTokenIcons(campaigns.active),
410
+ dailyRewardTokens: getRewardTokens(campaigns.active),
411
+ apr: getApr(active),
412
+ aprBreakdown,
413
+ aprBreakdown2,
414
+ };
415
+ return opportunity;
416
+ },
381
417
  [Campaign.AJNA]: (campaign, campaigns, prices) => {
382
418
  const { chainId, tvl, campaignSubType, campaignParameters: params, computeChainId } = campaign;
383
419
  const { active, all } = campaigns;
@@ -148,7 +148,7 @@ declare const app: Elysia<"", false, {
148
148
  post: {
149
149
  body: {
150
150
  name?: string | undefined;
151
- type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4";
151
+ type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER";
152
152
  tokens: {
153
153
  chainId: number;
154
154
  address: string;
@@ -695,7 +695,7 @@ declare const app: Elysia<"", false, {
695
695
  body: unknown;
696
696
  params: {};
697
697
  query: {
698
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
698
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
699
699
  items?: number | undefined;
700
700
  subType?: number | undefined;
701
701
  page?: number | undefined;
@@ -767,7 +767,7 @@ declare const app: Elysia<"", false, {
767
767
  body: unknown;
768
768
  params: {};
769
769
  query: {
770
- type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | undefined;
770
+ type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
771
771
  items?: number | undefined;
772
772
  subType?: number | undefined;
773
773
  page?: number | undefined;
@@ -2453,6 +2453,7 @@ declare const app: Elysia<"", false, {
2453
2453
  cardName: string;
2454
2454
  blacklistedSupply: number;
2455
2455
  priceTargetToken: number;
2456
+ type: string;
2456
2457
  };
2457
2458
  };
2458
2459
  };
@@ -2608,6 +2609,79 @@ declare const app: Elysia<"", false, {
2608
2609
  };
2609
2610
  };
2610
2611
  };
2612
+ } & {
2613
+ v4: {
2614
+ "program-payload": {
2615
+ index: {
2616
+ get: {
2617
+ body: unknown;
2618
+ params: {};
2619
+ query: {
2620
+ creator: string;
2621
+ startTimestamp: number;
2622
+ endTimestamp: number;
2623
+ campaign: string;
2624
+ distributionChainId: number;
2625
+ amount: string;
2626
+ rewardToken: string;
2627
+ program: string;
2628
+ };
2629
+ headers: unknown;
2630
+ response: {
2631
+ [x: string]: any;
2632
+ 200: any;
2633
+ };
2634
+ };
2635
+ };
2636
+ };
2637
+ } & {
2638
+ "program-payload": {
2639
+ config: {
2640
+ get: {
2641
+ body: unknown;
2642
+ params: {};
2643
+ query: {
2644
+ creator: string;
2645
+ startTimestamp: number;
2646
+ endTimestamp: number;
2647
+ campaign: string;
2648
+ distributionChainId: number;
2649
+ amount: string;
2650
+ rewardToken: string;
2651
+ program: string;
2652
+ };
2653
+ headers: unknown;
2654
+ response: {
2655
+ [x: string]: any;
2656
+ 200: any;
2657
+ };
2658
+ };
2659
+ };
2660
+ };
2661
+ } & {
2662
+ "program-payload": {
2663
+ program: {
2664
+ get: {
2665
+ body: unknown;
2666
+ params: {};
2667
+ query: {
2668
+ creator: string;
2669
+ startTimestamp: number;
2670
+ endTimestamp: number;
2671
+ distributionChainId: number;
2672
+ amount: string;
2673
+ rewardToken: string;
2674
+ program: string;
2675
+ };
2676
+ headers: unknown;
2677
+ response: {
2678
+ [x: string]: any;
2679
+ 200: any;
2680
+ };
2681
+ };
2682
+ };
2683
+ };
2684
+ };
2611
2685
  } & {
2612
2686
  v3: {
2613
2687
  app: {
@@ -60,7 +60,8 @@ export declare enum tokenType {
60
60
  holdstation = "holdstation",
61
61
  staking = "staking",
62
62
  noLinkVault = "noLinkVault",
63
- cpmmGamma = "cpmmGamma"
63
+ cpmmGamma = "cpmmGamma",
64
+ crosscurve = "crosscurve"
64
65
  }
65
66
  export declare const tokenTypeToProtocol: {
66
67
  [key in tokenType]: {
@@ -62,6 +62,7 @@ export var tokenType;
62
62
  tokenType["staking"] = "staking";
63
63
  tokenType["noLinkVault"] = "noLinkVault";
64
64
  tokenType["cpmmGamma"] = "cpmmGamma";
65
+ tokenType["crosscurve"] = "crosscurve";
65
66
  })(tokenType || (tokenType = {}));
66
67
  export const tokenTypeToProtocol = {
67
68
  [tokenType.aave_borrowing]: { protocol: "Aave" },
@@ -151,4 +152,7 @@ export const tokenTypeToProtocol = {
151
152
  [tokenType.cpmmGamma]: {
152
153
  protocol: "GammaSwap",
153
154
  },
155
+ [tokenType.crosscurve]: {
156
+ protocol: "CrossCurve",
157
+ },
154
158
  };
@@ -0,0 +1,39 @@
1
+ import type { Pricer } from "../../../../../utils/pricer";
2
+ import { type Campaign, type CampaignParameters } from "@sdk";
3
+ import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
4
+ import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
+ type callType = {
6
+ key: keyof dataRawCurveN;
7
+ call: string;
8
+ target: keyof callKeysCurveN;
9
+ metaData?: keyof callKeysCurveN | string;
10
+ optional?: boolean;
11
+ };
12
+ type callKeysCurveN = mandatoryCallKeys & {
13
+ [key: `token${number}`]: string;
14
+ [key: `symbolToken${number}`]: string;
15
+ [key: `decimalsToken${number}`]: string;
16
+ [key: `balanceToken${number}`]: string;
17
+ [key: `${number}`]: string;
18
+ name: string;
19
+ };
20
+ type dataRawCurveN = callKeysCurveN & {
21
+ numberTokens: number;
22
+ };
23
+ type dataTypeCurveN = dataType & {
24
+ numberTokens: number;
25
+ };
26
+ export declare class CurveNPoolProcessor extends GenericProcessor<callKeysCurveN, dataRawCurveN, dataTypeCurveN> {
27
+ rounds: {
28
+ round1: callType[];
29
+ round2: callType[];
30
+ round3: callType[];
31
+ round4: callType[];
32
+ };
33
+ processingRound2(typeInfo: dataRawCurveN): void;
34
+ processingRound3(typeInfo: dataRawCurveN): void;
35
+ computeRound3(index: number, type: tokenType, typeInfo: dataRawCurveN, calls: string[]): tokenTypeStruct;
36
+ computeRound4(index: number, type: tokenType, typeInfo: dataRawCurveN, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>): tokenTypeStruct;
37
+ processingRound5(_index: number, type: tokenType, typeInfo: dataRawCurveN, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeCurveN>;
38
+ }
39
+ export {};
@@ -0,0 +1,81 @@
1
+ import { generateCardName } from "../../../../../utils/generateCardName";
2
+ import { BN2Number } from "@sdk";
3
+ import { GenericProcessor } from "./GenericProcessor";
4
+ export class CurveNPoolProcessor extends GenericProcessor {
5
+ rounds = {
6
+ round1: [{ key: "numberTokens", call: "N_COINS", target: "tokenAddress" }],
7
+ round2: [],
8
+ round3: [],
9
+ round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
10
+ };
11
+ // override computeRound1(): void {}
12
+ processingRound2(typeInfo) {
13
+ typeInfo.numberTokens = Number(typeInfo.numberTokens);
14
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
15
+ typeInfo[`${i}`] = i.toString();
16
+ this.rounds.round2 = this.rounds.round2.concat([
17
+ { key: `token${i}`, call: "coins", target: "tokenAddress", metaData: i.toString() },
18
+ ]);
19
+ }
20
+ }
21
+ processingRound3(typeInfo) {
22
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
23
+ this.rounds.round3 = this.rounds.round3.concat([
24
+ { key: `symbolToken${i}`, call: "symbol", target: `token${i}` },
25
+ { key: `decimalsToken${i}`, call: "decimals", target: `token${i}` },
26
+ { key: `balanceToken${i}`, call: "balances", target: "tokenAddress", metaData: i.toString() },
27
+ ]);
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: `token${i}`, call: "coins", target: "tokenAddress", metaData: i.toString() },
34
+ ]);
35
+ }
36
+ return super.computeRound3(index, type, typeInfo, calls);
37
+ }
38
+ computeRound4(index, type, typeInfo, calls, campaign) {
39
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
40
+ this.rounds.round3 = this.rounds.round3.concat([
41
+ { key: `symbolToken${i}`, call: "symbol", target: `token${i}` },
42
+ { key: `decimalsToken${i}`, call: "decimals", target: `token${i}` },
43
+ { key: `balanceToken${i}`, call: "balances", target: "tokenAddress", metaData: i.toString() },
44
+ ]);
45
+ }
46
+ return super.computeRound4(index, type, typeInfo, calls, campaign);
47
+ }
48
+ async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
49
+ const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
50
+ let tvl = 0;
51
+ // Hardocded in case we don't find it
52
+ let hardcodedSymbol = "unknown";
53
+ if (typeInfo.name.includes("BTC"))
54
+ hardcodedSymbol = "BTC";
55
+ if (typeInfo.name.includes("ETH"))
56
+ hardcodedSymbol = "ETH";
57
+ if (typeInfo.name.includes("STABLE"))
58
+ hardcodedSymbol = "USDC";
59
+ for (let i = 0; i < typeInfo.numberTokens; i++) {
60
+ const symbol = typeInfo[`symbolToken${i}`];
61
+ const parsedSymbol = symbol.split("_")[0].slice(1);
62
+ let price = (await pricer.get({ symbol: parsedSymbol })) ?? 0;
63
+ if (price === 0) {
64
+ price = (await pricer.get({ symbol: hardcodedSymbol })) ?? 0;
65
+ }
66
+ const decimals = Number(typeInfo[`decimalsToken${i}`]);
67
+ const amount = BN2Number(typeInfo[`balanceToken${i}`], decimals);
68
+ tvl += amount * price;
69
+ }
70
+ const priceTargetToken = tvl / totalSupply;
71
+ return {
72
+ ...typeInfo,
73
+ totalSupply,
74
+ tvl,
75
+ whitelistedSupplyTargetToken,
76
+ blacklistedSupply,
77
+ priceTargetToken,
78
+ cardName: generateCardName(type, typeInfo, campaign),
79
+ };
80
+ }
81
+ }
@@ -30,6 +30,7 @@ import { TorosProcessor } from "./TorosProcessor";
30
30
  import { UniswapProcessor } from "./UniswapProcessor";
31
31
  import { WoofiProcessor } from "./WoofiProcessor";
32
32
  import { ZkSwapThreePoolProcessor } from "./ZkSwapThreePoolProcessor";
33
+ import { CurveNPoolProcessor } from "./curveNPoolProcessor";
33
34
  import { CurveProcessor } from "./curveProcessor";
34
35
  import { StakedCurveProcessor } from "./stakedCurveProcessor";
35
36
  export const processorMapping = {
@@ -72,6 +73,7 @@ export const processorMapping = {
72
73
  [tokenType.filament]: FluidProcessor,
73
74
  [tokenType.enzyme]: EnzymeProcessor,
74
75
  [tokenType.curve_2]: CurveProcessor,
76
+ [tokenType.crosscurve]: CurveNPoolProcessor,
75
77
  [tokenType.fenix]: UniswapProcessor,
76
78
  [tokenType.euler_lend]: EulerLendProcessor,
77
79
  [tokenType.euler_borrow]: EulerBorrowProcessor,
@@ -44,6 +44,8 @@ function satisfiesNameConditions(name, type) {
44
44
  lowerCaseName === "ezeth/wfrxeth" ||
45
45
  lowerCaseName === "pufeth/wsteth" ||
46
46
  lowerCaseName === "hai/lusd");
47
+ case tokenType.crosscurve:
48
+ return lowerCaseName.startsWith("crosscurve");
47
49
  case tokenType.silostaking:
48
50
  return lowerCaseName === "isei";
49
51
  case tokenType.beefy:
@@ -0,0 +1,3 @@
1
+ import { type Campaign, type CampaignDynamicData, type CampaignParameters, type MerklChainId } from "@sdk";
2
+ import type { UncachedResult } from "../../../utils/execute";
3
+ export declare function EigenLayerDynamicData(_chainId: MerklChainId, campaigns: CampaignParameters<Campaign.EIGENLAYER>[]): Promise<UncachedResult<Partial<CampaignDynamicData<Campaign.EIGENLAYER>[]>>>;