@merkl/api 0.10.152 → 0.10.154
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/eden/index.d.ts +53 -34
- package/dist/src/index.d.ts +17 -12
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +2 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +4 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js +0 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/ZkSwapThreePoolProcessor.d.ts +53 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/ZkSwapThreePoolProcessor.js +55 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +2 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +6 -1
- package/dist/src/libs/campaigns/utils/getLastEligibilityRatio.js +15 -6
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +14 -12
- package/dist/src/modules/v4/campaign/campaign.controller.js +1 -1
- package/dist/src/modules/v4/chainInteraction/chainInteraction.service.d.ts +2 -0
- package/dist/src/modules/v4/chainInteraction/chainInteraction.service.js +4 -0
- package/dist/src/modules/v4/chainInteraction/index.d.ts +1 -0
- package/dist/src/modules/v4/chainInteraction/index.js +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.model.js +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +1 -0
- package/dist/src/modules/v4/router.d.ts +17 -12
- package/dist/src/modules/v4/tracer/index.d.ts +1 -0
- package/dist/src/modules/v4/tracer/index.js +1 -0
- package/dist/src/modules/v4/tracer/tracer.service.d.ts +3 -0
- package/dist/src/modules/v4/tracer/tracer.service.js +30 -0
- package/dist/src/routes/v3/ERC20Campaigns.d.ts +17 -12
- package/dist/src/routes/v3/blacklist.d.ts +17 -12
- package/dist/src/routes/v3/campaigns.d.ts +17 -12
- package/dist/src/routes/v3/campaignsInfo.d.ts +17 -12
- package/dist/src/routes/v3/multiChainPositions.d.ts +17 -12
- package/dist/src/routes/v3/opportunity.d.ts +17 -12
- package/dist/src/routes/v3/positions.d.ts +17 -12
- package/dist/src/routes/v3/rewards.d.ts +17 -12
- package/dist/src/routes/v3/updates.d.ts +17 -12
- package/dist/src/routes/v3/userRewards.d.ts +17 -12
- package/dist/src/utils/decodeCalls.js +7 -1
- package/dist/src/utils/encodeCalls.js +19 -1
- package/dist/src/utils/generateCardName.js +3 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/libs/rewards/userRewards.d.ts +0 -2
- package/dist/src/libs/rewards/userRewards.js +0 -154
package/dist/src/eden/index.d.ts
CHANGED
@@ -269,6 +269,7 @@ declare const eden: {
|
|
269
269
|
action?: string | undefined;
|
270
270
|
mainProtocolId?: string | undefined;
|
271
271
|
order?: undefined;
|
272
|
+
minimumTvl?: number | undefined;
|
272
273
|
};
|
273
274
|
fetch?: RequestInit | undefined;
|
274
275
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -372,6 +373,7 @@ declare const eden: {
|
|
372
373
|
action?: string | undefined;
|
373
374
|
mainProtocolId?: string | undefined;
|
374
375
|
order?: undefined;
|
376
|
+
minimumTvl?: number | undefined;
|
375
377
|
};
|
376
378
|
fetch?: RequestInit | undefined;
|
377
379
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -395,6 +397,7 @@ declare const eden: {
|
|
395
397
|
action?: string | undefined;
|
396
398
|
mainProtocolId?: string | undefined;
|
397
399
|
order?: undefined;
|
400
|
+
minimumTvl?: number | undefined;
|
398
401
|
};
|
399
402
|
fetch?: RequestInit | undefined;
|
400
403
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -538,17 +541,6 @@ declare const eden: {
|
|
538
541
|
}[];
|
539
542
|
}[];
|
540
543
|
}>>;
|
541
|
-
post: (body: unknown, options: {
|
542
|
-
headers: {
|
543
|
-
authorization: string;
|
544
|
-
};
|
545
|
-
query: {
|
546
|
-
chainId: number;
|
547
|
-
};
|
548
|
-
fetch?: RequestInit | undefined;
|
549
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
550
|
-
200: string;
|
551
|
-
}>>;
|
552
544
|
};
|
553
545
|
count: {
|
554
546
|
get: (options: {
|
@@ -561,6 +553,21 @@ declare const eden: {
|
|
561
553
|
200: number;
|
562
554
|
}>>;
|
563
555
|
};
|
556
|
+
engine: {
|
557
|
+
"": {
|
558
|
+
post: (body: unknown, options: {
|
559
|
+
headers: {
|
560
|
+
authorization: string;
|
561
|
+
};
|
562
|
+
query: {
|
563
|
+
chainId: number;
|
564
|
+
};
|
565
|
+
fetch?: RequestInit | undefined;
|
566
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
567
|
+
200: string;
|
568
|
+
}>>;
|
569
|
+
};
|
570
|
+
};
|
564
571
|
};
|
565
572
|
};
|
566
573
|
protocols: ((params: {
|
@@ -2074,6 +2081,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
2074
2081
|
action?: string | undefined;
|
2075
2082
|
mainProtocolId?: string | undefined;
|
2076
2083
|
order?: undefined;
|
2084
|
+
minimumTvl?: number | undefined;
|
2077
2085
|
};
|
2078
2086
|
headers: unknown;
|
2079
2087
|
response: {
|
@@ -2182,6 +2190,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
2182
2190
|
action?: string | undefined;
|
2183
2191
|
mainProtocolId?: string | undefined;
|
2184
2192
|
order?: undefined;
|
2193
|
+
minimumTvl?: number | undefined;
|
2185
2194
|
};
|
2186
2195
|
headers: unknown;
|
2187
2196
|
response: {
|
@@ -2211,6 +2220,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
2211
2220
|
action?: string | undefined;
|
2212
2221
|
mainProtocolId?: string | undefined;
|
2213
2222
|
order?: undefined;
|
2223
|
+
minimumTvl?: number | undefined;
|
2214
2224
|
};
|
2215
2225
|
headers: unknown;
|
2216
2226
|
response: {
|
@@ -2392,18 +2402,20 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
2392
2402
|
};
|
2393
2403
|
} & {
|
2394
2404
|
"campaigns-to-process": {
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2405
|
+
engine: {
|
2406
|
+
"": {
|
2407
|
+
post: {
|
2408
|
+
body: unknown;
|
2409
|
+
params: {};
|
2410
|
+
query: {
|
2411
|
+
chainId: number;
|
2412
|
+
};
|
2413
|
+
headers: {
|
2414
|
+
authorization: string;
|
2415
|
+
};
|
2416
|
+
response: {
|
2417
|
+
200: string;
|
2418
|
+
};
|
2407
2419
|
};
|
2408
2420
|
};
|
2409
2421
|
};
|
@@ -4216,6 +4228,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4216
4228
|
action?: string | undefined;
|
4217
4229
|
mainProtocolId?: string | undefined;
|
4218
4230
|
order?: undefined;
|
4231
|
+
minimumTvl?: number | undefined;
|
4219
4232
|
};
|
4220
4233
|
fetch?: RequestInit | undefined;
|
4221
4234
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -4319,6 +4332,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4319
4332
|
action?: string | undefined;
|
4320
4333
|
mainProtocolId?: string | undefined;
|
4321
4334
|
order?: undefined;
|
4335
|
+
minimumTvl?: number | undefined;
|
4322
4336
|
};
|
4323
4337
|
fetch?: RequestInit | undefined;
|
4324
4338
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -4342,6 +4356,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4342
4356
|
action?: string | undefined;
|
4343
4357
|
mainProtocolId?: string | undefined;
|
4344
4358
|
order?: undefined;
|
4359
|
+
minimumTvl?: number | undefined;
|
4345
4360
|
};
|
4346
4361
|
fetch?: RequestInit | undefined;
|
4347
4362
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
@@ -4485,17 +4500,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4485
4500
|
}[];
|
4486
4501
|
}[];
|
4487
4502
|
}>>;
|
4488
|
-
post: (body: unknown, options: {
|
4489
|
-
headers: {
|
4490
|
-
authorization: string;
|
4491
|
-
};
|
4492
|
-
query: {
|
4493
|
-
chainId: number;
|
4494
|
-
};
|
4495
|
-
fetch?: RequestInit | undefined;
|
4496
|
-
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4497
|
-
200: string;
|
4498
|
-
}>>;
|
4499
4503
|
};
|
4500
4504
|
count: {
|
4501
4505
|
get: (options: {
|
@@ -4508,6 +4512,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
4508
4512
|
200: number;
|
4509
4513
|
}>>;
|
4510
4514
|
};
|
4515
|
+
engine: {
|
4516
|
+
"": {
|
4517
|
+
post: (body: unknown, options: {
|
4518
|
+
headers: {
|
4519
|
+
authorization: string;
|
4520
|
+
};
|
4521
|
+
query: {
|
4522
|
+
chainId: number;
|
4523
|
+
};
|
4524
|
+
fetch?: RequestInit | undefined;
|
4525
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
4526
|
+
200: string;
|
4527
|
+
}>>;
|
4528
|
+
};
|
4529
|
+
};
|
4511
4530
|
};
|
4512
4531
|
};
|
4513
4532
|
protocols: ((params: {
|
package/dist/src/index.d.ts
CHANGED
@@ -319,6 +319,7 @@ declare const app: Elysia<"", false, {
|
|
319
319
|
action?: string | undefined;
|
320
320
|
mainProtocolId?: string | undefined;
|
321
321
|
order?: undefined;
|
322
|
+
minimumTvl?: number | undefined;
|
322
323
|
};
|
323
324
|
headers: unknown;
|
324
325
|
response: {
|
@@ -427,6 +428,7 @@ declare const app: Elysia<"", false, {
|
|
427
428
|
action?: string | undefined;
|
428
429
|
mainProtocolId?: string | undefined;
|
429
430
|
order?: undefined;
|
431
|
+
minimumTvl?: number | undefined;
|
430
432
|
};
|
431
433
|
headers: unknown;
|
432
434
|
response: {
|
@@ -456,6 +458,7 @@ declare const app: Elysia<"", false, {
|
|
456
458
|
action?: string | undefined;
|
457
459
|
mainProtocolId?: string | undefined;
|
458
460
|
order?: undefined;
|
461
|
+
minimumTvl?: number | undefined;
|
459
462
|
};
|
460
463
|
headers: unknown;
|
461
464
|
response: {
|
@@ -637,18 +640,20 @@ declare const app: Elysia<"", false, {
|
|
637
640
|
};
|
638
641
|
} & {
|
639
642
|
"campaigns-to-process": {
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
643
|
+
engine: {
|
644
|
+
"": {
|
645
|
+
post: {
|
646
|
+
body: unknown;
|
647
|
+
params: {};
|
648
|
+
query: {
|
649
|
+
chainId: number;
|
650
|
+
};
|
651
|
+
headers: {
|
652
|
+
authorization: string;
|
653
|
+
};
|
654
|
+
response: {
|
655
|
+
200: string;
|
656
|
+
};
|
652
657
|
};
|
653
658
|
};
|
654
659
|
};
|
@@ -50,7 +50,8 @@ export declare enum tokenType {
|
|
50
50
|
rfx = "rfx",
|
51
51
|
woofi = "woofi",
|
52
52
|
pendle = "pendle",
|
53
|
-
maverickBoostedPosition = "maverickBoostedPosition"
|
53
|
+
maverickBoostedPosition = "maverickBoostedPosition",
|
54
|
+
zkSwapThreePool = "zkSwapThreePool"
|
54
55
|
}
|
55
56
|
export declare const tokenTypeToProtocol: {
|
56
57
|
[key in tokenType]: {
|
@@ -52,6 +52,7 @@ export var tokenType;
|
|
52
52
|
tokenType["woofi"] = "woofi";
|
53
53
|
tokenType["pendle"] = "pendle";
|
54
54
|
tokenType["maverickBoostedPosition"] = "maverickBoostedPosition";
|
55
|
+
tokenType["zkSwapThreePool"] = "zkSwapThreePool";
|
55
56
|
})(tokenType || (tokenType = {}));
|
56
57
|
export const tokenTypeToProtocol = {
|
57
58
|
[tokenType.aave_borrowing]: { protocol: "Aave" },
|
@@ -111,4 +112,7 @@ export const tokenTypeToProtocol = {
|
|
111
112
|
[tokenType.maverickBoostedPosition]: {
|
112
113
|
protocol: "Maverick",
|
113
114
|
},
|
115
|
+
[tokenType.zkSwapThreePool]: {
|
116
|
+
protocol: "ZKSwap",
|
117
|
+
},
|
114
118
|
};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js
CHANGED
@@ -54,7 +54,6 @@ export class MaverickBPProcessor extends GenericProcessor {
|
|
54
54
|
const amountB = BN2Number(typeInfo.amountB, decimalsTokenB);
|
55
55
|
const tokenAPRice = (await pricer.get({ symbol: typeInfo.symbolTokenA })) ?? 0;
|
56
56
|
const tokenBPrice = (await pricer.get({ symbol: typeInfo.symbolTokenB })) ?? 0;
|
57
|
-
// Not rebased (ie divided by 10edecimals)
|
58
57
|
const tvl = tokenAPRice * amountA + tokenBPrice * amountB;
|
59
58
|
const priceTargetToken = tvl / totalSupply;
|
60
59
|
const { bpInfoReturnData, ...rest } = typeInfo;
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/ZkSwapThreePoolProcessor.d.ts
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
import type { Pricer } from "../../../../../utils/pricer";
|
2
|
+
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
|
+
import type { tokenType } from "../helpers/tokenType";
|
4
|
+
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
|
5
|
+
type callType = {
|
6
|
+
key: keyof dataRawzkSwapThreePool;
|
7
|
+
call: string;
|
8
|
+
target: keyof callKeysZkswapThreePool;
|
9
|
+
metaData?: keyof callKeysZkswapThreePool;
|
10
|
+
};
|
11
|
+
type callKeysZkswapThreePool = mandatoryCallKeys & {
|
12
|
+
balances: string;
|
13
|
+
coins: string;
|
14
|
+
minter: string;
|
15
|
+
pool: string;
|
16
|
+
token0Address: string;
|
17
|
+
token0Index: string;
|
18
|
+
token1Address: string;
|
19
|
+
token1Index: string;
|
20
|
+
token2Address: string;
|
21
|
+
token2Index: string;
|
22
|
+
};
|
23
|
+
type dataRawzkSwapThreePool = callKeysZkswapThreePool & {
|
24
|
+
balance0: string;
|
25
|
+
balance1: string;
|
26
|
+
balance2: string;
|
27
|
+
symbolToken0: string;
|
28
|
+
symbolToken1: string;
|
29
|
+
symbolToken2: string;
|
30
|
+
decimalsToken0: string;
|
31
|
+
decimalsToken1: string;
|
32
|
+
decimalsToken2: string;
|
33
|
+
};
|
34
|
+
type dataTypeZkSwapThreePool = dataType & {
|
35
|
+
pool: string;
|
36
|
+
symbolToken0: string;
|
37
|
+
symbolToken1: string;
|
38
|
+
symbolToken2: string;
|
39
|
+
token0Address: string;
|
40
|
+
token1Address: string;
|
41
|
+
token2Address: string;
|
42
|
+
};
|
43
|
+
export declare class ZkSwapThreePoolProcessor extends GenericProcessor<callKeysZkswapThreePool, dataRawzkSwapThreePool, dataTypeZkSwapThreePool> {
|
44
|
+
rounds: {
|
45
|
+
round1: callType[];
|
46
|
+
round2: callType[];
|
47
|
+
round3: callType[];
|
48
|
+
round4: callType[];
|
49
|
+
};
|
50
|
+
processingRound2(typeInfo: dataRawzkSwapThreePool): void;
|
51
|
+
processingRound5(_index: number, type: tokenType, typeInfo: dataRawzkSwapThreePool, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeZkSwapThreePool>;
|
52
|
+
}
|
53
|
+
export {};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/ZkSwapThreePoolProcessor.js
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
+
import { BN2Number } from "@sdk";
|
3
|
+
import { GenericProcessor } from "./GenericProcessor";
|
4
|
+
export class ZkSwapThreePoolProcessor extends GenericProcessor {
|
5
|
+
rounds = {
|
6
|
+
round1: [{ key: "pool", call: "minter", target: "tokenAddress" }],
|
7
|
+
round2: [
|
8
|
+
{ key: "token0Address", call: "coins", target: "pool", metaData: "token0Index" },
|
9
|
+
{ key: "balance0", call: "balances", target: "pool", metaData: "token0Index" },
|
10
|
+
{ key: "token1Address", call: "coins", target: "pool", metaData: "token1Index" },
|
11
|
+
{ key: "balance1", call: "balances", target: "pool", metaData: "token1Index" },
|
12
|
+
{ key: "token2Address", call: "coins", target: "pool", metaData: "token2Index" },
|
13
|
+
{ key: "balance2", call: "balances", target: "pool", metaData: "token2Index" },
|
14
|
+
],
|
15
|
+
round3: [
|
16
|
+
{ key: "symbolToken0", call: "symbol", target: "token0Address" },
|
17
|
+
{ key: "symbolToken1", call: "symbol", target: "token1Address" },
|
18
|
+
{ key: "symbolToken2", call: "symbol", target: "token2Address" },
|
19
|
+
{ key: "decimalsToken0", call: "decimals", target: "token0Address" },
|
20
|
+
{ key: "decimalsToken1", call: "decimals", target: "token1Address" },
|
21
|
+
{ key: "decimalsToken2", call: "decimals", target: "token2Address" },
|
22
|
+
],
|
23
|
+
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
24
|
+
};
|
25
|
+
processingRound2(typeInfo) {
|
26
|
+
typeInfo.token0Index = "0";
|
27
|
+
typeInfo.token1Index = "1";
|
28
|
+
typeInfo.token2Index = "2";
|
29
|
+
}
|
30
|
+
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
31
|
+
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
32
|
+
const decimals0 = Number(typeInfo.decimalsToken0);
|
33
|
+
const decimals1 = Number(typeInfo.decimalsToken1);
|
34
|
+
const decimals2 = Number(typeInfo.decimalsToken2);
|
35
|
+
const amount0 = BN2Number(typeInfo.balance0, decimals0);
|
36
|
+
const amount1 = BN2Number(typeInfo.balance1, decimals1);
|
37
|
+
const amount2 = BN2Number(typeInfo.balance2, decimals2);
|
38
|
+
// FIXMEME issue with token0Price
|
39
|
+
const token0Price = (await pricer.get({ symbol: typeInfo.symbolToken0 })) ?? 0;
|
40
|
+
const token1Price = (await pricer.get({ symbol: typeInfo.symbolToken1 })) ?? 0;
|
41
|
+
const token2Price = (await pricer.get({ symbol: typeInfo.symbolToken2 })) ?? 0;
|
42
|
+
const tvl = token0Price * amount0 + token1Price * amount1 + token2Price * amount2;
|
43
|
+
const priceTargetToken = tvl / totalSupply;
|
44
|
+
const { balance0, balance1, balance2, decimalsToken0, decimalsToken1, decimalsToken2, ...rest } = typeInfo;
|
45
|
+
return {
|
46
|
+
...rest,
|
47
|
+
blacklistedSupply,
|
48
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
49
|
+
priceTargetToken: priceTargetToken,
|
50
|
+
totalSupply,
|
51
|
+
tvl,
|
52
|
+
whitelistedSupplyTargetToken,
|
53
|
+
};
|
54
|
+
}
|
55
|
+
}
|
@@ -23,6 +23,7 @@ import { SturdySiloProcessor } from "./SturdySiloProcessor";
|
|
23
23
|
import { TorosProcessor } from "./TorosProcessor";
|
24
24
|
import { UniswapProcessor } from "./UniswapProcessor";
|
25
25
|
import { WoofiProcessor } from "./WoofiProcessor";
|
26
|
+
import { ZkSwapThreePoolProcessor } from "./ZkSwapThreePoolProcessor";
|
26
27
|
import { CurveProcessor } from "./curveProcessor";
|
27
28
|
export const processorMapping = {
|
28
29
|
[tokenType.uniswapv2]: UniswapProcessor,
|
@@ -76,4 +77,5 @@ export const processorMapping = {
|
|
76
77
|
[tokenType.rfx]: RfxProcessor,
|
77
78
|
[tokenType.woofi]: WoofiProcessor,
|
78
79
|
[tokenType.maverickBoostedPosition]: MaverickBPProcessor,
|
80
|
+
[tokenType.zkSwapThreePool]: ZkSwapThreePoolProcessor,
|
79
81
|
};
|
@@ -40,7 +40,10 @@ function satisfiesNameConditions(name, type) {
|
|
40
40
|
case tokenType.moonwell:
|
41
41
|
return lowerCaseName.includes("moonwell");
|
42
42
|
case tokenType.curve_2:
|
43
|
-
return lowerCaseName === "crvusd/frax" ||
|
43
|
+
return (lowerCaseName === "crvusd/frax" ||
|
44
|
+
lowerCaseName === "ezeth/wfrxeth" ||
|
45
|
+
lowerCaseName === "pufeth/wsteth" ||
|
46
|
+
lowerCaseName === "hai/lusd");
|
44
47
|
case tokenType.silostaking:
|
45
48
|
return lowerCaseName === "isei";
|
46
49
|
case tokenType.beefy:
|
@@ -83,6 +86,8 @@ function satisfiesNameConditions(name, type) {
|
|
83
86
|
return lowerCaseName.includes("woofi");
|
84
87
|
case tokenType.maverickBoostedPosition:
|
85
88
|
return lowerCaseName.includes("maverick");
|
89
|
+
case tokenType.zkSwapThreePool:
|
90
|
+
return lowerCaseName.includes("zf");
|
86
91
|
default:
|
87
92
|
return false;
|
88
93
|
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { engineDbClient } from "../../../utils/prisma";
|
2
1
|
import { apiDbClient } from "src/utils/prisma";
|
3
2
|
export const getLastEligibilityRatio = async (campaign, chainId, currentRoot, backupCampaignIds) => {
|
4
3
|
if (campaign.campaignId === "0x6acb7a8cd2646f18e6e438658273bbee1ed6d664c19779d144cc339decf240ca") {
|
@@ -30,16 +29,26 @@ export const getLastEligibilityRatio = async (campaign, chainId, currentRoot, ba
|
|
30
29
|
if (auxLastEligibilityRatio === undefined || auxLastEligibilityRatio === null) {
|
31
30
|
// Otherwise we search in the backup campaigns
|
32
31
|
for (const campaignId of backupCampaignIds) {
|
33
|
-
|
32
|
+
const auxLastEligibilityRatioString = (await apiDbClient.rewardBreakdown.findFirst({
|
34
33
|
select: {
|
35
34
|
auxiliaryData1: true,
|
36
35
|
},
|
37
36
|
where: {
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
Reward: {
|
38
|
+
RewardToken: {
|
39
|
+
chainId,
|
40
|
+
},
|
41
|
+
root: currentRoot,
|
42
|
+
},
|
43
|
+
campaignId: campaignId,
|
41
44
|
},
|
42
|
-
|
45
|
+
orderBy: {
|
46
|
+
amount: "desc",
|
47
|
+
},
|
48
|
+
}))?.auxiliaryData1;
|
49
|
+
auxLastEligibilityRatio = !!auxLastEligibilityRatioString
|
50
|
+
? Number.parseFloat(auxLastEligibilityRatioString)
|
51
|
+
: null;
|
43
52
|
if (!!auxLastEligibilityRatio)
|
44
53
|
break;
|
45
54
|
}
|
@@ -179,18 +179,20 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
179
179
|
};
|
180
180
|
} & {
|
181
181
|
"campaigns-to-process": {
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
182
|
+
engine: {
|
183
|
+
"": {
|
184
|
+
post: {
|
185
|
+
body: unknown;
|
186
|
+
params: {};
|
187
|
+
query: {
|
188
|
+
chainId: number;
|
189
|
+
};
|
190
|
+
headers: {
|
191
|
+
authorization: string;
|
192
|
+
};
|
193
|
+
response: {
|
194
|
+
200: string;
|
195
|
+
};
|
194
196
|
};
|
195
197
|
};
|
196
198
|
};
|
@@ -34,7 +34,7 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
34
34
|
},
|
35
35
|
})
|
36
36
|
// ─── Returns a CampaignId to Process and flags it as PROCESSING ──────-
|
37
|
-
.post("/", async ({ query }) => await CampaignService.pickCampaignToProcess(query.chainId), {
|
37
|
+
.post("/engine/", async ({ query }) => await CampaignService.pickCampaignToProcess(query.chainId), {
|
38
38
|
query: ChainUniqueDto,
|
39
39
|
beforeHandle: async ({ query, headers }) => {
|
40
40
|
await EngineGuard({ headers });
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { ChainInteractionService } from "@sdk";
|
2
|
+
import { TracerService } from "../tracer";
|
3
|
+
const ChainInteractionServiceWrapper = TracerService.createTracedProxy(ChainInteractionService, "ChainInteractionService");
|
4
|
+
export { ChainInteractionServiceWrapper as ChainInteractionService };
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./chainInteraction.service";
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./chainInteraction.service";
|
@@ -292,6 +292,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
292
292
|
action?: string | undefined;
|
293
293
|
mainProtocolId?: string | undefined;
|
294
294
|
order?: undefined;
|
295
|
+
minimumTvl?: number | undefined;
|
295
296
|
};
|
296
297
|
headers: unknown;
|
297
298
|
response: {
|
@@ -400,6 +401,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
400
401
|
action?: string | undefined;
|
401
402
|
mainProtocolId?: string | undefined;
|
402
403
|
order?: undefined;
|
404
|
+
minimumTvl?: number | undefined;
|
403
405
|
};
|
404
406
|
headers: unknown;
|
405
407
|
response: {
|
@@ -429,6 +431,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
429
431
|
action?: string | undefined;
|
430
432
|
mainProtocolId?: string | undefined;
|
431
433
|
order?: undefined;
|
434
|
+
minimumTvl?: number | undefined;
|
432
435
|
};
|
433
436
|
headers: unknown;
|
434
437
|
response: {
|
@@ -53,6 +53,7 @@ export declare const GetOpportunitiesQueryDto: import("@sinclair/typebox").TObje
|
|
53
53
|
INVALID: "INVALID";
|
54
54
|
}>, import("@sinclair/typebox").TRegExp]>>;
|
55
55
|
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
56
|
+
minimumTvl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
56
57
|
tokens: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
57
58
|
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TEnum<{
|
58
59
|
NONE: "NONE";
|
@@ -62,7 +63,7 @@ export declare const GetOpportunitiesQueryDto: import("@sinclair/typebox").TObje
|
|
62
63
|
}>, import("@sinclair/typebox").TRegExp]>>;
|
63
64
|
sort: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"tvl" | "apr" | "rewards">[]>>;
|
64
65
|
order: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"asc" | "desc">[]>>;
|
65
|
-
mainProtocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").
|
66
|
+
mainProtocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRegExp>;
|
66
67
|
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
67
68
|
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
68
69
|
}>;
|
@@ -15,11 +15,12 @@ export const GetOpportunitiesQueryDto = t.Object({
|
|
15
15
|
//TODO: find a systemic way of handling query param arrays
|
16
16
|
action: t.Optional(t.Union([t.Enum(OpportunityAction), t.RegExp(/^(POOL|HOLD|DROP|LEND|BORROW)+(,(POOL|HOLD|DROP|LEND|BORROW)+)*$/)])),
|
17
17
|
tags: t.Optional(t.String()),
|
18
|
+
minimumTvl: t.Optional(t.Number()),
|
18
19
|
tokens: t.Optional(t.String({ title: "Symbol" })),
|
19
20
|
status: t.Optional(t.Union([t.Enum(Status), t.RegExp(/^(LIVE|PAST|SOON)+(,(LIVE|PAST|SOON)+)*$/)])),
|
20
21
|
sort: t.Optional(t.Union(["apr", "tvl", "rewards"].map(v => t.Literal(v)))),
|
21
22
|
order: t.Optional(t.Union(["desc", "asc"].map(v => t.Literal(v)))),
|
22
|
-
mainProtocolId: t.Optional(t.
|
23
|
+
mainProtocolId: t.Optional(t.RegExp(/^\d+(,\d+)*$/)),
|
23
24
|
page: t.Optional(t.Numeric()), // 0-indexed
|
24
25
|
items: t.Optional(t.Numeric()), // items per page
|
25
26
|
});
|
@@ -132,6 +132,7 @@ export class OpportunityRepository {
|
|
132
132
|
AND: [
|
133
133
|
...(tokensFilters ?? []),
|
134
134
|
{ tags: !filters.tags ? undefined : { has: filters.tags } },
|
135
|
+
{ tvl: filters.minimumTvl ? { gte: filters.minimumTvl } : undefined },
|
135
136
|
{ chainId: !chainIds ? undefined : { in: chainIds } },
|
136
137
|
{ name: !filters.name ? undefined : { contains: filters.name, mode: "insensitive" } },
|
137
138
|
{
|
@@ -301,6 +301,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
301
301
|
action?: string | undefined;
|
302
302
|
mainProtocolId?: string | undefined;
|
303
303
|
order?: undefined;
|
304
|
+
minimumTvl?: number | undefined;
|
304
305
|
};
|
305
306
|
headers: unknown;
|
306
307
|
response: {
|
@@ -409,6 +410,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
409
410
|
action?: string | undefined;
|
410
411
|
mainProtocolId?: string | undefined;
|
411
412
|
order?: undefined;
|
413
|
+
minimumTvl?: number | undefined;
|
412
414
|
};
|
413
415
|
headers: unknown;
|
414
416
|
response: {
|
@@ -438,6 +440,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
438
440
|
action?: string | undefined;
|
439
441
|
mainProtocolId?: string | undefined;
|
440
442
|
order?: undefined;
|
443
|
+
minimumTvl?: number | undefined;
|
441
444
|
};
|
442
445
|
headers: unknown;
|
443
446
|
response: {
|
@@ -619,18 +622,20 @@ export declare const v4: Elysia<"/v4", false, {
|
|
619
622
|
};
|
620
623
|
} & {
|
621
624
|
"campaigns-to-process": {
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
625
|
+
engine: {
|
626
|
+
"": {
|
627
|
+
post: {
|
628
|
+
body: unknown;
|
629
|
+
params: {};
|
630
|
+
query: {
|
631
|
+
chainId: number;
|
632
|
+
};
|
633
|
+
headers: {
|
634
|
+
authorization: string;
|
635
|
+
};
|
636
|
+
response: {
|
637
|
+
200: string;
|
638
|
+
};
|
634
639
|
};
|
635
640
|
};
|
636
641
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./tracer.service";
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./tracer.service";
|