@merkl/api 0.10.224 → 0.10.226

Sign up to get free protection for your applications and to get access to all the features.
@@ -771,6 +771,7 @@ declare const eden: {
771
771
  items?: number | undefined;
772
772
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
773
773
  page?: number | undefined;
774
+ opportunityTag?: string | undefined;
774
775
  };
775
776
  fetch?: RequestInit | undefined;
776
777
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -3598,6 +3599,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3598
3599
  items?: number | undefined;
3599
3600
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
3600
3601
  page?: number | undefined;
3602
+ opportunityTag?: string | undefined;
3601
3603
  };
3602
3604
  headers: unknown;
3603
3605
  response: {
@@ -6957,6 +6959,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6957
6959
  items?: number | undefined;
6958
6960
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
6959
6961
  page?: number | undefined;
6962
+ opportunityTag?: string | undefined;
6960
6963
  };
6961
6964
  fetch?: RequestInit | undefined;
6962
6965
  }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
@@ -858,6 +858,7 @@ declare const app: Elysia<"", false, {
858
858
  items?: number | undefined;
859
859
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
860
860
  page?: number | undefined;
861
+ opportunityTag?: string | undefined;
861
862
  };
862
863
  headers: unknown;
863
864
  response: {
@@ -67,7 +67,10 @@ export async function CLAMMDynamicData(chainId, campaigns) {
67
67
  A51Strategies = await fetchA51Strategies(chainId, [...new Set(A51Pools)]);
68
68
  }
69
69
  for (const pool of poolList) {
70
- const poolInterface = PoolInterface[AMMAlgorithmMapping[pool.amm]];
70
+ let poolInterface = PoolInterface[AMMAlgorithmMapping[pool.amm]];
71
+ if (pool.amm === AMM.SyncswapV3) {
72
+ poolInterface = PoolInterface[AMMAlgorithm.Neptune];
73
+ }
71
74
  const d = campaigns?.filter(campaign => campaign.mainParameter.toLowerCase() === pool.mainParameter.toLowerCase())[0];
72
75
  calls.push({
73
76
  allowFailure: true,
@@ -284,7 +287,10 @@ export async function CLAMMDynamicData(chainId, campaigns) {
284
287
  let i = 0;
285
288
  if (!!poolList) {
286
289
  for (const pool of poolList) {
287
- const poolInterface = PoolInterface[AMMAlgorithmMapping[pool.amm]];
290
+ let poolInterface = PoolInterface[AMMAlgorithmMapping[pool.amm]];
291
+ if (pool.amm === AMM.SyncswapV3) {
292
+ poolInterface = PoolInterface[AMMAlgorithm.Neptune];
293
+ }
288
294
  // This liquidity call gives the active liquidity on the pool. To get the total liquidity we would need to loop over all positions
289
295
  let poolTotalLiquidity;
290
296
  let sqrtPrice;
@@ -22,6 +22,7 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
22
22
  items?: number | undefined;
23
23
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
24
24
  page?: number | undefined;
25
+ opportunityTag?: string | undefined;
25
26
  };
26
27
  headers: unknown;
27
28
  response: {
@@ -5,7 +5,7 @@ import type { Resource } from "../prisma";
5
5
  * @see {@link Resource}
6
6
  */
7
7
  export type Protocol = Resource<"Protocol">;
8
- declare const protocolTypes: readonly ["arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "uniswap-v3", "voltage", "zero", "koi", "supswap-v3", "zkswap", "thirdtrade", "uniswap-v2", "velodrome", "aerodrome", "balancer", "curve", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "eigenlayer"];
8
+ declare const protocolTypes: readonly ["arthswap", "baseswap", "camelot", "crust", "fenix", "horiza", "izumi", "kim", "pancakeswap-v3", "quickswap-algebra", "quickswap-uni", "ramses", "retro", "stryke", "stryke-pcs", "stryke-sushi", "sushiswap-v3", "swapr", "thruster", "uniswap-v3", "voltage", "zero", "koi", "supswap-v3", "zkswap", "thirdtrade", "uniswap-v2", "velodrome", "aerodrome", "balancer", "curve", "aura", "akron", "beefy", "dragonswap", "poolside", "koi", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "eigenlayer", "syncswap-v3", "neptune"];
9
9
  export type ProtocolId = (typeof protocolTypes)[number];
10
10
  export declare const ProtocolResourceDto: import("@sinclair/typebox").TObject<{
11
11
  id: import("@sinclair/typebox").TString;
@@ -30,6 +30,7 @@ export declare const GetProtocolsQueryDto: import("@sinclair/typebox").TObject<{
30
30
  LENDING: "LENDING";
31
31
  PERPETUAL: "PERPETUAL";
32
32
  }>>>;
33
+ opportunityTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
33
34
  page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
34
35
  items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
35
36
  }>;
@@ -60,6 +60,8 @@ const protocolTypes = [
60
60
  "layerbank",
61
61
  "ion",
62
62
  "eigenlayer",
63
+ "syncswap-v3",
64
+ "neptune",
63
65
  ];
64
66
  // ─── DTOs ────────────────────────────────────────────────────────────────────
65
67
  export const ProtocolResourceDto = t.Object({
@@ -73,6 +75,7 @@ export const ProtocolResourceDto = t.Object({
73
75
  export const GetProtocolsQueryDto = t.Object({
74
76
  id: t.Optional(t.String({ description: "Filter results by name. Useful for searching a protocol to verify its integration" })),
75
77
  tags: t.Optional(t.Array(t.Enum(ProtocolTag, { description: "Filter by protocol tag" }))),
78
+ opportunityTag: t.Optional(t.String({ description: "Filter by underlying opportunities' tag" })),
76
79
  page: t.Optional(t.Numeric({ description: "0-indexed page number", default: 0 })),
77
80
  items: t.Optional(t.Numeric({ description: "Number of items returned by page", default: 20 })), // items per page
78
81
  });
@@ -24,6 +24,15 @@ export class ProtocolRepository {
24
24
  where: {
25
25
  id: query.id ? { contains: query.id, mode: "insensitive" } : undefined,
26
26
  tags: query.tags ? { hasEvery: query.tags } : undefined,
27
+ Opportunities: query.opportunityTag
28
+ ? {
29
+ some: {
30
+ tags: {
31
+ has: query.opportunityTag,
32
+ },
33
+ },
34
+ }
35
+ : undefined,
27
36
  // id: typeof query.id === "string" ? query.id : !!query.id ? { in: query.id } : undefined,
28
37
  },
29
38
  };
@@ -34,6 +34,8 @@ export class ProtocolService {
34
34
  [AMMV3.AERODROME]: "aerodrome",
35
35
  [AMMV3.zkSwap]: "zkswap",
36
36
  [AMMV3.ThirdTrade]: "thirdtrade",
37
+ [AMMV3.SyncswapV3]: "syncswap-v3",
38
+ [AMMV3.Neptune]: "neptune",
37
39
  }[amm];
38
40
  }
39
41
  static async findMany(query) {
@@ -736,6 +736,7 @@ export declare const v4: Elysia<"/v4", false, {
736
736
  items?: number | undefined;
737
737
  tags?: ("AMM" | "ALM" | "DEX" | "LENDING" | "PERPETUAL")[] | undefined;
738
738
  page?: number | undefined;
739
+ opportunityTag?: string | undefined;
739
740
  };
740
741
  headers: unknown;
741
742
  response: {