@merkl/api 0.10.167 → 0.10.169

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. package/dist/src/cache/declaration.d.ts +0 -30
  2. package/dist/src/cache/declaration.js +0 -30
  3. package/dist/src/eden/index.d.ts +59 -12
  4. package/dist/src/index.d.ts +23 -4
  5. package/dist/src/libs/campaigns/campaignTypes/CLAMMDynamicData.js +2 -2
  6. package/dist/src/libs/positions/clamm/index.d.ts +1 -2
  7. package/dist/src/libs/positions/clamm/index.js +322 -330
  8. package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.d.ts +1 -1
  9. package/dist/src/libs/positions/clamm/thegraph/fetchAlmPositions.js +1 -1
  10. package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.d.ts +1 -1
  11. package/dist/src/libs/positions/clamm/thegraph/fetchAmmPositions.js +2 -2
  12. package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.d.ts +1 -2
  13. package/dist/src/libs/positions/clamm/thegraph/fetchFarmedPositions.js +1 -4
  14. package/dist/src/libs/positions/euler/index.js +2 -3
  15. package/dist/src/libs/positions/index.js +1 -1
  16. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +2 -2
  17. package/dist/src/modules/v4/campaign/campaign.service.d.ts +6 -5
  18. package/dist/src/modules/v4/campaign/campaign.service.js +10 -2
  19. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +2 -2
  20. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +159 -0
  21. package/dist/src/modules/v4/opportunity/opportunity.repository.js +29 -0
  22. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +131 -3
  23. package/dist/src/modules/v4/opportunity/opportunity.service.js +11 -0
  24. package/dist/src/modules/v4/position/implementations/AjnaPositionFetcher.d.ts +6 -0
  25. package/dist/src/modules/v4/position/implementations/AjnaPositionFetcher.js +90 -0
  26. package/dist/src/modules/v4/position/implementations/BadgerPositionFetcher.d.ts +6 -0
  27. package/dist/src/modules/v4/position/implementations/BadgerPositionFetcher.js +69 -0
  28. package/dist/src/modules/v4/position/implementations/ClammPositionFetcher.d.ts +6 -0
  29. package/dist/src/modules/v4/position/implementations/ClammPositionFetcher.js +71 -0
  30. package/dist/src/modules/v4/position/implementations/DolomitePositionFetcher.d.ts +6 -0
  31. package/dist/src/modules/v4/position/implementations/DolomitePositionFetcher.js +45 -0
  32. package/dist/src/modules/v4/position/implementations/ERC20PositionFetcher.d.ts +6 -0
  33. package/dist/src/modules/v4/position/implementations/ERC20PositionFetcher.js +47 -0
  34. package/dist/src/modules/v4/position/implementations/EulerPositionFetcher.d.ts +6 -0
  35. package/dist/src/modules/v4/position/implementations/EulerPositionFetcher.js +40 -0
  36. package/dist/src/modules/v4/position/index.d.ts +2 -0
  37. package/dist/src/modules/v4/position/index.js +2 -0
  38. package/dist/src/modules/v4/position/position.controller.d.ts +39 -0
  39. package/dist/src/modules/v4/position/position.controller.js +16 -0
  40. package/dist/src/modules/v4/position/position.model.d.ts +25 -0
  41. package/dist/src/modules/v4/position/position.model.js +5 -0
  42. package/dist/src/modules/v4/position/position.repository.d.ts +14 -0
  43. package/dist/src/modules/v4/position/position.repository.js +6 -0
  44. package/dist/src/modules/v4/position/position.service.d.ts +5 -0
  45. package/dist/src/modules/v4/position/position.service.js +34 -0
  46. package/dist/src/modules/v4/reward/reward.service.d.ts +5 -0
  47. package/dist/src/modules/v4/reward/reward.service.js +5 -2
  48. package/dist/src/modules/v4/router.d.ts +23 -4
  49. package/dist/src/modules/v4/router.js +3 -1
  50. package/dist/src/routes/v1/prices.js +2 -4
  51. package/dist/src/routes/v3/blacklist.d.ts +23 -4
  52. package/dist/src/routes/v3/campaigns.d.ts +24 -5
  53. package/dist/src/routes/v3/campaignsInfo.d.ts +23 -4
  54. package/dist/src/routes/v3/multiChainPositions.d.ts +23 -4
  55. package/dist/src/routes/v3/opportunity.d.ts +23 -4
  56. package/dist/src/routes/v3/positions.d.ts +23 -4
  57. package/dist/src/routes/v3/recipients.d.ts +6 -2
  58. package/dist/src/routes/v3/recipients.js +14 -8
  59. package/dist/src/routes/v3/rewards.d.ts +23 -4
  60. package/dist/src/routes/v3/updates.d.ts +23 -4
  61. package/dist/src/routes/v3/userRewards.d.ts +23 -4
  62. package/dist/src/utils/prices/services/erc4626Service.js +4 -4
  63. package/dist/tsconfig.package.tsbuildinfo +1 -1
  64. package/package.json +1 -1
  65. package/dist/src/libs/reports/campaignReport.d.ts +0 -9
  66. package/dist/src/libs/reports/campaignReport.js +0 -37
  67. package/dist/src/libs/reports/mainParameterRewards.d.ts +0 -3
  68. package/dist/src/libs/reports/mainParameterRewards.js +0 -48
