@merkl/api 0.10.262 → 0.10.264
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/database/api/.generated/edge.js +6 -4
- package/dist/database/api/.generated/index-browser.js +3 -1
- package/dist/database/api/.generated/index.d.ts +3 -1
- package/dist/database/api/.generated/index.js +6 -4
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +2 -0
- package/dist/database/api/.generated/wasm.js +3 -1
- package/dist/database/api/seeder/resources/protocol.d.ts +7 -0
- package/dist/database/api/seeder/resources/protocol.js +1 -0
- package/dist/src/backgroundJobs/jobs/campaignsCacheUpdater.js +0 -4
- package/dist/src/eden/index.d.ts +15 -15
- package/dist/src/entities/opportunity.js +35 -0
- package/dist/src/index.d.ts +5 -5
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/UniswapProcessor.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/UniswapProcessor.js +16 -0
- package/dist/src/libs/campaigns/campaignTypes/SILODynamicData.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/SILODynamicData.js +6 -4
- package/dist/src/libs/campaigns/campaignTypes/VestDynamicData.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/VestDynamicData.js +61 -0
- package/dist/src/libs/campaigns/campaignsDynamicData.js +4 -0
- package/dist/src/libs/positions/prepareFetch.js +26 -0
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +2 -2
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +3 -0
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +3 -3
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +5 -5
- package/dist/src/modules/v4/opportunity/opportunity.service.js +16 -6
- package/dist/src/modules/v4/opportunity/subservices/getIonMetadata.service.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getIonMetadata.service.js +13 -0
- package/dist/src/modules/v4/opportunity/subservices/getVestMetaData.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/subservices/getVestMetaData.js +10 -0
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
- package/dist/src/modules/v4/router.d.ts +5 -5
- package/dist/src/utils/decodeCalls.js +5 -0
- package/dist/src/utils/encodeCalls.js +13 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -47,7 +47,7 @@ export declare abstract class OpportunityService {
|
|
47
47
|
} & {
|
48
48
|
price?: number | null | undefined;
|
49
49
|
})[];
|
50
|
-
mainProtocol: "morpho" | "aura" | "poolside" | "gearbox" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fenix" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "akron" | "dragonswap" | "koi" | "baseswap" | "zkswap" | "rfx" | "woofi" | "zkSwapThreePool" | "venus" | "reactor_fusion" | "balancer" | "aave" | "arthswap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "supswap-v3" | "thirdtrade" | "uniswap-v2" | "syncswap-v3" | "neptune" | "radiant" | "euler" | "sturdy" | "frax" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | undefined;
|
50
|
+
mainProtocol: "morpho" | "aura" | "poolside" | "gearbox" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fenix" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "akron" | "dragonswap" | "koi" | "baseswap" | "zkswap" | "rfx" | "woofi" | "zkSwapThreePool" | "venus" | "reactor_fusion" | "balancer" | "aave" | "arthswap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "supswap-v3" | "thirdtrade" | "uniswap-v2" | "syncswap-v3" | "neptune" | "radiant" | "euler" | "sturdy" | "frax" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | undefined;
|
51
51
|
depositUrl: any;
|
52
52
|
tags: string[];
|
53
53
|
}>;
|
@@ -75,7 +75,7 @@ export declare abstract class OpportunityService {
|
|
75
75
|
} & {
|
76
76
|
price?: number | null | undefined;
|
77
77
|
})[];
|
78
|
-
mainProtocol: "morpho" | "aura" | "poolside" | "gearbox" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fenix" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "akron" | "dragonswap" | "koi" | "baseswap" | "zkswap" | "rfx" | "woofi" | "zkSwapThreePool" | "venus" | "reactor_fusion" | "balancer" | "aave" | "arthswap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "supswap-v3" | "thirdtrade" | "uniswap-v2" | "syncswap-v3" | "neptune" | "radiant" | "euler" | "sturdy" | "frax" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | undefined;
|
78
|
+
mainProtocol: "morpho" | "aura" | "poolside" | "gearbox" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fenix" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "akron" | "dragonswap" | "koi" | "baseswap" | "zkswap" | "rfx" | "woofi" | "zkSwapThreePool" | "venus" | "reactor_fusion" | "balancer" | "aave" | "arthswap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "supswap-v3" | "thirdtrade" | "uniswap-v2" | "syncswap-v3" | "neptune" | "radiant" | "euler" | "sturdy" | "frax" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | undefined;
|
79
79
|
depositUrl: any;
|
80
80
|
tags: string[];
|
81
81
|
}>;
|
@@ -88,6 +88,7 @@ export declare abstract class OpportunityService {
|
|
88
88
|
* @returns A list of opportunities
|
89
89
|
*/
|
90
90
|
static getMany(query: GetOpportunitiesQueryModel): Promise<{
|
91
|
+
apr: number;
|
91
92
|
aprRecord: {
|
92
93
|
cumulated: number;
|
93
94
|
timestamp: bigint;
|
@@ -172,10 +173,10 @@ export declare abstract class OpportunityService {
|
|
172
173
|
chainId: number;
|
173
174
|
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
174
175
|
tvl: number;
|
175
|
-
apr: number;
|
176
176
|
dailyRewards: number;
|
177
177
|
}[]>;
|
178
178
|
static findLiveWithFirstCampaign(chainId: MerklChainId): Promise<({
|
179
|
+
apr: number;
|
179
180
|
aprRecord: {
|
180
181
|
cumulated: number;
|
181
182
|
timestamp: bigint;
|
@@ -260,7 +261,6 @@ export declare abstract class OpportunityService {
|
|
260
261
|
chainId: number;
|
261
262
|
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
262
263
|
tvl: number;
|
263
|
-
apr: number;
|
264
264
|
dailyRewards: number;
|
265
265
|
} & {
|
266
266
|
campaigns: {
|
@@ -321,6 +321,7 @@ export declare abstract class OpportunityService {
|
|
321
321
|
*/
|
322
322
|
static countMany(query: GetOpportunitiesQueryModel): Promise<number>;
|
323
323
|
static formatResponse(opportunity: Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>): {
|
324
|
+
apr: number;
|
324
325
|
aprRecord: {
|
325
326
|
cumulated: number;
|
326
327
|
timestamp: bigint;
|
@@ -405,7 +406,6 @@ export declare abstract class OpportunityService {
|
|
405
406
|
chainId: number;
|
406
407
|
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
407
408
|
tvl: number;
|
408
|
-
apr: number;
|
409
409
|
dailyRewards: number;
|
410
410
|
};
|
411
411
|
static formatResponseBase(opportunity: LightOpportunityFromDB): {
|
@@ -21,6 +21,7 @@ import { getJsonAirdropMetadata } from "./subservices/getJsonAirDropMetadata.ser
|
|
21
21
|
import { getMorphoMetadata } from "./subservices/getMorphoMetadata.service";
|
22
22
|
import { getRadiantMetadata } from "./subservices/getRadiantMetadata.service";
|
23
23
|
import { getSiloMetadata } from "./subservices/getSiloMetadata.service";
|
24
|
+
import { getVestMetaData } from "./subservices/getVestMetaData";
|
24
25
|
export class OpportunityService {
|
25
26
|
static hashId(opportunity) {
|
26
27
|
return Bun.hash(`${opportunity.chainId}${opportunity.type}${opportunity.identifier}`).toString();
|
@@ -69,6 +70,8 @@ export class OpportunityService {
|
|
69
70
|
return getAjnaMetadata(chainId, campaign.subType, campaignParams);
|
70
71
|
case "EIGENLAYER":
|
71
72
|
return getEigenLayerMetadata(chainId, campaignParams);
|
73
|
+
case "VEST":
|
74
|
+
return getVestMetaData(chainId, campaignParams);
|
72
75
|
case "EULER":
|
73
76
|
return getEulerMetadata(chainId, campaign.campaignId, campaign.subType, campaign.rewardTokenAddress, campaign.amount, campaignParams);
|
74
77
|
case "INVALID":
|
@@ -145,7 +148,7 @@ export class OpportunityService {
|
|
145
148
|
for (const opp of opportunities) {
|
146
149
|
const { live: activeCampaigns, soon: futureCampaigns } = CampaignService.splitOnStatus(opp.Campaigns);
|
147
150
|
if (activeCampaigns.length === 0) {
|
148
|
-
await OpportunityRepository.updateStatus(opp.id, futureCampaigns.length === 0 ? "PAST" : "SOON").catch(err => log.error("Cannot update opportunity status
|
151
|
+
await OpportunityRepository.updateStatus(opp.id, futureCampaigns.length === 0 ? "PAST" : "SOON").catch(err => log.error("Cannot update opportunity status", err, "opportunities"));
|
149
152
|
}
|
150
153
|
if (opp.status !== "LIVE" && activeCampaigns.length !== 0)
|
151
154
|
await OpportunityRepository.updateStatus(opp.id, "LIVE").catch(err => log.error("Cannot update opportunity status to LIVE", err, "opportunities"));
|
@@ -206,11 +209,18 @@ export class OpportunityService {
|
|
206
209
|
const { DailyRewardsRecords, AprRecords, TvlRecords, ...opp } = opportunity;
|
207
210
|
return {
|
208
211
|
...OpportunityService.formatResponseBase(opp),
|
209
|
-
|
210
|
-
|
211
|
-
timestamp,
|
212
|
-
|
213
|
-
|
212
|
+
apr: opp.status === "LIVE" ? opp.apr : 0,
|
213
|
+
aprRecord: opp.status === "LIVE"
|
214
|
+
? (AprRecords?.map(({ cumulated, timestamp, AprBreakdown: breakdowns }) => ({
|
215
|
+
cumulated,
|
216
|
+
timestamp,
|
217
|
+
breakdowns,
|
218
|
+
}))?.[0] ?? undefined)
|
219
|
+
: {
|
220
|
+
cumulated: 0,
|
221
|
+
timestamp: AprRecords[0].timestamp,
|
222
|
+
breakdowns: [{ ...AprRecords[0].AprBreakdown[0], value: 0 }],
|
223
|
+
},
|
214
224
|
tvlRecord: TvlRecords?.map(({ id, total, timestamp, TvlBreakdown: breakdowns }) => ({
|
215
225
|
id,
|
216
226
|
total,
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { OpportunityAction } from "../../../../../database/api/.generated";
|
2
|
+
export const getIonMetadata = async (chainId, params) => {
|
3
|
+
// TODO this is not finalized at all
|
4
|
+
return {
|
5
|
+
action: OpportunityAction.LEND,
|
6
|
+
name: ["Ion", "strategy for", params.symbolBorrowToken].join(" "),
|
7
|
+
tokens: [
|
8
|
+
{ chainId, address: params.borrowToken },
|
9
|
+
{ chainId, address: params.collateralToken },
|
10
|
+
],
|
11
|
+
mainProtocol: "ion",
|
12
|
+
};
|
13
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { VEST_TOKEN } from "../../../../libs/campaigns/campaignTypes/VestDynamicData";
|
2
|
+
import { OpportunityAction } from "../../../../../database/api/.generated";
|
3
|
+
export const getVestMetaData = async (chainId, params) => {
|
4
|
+
return {
|
5
|
+
action: OpportunityAction.LEND,
|
6
|
+
name: ["Vest", "supply", "treasury"].join(" "),
|
7
|
+
tokens: [{ chainId, address: VEST_TOKEN }],
|
8
|
+
mainProtocol: "vest",
|
9
|
+
};
|
10
|
+
};
|
@@ -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", "syncswap-v3", "neptune", "zkSwapThreePool", "syncswap", "rfx", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "venus", "woofi", "reactor_fusion", "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", "syncswap-v3", "neptune", "zkSwapThreePool", "syncswap", "rfx", "radiant", "aave", "euler", "gearbox", "compound", "sturdy", "frax", "ionic", "moonwell", "fluid", "silo", "morpho", "coumpound", "dolomite", "badger", "ajna", "layerbank", "ion", "venus", "woofi", "reactor_fusion", "eigenlayer", "vest"];
|
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,7 +30,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
30
30
|
depositUrl?: string | undefined;
|
31
31
|
protocols?: string[] | undefined;
|
32
32
|
mainProtocol?: string | undefined;
|
33
|
-
type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER";
|
33
|
+
type: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "VEST";
|
34
34
|
tokens: {
|
35
35
|
chainId: number;
|
36
36
|
address: string;
|
@@ -99,7 +99,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
99
99
|
} & {
|
100
100
|
price?: number | null | undefined;
|
101
101
|
})[];
|
102
|
-
mainProtocol: "morpho" | "aura" | "poolside" | "gearbox" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fenix" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "akron" | "dragonswap" | "koi" | "baseswap" | "zkswap" | "rfx" | "woofi" | "zkSwapThreePool" | "venus" | "reactor_fusion" | "balancer" | "aave" | "arthswap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "supswap-v3" | "thirdtrade" | "uniswap-v2" | "syncswap-v3" | "neptune" | "radiant" | "euler" | "sturdy" | "frax" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | undefined;
|
102
|
+
mainProtocol: "morpho" | "aura" | "poolside" | "gearbox" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fenix" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "akron" | "dragonswap" | "koi" | "baseswap" | "zkswap" | "rfx" | "woofi" | "zkSwapThreePool" | "venus" | "reactor_fusion" | "balancer" | "aave" | "arthswap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancakeswap-v3" | "quickswap-algebra" | "quickswap-uni" | "ramses" | "retro" | "stryke" | "stryke-pcs" | "stryke-sushi" | "sushiswap-v3" | "swapr" | "thruster" | "uniswap-v3" | "voltage" | "zero" | "supswap-v3" | "thirdtrade" | "uniswap-v2" | "syncswap-v3" | "neptune" | "radiant" | "euler" | "sturdy" | "frax" | "silo" | "coumpound" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | undefined;
|
103
103
|
depositUrl: any;
|
104
104
|
tags: string[];
|
105
105
|
};
|
@@ -132,6 +132,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
132
132
|
headers: unknown;
|
133
133
|
response: {
|
134
134
|
200: {
|
135
|
+
apr: number;
|
135
136
|
aprRecord: {
|
136
137
|
cumulated: number;
|
137
138
|
timestamp: bigint;
|
@@ -216,7 +217,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
216
217
|
chainId: number;
|
217
218
|
action: import("../../../database/api/.generated").$Enums.OpportunityAction;
|
218
219
|
tvl: number;
|
219
|
-
apr: number;
|
220
220
|
dailyRewards: number;
|
221
221
|
}[];
|
222
222
|
};
|
@@ -643,7 +643,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
643
643
|
body: unknown;
|
644
644
|
params: {};
|
645
645
|
query: {
|
646
|
-
type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
|
646
|
+
type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "VEST" | undefined;
|
647
647
|
items?: number | undefined;
|
648
648
|
subType?: number | undefined;
|
649
649
|
page?: number | undefined;
|
@@ -715,7 +715,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
715
715
|
body: unknown;
|
716
716
|
params: {};
|
717
717
|
query: {
|
718
|
-
type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | undefined;
|
718
|
+
type?: "INVALID" | "ERC20" | "CLAMM" | "ERC20_SNAPSHOT" | "JSON_AIRDROP" | "SILO" | "RADIANT" | "MORPHO" | "DOLOMITE" | "BADGER" | "COMPOUND" | "AJNA" | "EULER" | "UNISWAP_V4" | "ION" | "EIGENLAYER" | "ERC20TRANSFERS" | "VEST" | undefined;
|
719
719
|
items?: number | undefined;
|
720
720
|
subType?: number | undefined;
|
721
721
|
page?: number | undefined;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SturdyInterface, SymetricAmbientStrategyInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
2
|
+
import { SyncSwapClassicPoolInterface } from "libs/sdk/src/merkl/interface";
|
2
3
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
3
4
|
export function decodeCall(calls, index, key, type) {
|
4
5
|
const returnData = calls[index];
|
@@ -229,6 +230,10 @@ export function decodeCall(calls, index, key, type) {
|
|
229
230
|
];
|
230
231
|
case "tokenBalances":
|
231
232
|
return CPMMGammaPoolMainInterface.decodeFunctionResult("getLatestCFMMBalances", returnData)[0];
|
233
|
+
case "reserve0":
|
234
|
+
return SyncSwapClassicPoolInterface.decodeFunctionResult("reserve0", returnData)[0];
|
235
|
+
case "reserve1":
|
236
|
+
return SyncSwapClassicPoolInterface.decodeFunctionResult("reserve1", returnData)[0];
|
232
237
|
default:
|
233
238
|
throw new Error(`Key not recognized for ${key}`);
|
234
239
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
2
2
|
import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SturdyInterface, SymetricAmbientStrategyInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
|
3
|
+
import { SyncSwapClassicPoolInterface } from "libs/sdk/src/merkl/interface";
|
3
4
|
export function createCall(target, key, type, metaData) {
|
4
5
|
switch (key) {
|
5
6
|
case "SY":
|
@@ -350,6 +351,18 @@ export function createCall(target, key, type, metaData) {
|
|
350
351
|
callData: UniswapV2PoolInterface.encodeFunctionData("getReserves"),
|
351
352
|
target: target,
|
352
353
|
};
|
354
|
+
case "reserve0":
|
355
|
+
return {
|
356
|
+
allowFailure: true,
|
357
|
+
callData: SyncSwapClassicPoolInterface.encodeFunctionData("reserve0"),
|
358
|
+
target: target,
|
359
|
+
};
|
360
|
+
case "reserve1":
|
361
|
+
return {
|
362
|
+
allowFailure: true,
|
363
|
+
callData: SyncSwapClassicPoolInterface.encodeFunctionData("reserve1"),
|
364
|
+
target: target,
|
365
|
+
};
|
353
366
|
default:
|
354
367
|
throw new Error(`Unknown key ${key}`);
|
355
368
|
}
|