@@ -268,7 +268,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
268
268
  tvl: number;
269
269
  apr: number;
270
270
  dailyRewards: number;
271
- campaigns: ({
271
+ campaigns: {
272
272
  params: any;
273
273
  chain: {
274
274
  name: string;
@@ -311,7 +311,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
311
311
  amount: string;
312
312
  opportunityId: string;
313
313
  creatorAddress: string;
314
- } | null)[];
314
+ }[];
315
315
  } | null | undefined;
316
316
  };
317
317
  };
@@ -553,7 +553,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
553
553
  };
554
554
  headers: unknown;
555
555
  response: {
556
- 200: ({
556
+ 200: {
557
557
  params: any;
558
558
  chain: {
559
559
  name: string;
@@ -596,7 +596,7 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
596
596
  amount: string;
597
597
  opportunityId: string;
598
598
  creatorAddress: string;
599
- } | null)[];
599
+ }[];
600
600
  };
601
601
  };
602
602
  };
@@ -2221,6 +2221,25 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
2221
2221
  };
2222
2222
  };
2223
2223
  };
2224
+ } & {
2225
+ v4: {
2226
+ positions: {
2227
+ index: {
2228
+ get: {
2229
+ body: unknown;
2230
+ params: {};
2231
+ query: {
2232
+ chainId: number;
2233
+ address: string;
2234
+ };
2235
+ headers: unknown;
2236
+ response: {
2237
+ 200: any[];
2238
+ };
2239
+ };
2240
+ };
2241
+ };
2242
+ };
2224
2243
  } & {
2225
2244
  index: {
2226
2245
  get: {
@@ -1,6 +1,6 @@
1
+ import { PriceService } from "../../../modules/v4/price";
1
2
  import { PriceSourceMethod } from "../../../../database/api/.generated";
2
3
  import { log } from "../../logger";
3
- import PriceService from "../priceService";
4
4
  import { getERC4626Price } from "./getERC4626";
5
5
  export default class ERC4626Service {
6
6
  static instance = new ERC4626Service();
@@ -14,7 +14,7 @@ export default class ERC4626Service {
14
14
  return log.warn(`❌ ERC4626Service ticker not found for ${token.symbol}`);
15
15
  const rate = await getERC4626Price(args.chainId, args.address, args.decimals, args.vaultDecimals);
16
16
  // 2 returned tokens as stUSD and STUSD (business requirement)
17
- const price = this.priceCalculation(rate, args.vaultToken);
17
+ const price = await this.priceCalculation(rate, args.vaultToken);
18
18
  const res = [
19
19
  { token: token.symbol, rate: price },
20
20
  { token: token.symbol.toUpperCase(), rate: price },
@@ -24,7 +24,7 @@ export default class ERC4626Service {
24
24
  const resolvedPrices = await Promise.all(pricePromises);
25
25
  return resolvedPrices.flat().filter(price => price !== undefined);
26
26
  }
27
- priceCalculation(rate, vaultToken) {
28
- return rate * PriceService.instance.prices[vaultToken];
27
+ async priceCalculation(rate, vaultToken) {
28
+ return rate * (await PriceService.fetchPriceSourceBySymbol(vaultToken));
29
29
  }
30
30
  }