@merkl/api 0.10.169 → 0.10.171
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 -3
- package/dist/database/api/.generated/index-browser.js +3 -0
- package/dist/database/api/.generated/index.d.ts +113 -0
- package/dist/database/api/.generated/index.js +6 -3
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +17 -15
- package/dist/database/api/.generated/wasm.js +3 -0
- package/dist/src/eden/index.d.ts +147 -45
- package/dist/src/index.d.ts +49 -15
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.js +2 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +8 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleYTProcessor.d.ts +29 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleYTProcessor.js +31 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.js +36 -7
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +3 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +5 -1
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +1 -0
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -0
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +2 -0
- package/dist/src/modules/v4/campaign/campaign.repository.js +3 -1
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +6 -2
- package/dist/src/modules/v4/campaign/campaign.service.js +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +27 -10
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.model.js +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +26 -4
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +2 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +50 -24
- package/dist/src/modules/v4/opportunity/opportunity.service.js +2 -1
- package/dist/src/modules/v4/price/price.controller.js +1 -1
- package/dist/src/modules/v4/price/price.service.d.ts +1 -1
- package/dist/src/modules/v4/price/price.service.js +3 -3
- package/dist/src/modules/v4/reward/reward.repository.d.ts +4 -0
- package/dist/src/modules/v4/reward/reward.service.d.ts +22 -0
- package/dist/src/modules/v4/router.d.ts +49 -15
- package/dist/src/modules/v4/token/token.controller.d.ts +9 -4
- package/dist/src/modules/v4/token/token.model.d.ts +2 -1
- package/dist/src/modules/v4/token/token.model.js +1 -0
- package/dist/src/modules/v4/token/token.repository.d.ts +13 -1
- package/dist/src/modules/v4/token/token.repository.js +2 -0
- package/dist/src/modules/v4/token/token.service.d.ts +12 -4
- package/dist/src/modules/v4/token/token.service.js +11 -2
- package/dist/src/modules/v4/user/user.controller.d.ts +8 -0
- package/dist/src/routes/v3/blacklist.d.ts +49 -15
- package/dist/src/routes/v3/campaigns.d.ts +49 -15
- package/dist/src/routes/v3/campaignsInfo.d.ts +49 -15
- package/dist/src/routes/v3/multiChainPositions.d.ts +49 -15
- package/dist/src/routes/v3/opportunity.d.ts +49 -15
- package/dist/src/routes/v3/positions.d.ts +49 -15
- package/dist/src/routes/v3/rewards.d.ts +49 -15
- package/dist/src/routes/v3/updates.d.ts +49 -15
- package/dist/src/routes/v3/userRewards.d.ts +49 -15
- package/dist/src/utils/decodeCalls.js +4 -1
- package/dist/src/utils/encodeCalls.js +4 -1
- package/dist/src/utils/generateCardName.js +2 -0
- package/dist/src/utils/prices/services/erc4626Service.js +7 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
@@ -119,14 +119,16 @@ declare const app: Elysia<"", false, {
|
|
119
119
|
address: string;
|
120
120
|
icon: string;
|
121
121
|
decimals: number;
|
122
|
+
displaySymbol: string;
|
122
123
|
verified: boolean;
|
124
|
+
isTest: boolean;
|
123
125
|
price: number | null;
|
124
126
|
};
|
125
127
|
amount: bigint;
|
126
128
|
}[];
|
127
129
|
};
|
128
130
|
id: string;
|
129
|
-
tokens: {
|
131
|
+
tokens: ({
|
130
132
|
symbol: string;
|
131
133
|
name: string | null;
|
132
134
|
id: string;
|
@@ -135,8 +137,10 @@ declare const app: Elysia<"", false, {
|
|
135
137
|
icon: string;
|
136
138
|
decimals: number;
|
137
139
|
verified: boolean;
|
138
|
-
|
139
|
-
}
|
140
|
+
isTest: boolean;
|
141
|
+
} & {
|
142
|
+
price?: number | null | undefined;
|
143
|
+
})[];
|
140
144
|
chain: {
|
141
145
|
name: string;
|
142
146
|
id: number;
|
@@ -218,14 +222,16 @@ declare const app: Elysia<"", false, {
|
|
218
222
|
address: string;
|
219
223
|
icon: string;
|
220
224
|
decimals: number;
|
225
|
+
displaySymbol: string;
|
221
226
|
verified: boolean;
|
227
|
+
isTest: boolean;
|
222
228
|
price: number | null;
|
223
229
|
};
|
224
230
|
amount: bigint;
|
225
231
|
}[];
|
226
232
|
};
|
227
233
|
id: string;
|
228
|
-
tokens: {
|
234
|
+
tokens: ({
|
229
235
|
symbol: string;
|
230
236
|
name: string | null;
|
231
237
|
id: string;
|
@@ -234,8 +240,10 @@ declare const app: Elysia<"", false, {
|
|
234
240
|
icon: string;
|
235
241
|
decimals: number;
|
236
242
|
verified: boolean;
|
237
|
-
|
238
|
-
}
|
243
|
+
isTest: boolean;
|
244
|
+
} & {
|
245
|
+
price?: number | null | undefined;
|
246
|
+
})[];
|
239
247
|
chain: {
|
240
248
|
name: string;
|
241
249
|
id: number;
|
@@ -275,7 +283,9 @@ declare const app: Elysia<"", false, {
|
|
275
283
|
icon: string;
|
276
284
|
decimals: number;
|
277
285
|
verified: boolean;
|
278
|
-
|
286
|
+
isTest: boolean;
|
287
|
+
} & {
|
288
|
+
price?: number | null | undefined;
|
279
289
|
};
|
280
290
|
distributionChain: {
|
281
291
|
name: string;
|
@@ -327,6 +337,7 @@ declare const app: Elysia<"", false, {
|
|
327
337
|
action?: string | undefined;
|
328
338
|
mainProtocolId?: string | undefined;
|
329
339
|
order?: undefined;
|
340
|
+
test?: boolean | undefined;
|
330
341
|
minimumTvl?: number | undefined;
|
331
342
|
};
|
332
343
|
headers: unknown;
|
@@ -372,14 +383,16 @@ declare const app: Elysia<"", false, {
|
|
372
383
|
address: string;
|
373
384
|
icon: string;
|
374
385
|
decimals: number;
|
386
|
+
displaySymbol: string;
|
375
387
|
verified: boolean;
|
388
|
+
isTest: boolean;
|
376
389
|
price: number | null;
|
377
390
|
};
|
378
391
|
amount: bigint;
|
379
392
|
}[];
|
380
393
|
};
|
381
394
|
id: string;
|
382
|
-
tokens: {
|
395
|
+
tokens: ({
|
383
396
|
symbol: string;
|
384
397
|
name: string | null;
|
385
398
|
id: string;
|
@@ -388,8 +401,10 @@ declare const app: Elysia<"", false, {
|
|
388
401
|
icon: string;
|
389
402
|
decimals: number;
|
390
403
|
verified: boolean;
|
391
|
-
|
392
|
-
}
|
404
|
+
isTest: boolean;
|
405
|
+
} & {
|
406
|
+
price?: number | null | undefined;
|
407
|
+
})[];
|
393
408
|
chain: {
|
394
409
|
name: string;
|
395
410
|
id: number;
|
@@ -436,6 +451,7 @@ declare const app: Elysia<"", false, {
|
|
436
451
|
action?: string | undefined;
|
437
452
|
mainProtocolId?: string | undefined;
|
438
453
|
order?: undefined;
|
454
|
+
test?: boolean | undefined;
|
439
455
|
minimumTvl?: number | undefined;
|
440
456
|
};
|
441
457
|
headers: unknown;
|
@@ -466,6 +482,7 @@ declare const app: Elysia<"", false, {
|
|
466
482
|
action?: string | undefined;
|
467
483
|
mainProtocolId?: string | undefined;
|
468
484
|
order?: undefined;
|
485
|
+
test?: boolean | undefined;
|
469
486
|
minimumTvl?: number | undefined;
|
470
487
|
};
|
471
488
|
headers: unknown;
|
@@ -540,6 +557,7 @@ declare const app: Elysia<"", false, {
|
|
540
557
|
mainParameter?: string | undefined;
|
541
558
|
campaignId?: string | undefined;
|
542
559
|
opportunityId?: string | undefined;
|
560
|
+
test?: boolean | undefined;
|
543
561
|
tokenSymbol?: string | undefined;
|
544
562
|
};
|
545
563
|
headers: unknown;
|
@@ -560,7 +578,9 @@ declare const app: Elysia<"", false, {
|
|
560
578
|
icon: string;
|
561
579
|
decimals: number;
|
562
580
|
verified: boolean;
|
563
|
-
|
581
|
+
isTest: boolean;
|
582
|
+
} & {
|
583
|
+
price?: number | null | undefined;
|
564
584
|
};
|
565
585
|
distributionChain: {
|
566
586
|
name: string;
|
@@ -608,6 +628,7 @@ declare const app: Elysia<"", false, {
|
|
608
628
|
mainParameter?: string | undefined;
|
609
629
|
campaignId?: string | undefined;
|
610
630
|
opportunityId?: string | undefined;
|
631
|
+
test?: boolean | undefined;
|
611
632
|
tokenSymbol?: string | undefined;
|
612
633
|
};
|
613
634
|
headers: unknown;
|
@@ -763,6 +784,7 @@ declare const app: Elysia<"", false, {
|
|
763
784
|
icon: string;
|
764
785
|
decimals: number;
|
765
786
|
verified: boolean;
|
787
|
+
isTest: boolean;
|
766
788
|
price?: number | null | undefined;
|
767
789
|
} | undefined;
|
768
790
|
};
|
@@ -792,6 +814,7 @@ declare const app: Elysia<"", false, {
|
|
792
814
|
icon: string;
|
793
815
|
decimals: number;
|
794
816
|
verified: boolean;
|
817
|
+
isTest: boolean;
|
795
818
|
} & {
|
796
819
|
price?: number | null | undefined;
|
797
820
|
} & {
|
@@ -813,10 +836,11 @@ declare const app: Elysia<"", false, {
|
|
813
836
|
chainId?: any;
|
814
837
|
address?: string | undefined;
|
815
838
|
verified?: boolean | undefined;
|
839
|
+
test?: boolean | undefined;
|
816
840
|
};
|
817
841
|
headers: unknown;
|
818
842
|
response: {
|
819
|
-
200:
|
843
|
+
200: {
|
820
844
|
symbol: string;
|
821
845
|
name: string | null;
|
822
846
|
id: string;
|
@@ -824,10 +848,11 @@ declare const app: Elysia<"", false, {
|
|
824
848
|
address: string;
|
825
849
|
icon: string;
|
826
850
|
decimals: number;
|
851
|
+
displaySymbol: string;
|
827
852
|
verified: boolean;
|
828
|
-
|
829
|
-
price
|
830
|
-
}
|
853
|
+
isTest: boolean;
|
854
|
+
price: number | null;
|
855
|
+
}[];
|
831
856
|
};
|
832
857
|
};
|
833
858
|
};
|
@@ -844,6 +869,7 @@ declare const app: Elysia<"", false, {
|
|
844
869
|
chainId?: any;
|
845
870
|
address?: string | undefined;
|
846
871
|
verified?: boolean | undefined;
|
872
|
+
test?: boolean | undefined;
|
847
873
|
};
|
848
874
|
headers: unknown;
|
849
875
|
response: {
|
@@ -1487,7 +1513,9 @@ declare const app: Elysia<"", false, {
|
|
1487
1513
|
address: string;
|
1488
1514
|
icon: string;
|
1489
1515
|
decimals: number;
|
1516
|
+
displaySymbol: string;
|
1490
1517
|
verified: boolean;
|
1518
|
+
isTest: boolean;
|
1491
1519
|
price: number | null;
|
1492
1520
|
};
|
1493
1521
|
breakdowns: {
|
@@ -1506,7 +1534,9 @@ declare const app: Elysia<"", false, {
|
|
1506
1534
|
address: string;
|
1507
1535
|
icon: string;
|
1508
1536
|
decimals: number;
|
1537
|
+
displaySymbol: string;
|
1509
1538
|
verified: boolean;
|
1539
|
+
isTest: boolean;
|
1510
1540
|
price: number | null;
|
1511
1541
|
}[];
|
1512
1542
|
Protocols: {
|
@@ -1597,7 +1627,9 @@ declare const app: Elysia<"", false, {
|
|
1597
1627
|
address: string;
|
1598
1628
|
icon: string;
|
1599
1629
|
decimals: number;
|
1630
|
+
displaySymbol: string;
|
1600
1631
|
verified: boolean;
|
1632
|
+
isTest: boolean;
|
1601
1633
|
price: number | null;
|
1602
1634
|
};
|
1603
1635
|
breakdowns: {
|
@@ -1616,7 +1648,9 @@ declare const app: Elysia<"", false, {
|
|
1616
1648
|
address: string;
|
1617
1649
|
icon: string;
|
1618
1650
|
decimals: number;
|
1651
|
+
displaySymbol: string;
|
1619
1652
|
verified: boolean;
|
1653
|
+
isTest: boolean;
|
1620
1654
|
price: number | null;
|
1621
1655
|
}[];
|
1622
1656
|
Protocols: {
|
@@ -15,6 +15,8 @@ const factoryAddresses = {
|
|
15
15
|
"0xa19C51D91891D3DF7C13Ed22a2f89d328A82950f": tokenType.fenix, // Fenix Factory
|
16
16
|
"0x3a76e377ED58c8731F9DF3A36155942438744Ce3": tokenType.zkswap, // ZKSwap Factory
|
17
17
|
"0x6fcf753f2C67b83f7B09746Bbc4FA0047b35D050": tokenType.pendle, // Pendle Factory
|
18
|
+
"0x35A338522a435D46f77Be32C70E215B813D0e3aC": tokenType.pendleYT, // Pendle YT Factory
|
19
|
+
"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73": tokenType.pancakeswap, // PancakeSwap Factory BNB
|
18
20
|
};
|
19
21
|
export function getTypeFromFactoryAddress(address) {
|
20
22
|
if (factoryAddresses[address]) {
|
@@ -53,7 +53,9 @@ export declare enum tokenType {
|
|
53
53
|
maverickBoostedPosition = "maverickBoostedPosition",
|
54
54
|
zkSwapThreePool = "zkSwapThreePool",
|
55
55
|
maha = "maha",
|
56
|
-
tempest = "tempest"
|
56
|
+
tempest = "tempest",
|
57
|
+
pendleYT = "pendleYT",
|
58
|
+
pancakeswap = "pancakeswap"
|
57
59
|
}
|
58
60
|
export declare const tokenTypeToProtocol: {
|
59
61
|
[key in tokenType]: {
|
@@ -55,6 +55,8 @@ export var tokenType;
|
|
55
55
|
tokenType["zkSwapThreePool"] = "zkSwapThreePool";
|
56
56
|
tokenType["maha"] = "maha";
|
57
57
|
tokenType["tempest"] = "tempest";
|
58
|
+
tokenType["pendleYT"] = "pendleYT";
|
59
|
+
tokenType["pancakeswap"] = "pancakeswap";
|
58
60
|
})(tokenType || (tokenType = {}));
|
59
61
|
export const tokenTypeToProtocol = {
|
60
62
|
[tokenType.aave_borrowing]: { protocol: "Aave" },
|
@@ -123,4 +125,10 @@ export const tokenTypeToProtocol = {
|
|
123
125
|
[tokenType.tempest]: {
|
124
126
|
protocol: "Tempest",
|
125
127
|
},
|
128
|
+
[tokenType.pendleYT]: {
|
129
|
+
protocol: "Pendle",
|
130
|
+
},
|
131
|
+
[tokenType.pancakeswap]: {
|
132
|
+
protocol: "PancakeSwap V2",
|
133
|
+
},
|
126
134
|
};
|
@@ -0,0 +1,29 @@
|
|
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 dataRawPendleYT;
|
7
|
+
call: string;
|
8
|
+
target: keyof callKeysPendleYT;
|
9
|
+
metaData?: keyof callKeysPendleYT;
|
10
|
+
};
|
11
|
+
type callKeysPendleYT = mandatoryCallKeys & {
|
12
|
+
SYToken: string;
|
13
|
+
underlying: string;
|
14
|
+
symbolUnderlyingToken: string;
|
15
|
+
};
|
16
|
+
type dataRawPendleYT = callKeysPendleYT & {
|
17
|
+
readTokensRaw: string[];
|
18
|
+
};
|
19
|
+
type dataTypePendleYT = dataType & {};
|
20
|
+
export declare class PendleYTProcessor extends GenericProcessor<callKeysPendleYT, dataRawPendleYT, dataTypePendleYT> {
|
21
|
+
rounds: {
|
22
|
+
round1: callType[];
|
23
|
+
round2: callType[];
|
24
|
+
round3: callType[];
|
25
|
+
round4: callType[];
|
26
|
+
};
|
27
|
+
processingRound5(_index: number, type: tokenType, typeInfo: dataRawPendleYT, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypePendleYT>;
|
28
|
+
}
|
29
|
+
export {};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
+
import { ChainId } from "@sdk";
|
3
|
+
import { GenericProcessor } from "./GenericProcessor";
|
4
|
+
export class PendleYTProcessor extends GenericProcessor {
|
5
|
+
rounds = {
|
6
|
+
round1: [
|
7
|
+
{ key: "SYToken", call: "SY", target: "tokenAddress" },
|
8
|
+
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
9
|
+
],
|
10
|
+
round2: [{ key: "underlying", call: "underlying", target: "SYToken" }],
|
11
|
+
round3: [{ key: "symbolUnderlyingToken", call: "symbol", target: "underlying" }],
|
12
|
+
round4: [],
|
13
|
+
};
|
14
|
+
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
15
|
+
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
16
|
+
const priceTargetToken = (await pricer.get({
|
17
|
+
address: typeInfo.tokenAddress,
|
18
|
+
chainId: ChainId.MAINNET,
|
19
|
+
})) ?? 0;
|
20
|
+
const tvl = priceTargetToken * totalSupply;
|
21
|
+
return {
|
22
|
+
...typeInfo,
|
23
|
+
totalSupply,
|
24
|
+
tvl,
|
25
|
+
whitelistedSupplyTargetToken,
|
26
|
+
priceTargetToken: priceTargetToken,
|
27
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
28
|
+
blacklistedSupply,
|
29
|
+
};
|
30
|
+
}
|
31
|
+
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Pricer } from "../../../../../utils/pricer";
|
2
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
|
-
import type { tokenType } from "../helpers/tokenType";
|
3
|
+
import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
|
4
4
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawTempest;
|
@@ -23,6 +23,7 @@ type dataRawTempest = callKeysTempest & {
|
|
23
23
|
amount0Invested: string;
|
24
24
|
amount1Idle: string;
|
25
25
|
amount1Invested: string;
|
26
|
+
amountInQueue?: string;
|
26
27
|
decimalsToken0: string;
|
27
28
|
decimalsToken1: string;
|
28
29
|
positionsReturnData: {
|
@@ -45,6 +46,7 @@ export declare class TempestVaultProcessor extends GenericProcessor<callKeysTemp
|
|
45
46
|
round4: callType[];
|
46
47
|
};
|
47
48
|
processingRound2(typeInfo: dataRawTempest): void;
|
49
|
+
computeRound3(index: number, type: tokenType, typeInfo: dataRawTempest, calls: string[]): tokenTypeStruct;
|
48
50
|
processingRound5(_index: number, type: tokenType, typeInfo: dataRawTempest, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeTempest>;
|
49
51
|
}
|
50
52
|
export {};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
-
import { BN2Number } from "@sdk";
|
2
|
+
import { BN2Number, NULL_ADDRESS } from "@sdk";
|
3
3
|
import { GenericProcessor } from "./GenericProcessor";
|
4
4
|
export class TempestVaultProcessor extends GenericProcessor {
|
5
5
|
rounds = {
|
@@ -9,8 +9,8 @@ export class TempestVaultProcessor extends GenericProcessor {
|
|
9
9
|
],
|
10
10
|
round2: [
|
11
11
|
{ key: "symbolToken0", call: "symbol", target: "addressToken0" },
|
12
|
-
{ key: "symbolToken1", call: "symbol", target: "addressToken1" },
|
13
12
|
{ key: "decimalsToken0", call: "decimals", target: "addressToken0" },
|
13
|
+
{ key: "symbolToken1", call: "symbol", target: "addressToken1" },
|
14
14
|
{ key: "decimalsToken1", call: "decimals", target: "addressToken1" },
|
15
15
|
],
|
16
16
|
round3: [],
|
@@ -19,17 +19,46 @@ export class TempestVaultProcessor extends GenericProcessor {
|
|
19
19
|
processingRound2(typeInfo) {
|
20
20
|
typeInfo.addressToken0 = typeInfo.addressesReturnData[0];
|
21
21
|
typeInfo.addressToken1 = typeInfo.addressesReturnData[1];
|
22
|
-
typeInfo.amount0Invested = typeInfo.positionsReturnData[0];
|
23
|
-
typeInfo.amount1Invested = typeInfo.positionsReturnData[1];
|
24
|
-
typeInfo.amount0Idle = typeInfo.positionsReturnData[2];
|
25
|
-
typeInfo.amount1Idle = typeInfo.positionsReturnData[3];
|
22
|
+
typeInfo.amount0Invested = typeInfo.positionsReturnData[0].toString();
|
23
|
+
typeInfo.amount1Invested = typeInfo.positionsReturnData[1].toString();
|
24
|
+
typeInfo.amount0Idle = typeInfo.positionsReturnData[2].toString();
|
25
|
+
typeInfo.amount1Idle = typeInfo.positionsReturnData[3].toString();
|
26
|
+
try {
|
27
|
+
typeInfo.amountInQueue = typeInfo.positionsReturnData[4].toString();
|
28
|
+
}
|
29
|
+
catch { }
|
30
|
+
if (typeInfo.addressToken0 === NULL_ADDRESS) {
|
31
|
+
this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken0");
|
32
|
+
typeInfo.symbolToken0 = "ETH";
|
33
|
+
typeInfo.decimalsToken0 = "18";
|
34
|
+
}
|
35
|
+
if (typeInfo.addressToken1 === NULL_ADDRESS) {
|
36
|
+
this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken1");
|
37
|
+
typeInfo.symbolToken1 = "ETH";
|
38
|
+
typeInfo.decimalsToken1 = "18";
|
39
|
+
}
|
40
|
+
}
|
41
|
+
computeRound3(index, type, typeInfo, calls) {
|
42
|
+
if (typeInfo.addressToken0 === NULL_ADDRESS) {
|
43
|
+
this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken0");
|
44
|
+
typeInfo.symbolToken0 = "ETH";
|
45
|
+
typeInfo.decimalsToken0 = "18";
|
46
|
+
}
|
47
|
+
if (typeInfo.addressToken1 === NULL_ADDRESS) {
|
48
|
+
this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken1");
|
49
|
+
typeInfo.symbolToken1 = "ETH";
|
50
|
+
typeInfo.decimalsToken1 = "18";
|
51
|
+
}
|
52
|
+
return super.computeRound3(index, type, typeInfo, calls);
|
26
53
|
}
|
27
54
|
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
28
55
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
29
56
|
const decimalsToken0 = Number(typeInfo.decimalsToken0);
|
30
57
|
const decimalsToken1 = Number(typeInfo.decimalsToken1);
|
31
58
|
const amount0 = BN2Number(typeInfo.amount0Idle, decimalsToken0) + BN2Number(typeInfo.amount0Invested, decimalsToken0);
|
32
|
-
const amount1 = BN2Number(typeInfo.amount1Idle, decimalsToken1) +
|
59
|
+
const amount1 = BN2Number(typeInfo.amount1Idle, decimalsToken1) +
|
60
|
+
BN2Number(typeInfo.amount1Invested, decimalsToken1) +
|
61
|
+
(!!typeInfo.amountInQueue ? BN2Number(typeInfo.amountInQueue, decimalsToken1) : 0);
|
33
62
|
const tokenAPRice = (await pricer.get({ symbol: typeInfo.symbolToken0 })) ?? 0;
|
34
63
|
const tokenBPrice = (await pricer.get({ symbol: typeInfo.symbolToken1 })) ?? 0;
|
35
64
|
const tvl = tokenAPRice * amount0 + tokenBPrice * amount1;
|
@@ -16,6 +16,7 @@ import { GenericProcessor } from "./GenericProcessor";
|
|
16
16
|
import { MaverickBPProcessor } from "./MaverickBPProcessor";
|
17
17
|
import { MetamorphoProcessor } from "./MetamorphoProcessor";
|
18
18
|
import { PendleProcessor } from "./PendleProcessor";
|
19
|
+
import { PendleYTProcessor } from "./PendleYTProcessor";
|
19
20
|
import { RadiantProcessor } from "./RadiantProcessor";
|
20
21
|
import { RfxProcessor } from "./RfxProcessor";
|
21
22
|
import { SpliceProcessor } from "./SpliceProcessor";
|
@@ -82,4 +83,6 @@ export const processorMapping = {
|
|
82
83
|
[tokenType.zkSwapThreePool]: ZkSwapThreePoolProcessor,
|
83
84
|
[tokenType.maha]: StakedCurveProcessor,
|
84
85
|
[tokenType.tempest]: TempestVaultProcessor,
|
86
|
+
[tokenType.pendleYT]: PendleYTProcessor,
|
87
|
+
[tokenType.pancakeswap]: UniswapProcessor,
|
85
88
|
};
|
@@ -91,7 +91,7 @@ function satisfiesNameConditions(name, type) {
|
|
91
91
|
case tokenType.maha:
|
92
92
|
return lowerCaseName.includes("staked") && lowerCaseName.includes("maha");
|
93
93
|
case tokenType.tempest:
|
94
|
-
return lowerCaseName.startsWith("ts");
|
94
|
+
return lowerCaseName.startsWith("ts") || lowerCaseName.startsWith("tempest");
|
95
95
|
default:
|
96
96
|
return false;
|
97
97
|
}
|
@@ -71,6 +71,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
71
71
|
mainParameter?: string | undefined;
|
72
72
|
campaignId?: string | undefined;
|
73
73
|
opportunityId?: string | undefined;
|
74
|
+
test?: boolean | undefined;
|
74
75
|
tokenSymbol?: string | undefined;
|
75
76
|
};
|
76
77
|
headers: unknown;
|
@@ -91,7 +92,9 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
91
92
|
icon: string;
|
92
93
|
decimals: number;
|
93
94
|
verified: boolean;
|
94
|
-
|
95
|
+
isTest: boolean;
|
96
|
+
} & {
|
97
|
+
price?: number | null | undefined;
|
95
98
|
};
|
96
99
|
distributionChain: {
|
97
100
|
name: string;
|
@@ -139,6 +142,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
139
142
|
mainParameter?: string | undefined;
|
140
143
|
campaignId?: string | undefined;
|
141
144
|
opportunityId?: string | undefined;
|
145
|
+
test?: boolean | undefined;
|
142
146
|
tokenSymbol?: string | undefined;
|
143
147
|
};
|
144
148
|
headers: unknown;
|
@@ -77,6 +77,7 @@ export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
|
|
77
77
|
mainParameter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
78
78
|
tokenSymbol: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
79
79
|
tokenAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
80
|
+
test: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
80
81
|
opportunityId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
81
82
|
startTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
82
83
|
endTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
@@ -48,6 +48,7 @@ export const GetCampaignQueryDto = t.Object({
|
|
48
48
|
mainParameter: t.Optional(t.String()),
|
49
49
|
tokenSymbol: t.Optional(t.String()),
|
50
50
|
tokenAddress: t.Optional(t.String()),
|
51
|
+
test: t.Optional(t.Boolean()),
|
51
52
|
opportunityId: t.Optional(t.String()),
|
52
53
|
startTimestamp: t.Optional(t.String({ pattern: "[0-9].*" })),
|
53
54
|
endTimestamp: t.Optional(t.String({ pattern: "[0-9].*" })),
|
@@ -10,7 +10,7 @@ import { TokenService } from "../token";
|
|
10
10
|
export class CampaignRepository {
|
11
11
|
// ─── Private Methods ─────────────────────────────────────────────────
|
12
12
|
static #transformQueryToPrismaFilters(query) {
|
13
|
-
const { chainId, endTimestamp, opportunityId, mainParameter, campaignId, startTimestamp, subType, type, tokenAddress, tokenSymbol, } = query;
|
13
|
+
const { chainId, endTimestamp, opportunityId, mainParameter, campaignId, startTimestamp, subType, type, tokenAddress, tokenSymbol, test, } = query;
|
14
14
|
return {
|
15
15
|
where: {
|
16
16
|
computeChainId: chainId,
|
@@ -26,6 +26,8 @@ export class CampaignRepository {
|
|
26
26
|
RewardToken: {
|
27
27
|
address: tokenAddress ? tokenAddress : undefined,
|
28
28
|
symbol: tokenSymbol ? tokenSymbol : undefined,
|
29
|
+
displaySymbol: tokenSymbol ? tokenSymbol : undefined,
|
30
|
+
isTest: !test ? false : undefined,
|
29
31
|
},
|
30
32
|
},
|
31
33
|
};
|
@@ -44,7 +44,9 @@ export declare abstract class CampaignService {
|
|
44
44
|
icon: string;
|
45
45
|
decimals: number;
|
46
46
|
verified: boolean;
|
47
|
-
|
47
|
+
isTest: boolean;
|
48
|
+
} & {
|
49
|
+
price?: number | null | undefined;
|
48
50
|
};
|
49
51
|
distributionChain: {
|
50
52
|
name: string;
|
@@ -176,7 +178,9 @@ export declare abstract class CampaignService {
|
|
176
178
|
icon: string;
|
177
179
|
decimals: number;
|
178
180
|
verified: boolean;
|
179
|
-
|
181
|
+
isTest: boolean;
|
182
|
+
} & {
|
183
|
+
price?: number | null | undefined;
|
180
184
|
};
|
181
185
|
distributionChain: {
|
182
186
|
name: string;
|
@@ -8,6 +8,7 @@ import { log } from "../../../utils/logger";
|
|
8
8
|
import { NETWORK_LABELS } from "@sdk";
|
9
9
|
import moment from "moment";
|
10
10
|
import { StatusService } from "../status";
|
11
|
+
import { TokenService } from "../token";
|
11
12
|
export class CampaignService {
|
12
13
|
static hashId(campaign) {
|
13
14
|
return Bun.hash(`${campaign.distributionChain}${campaign.campaignId}`).toString();
|
@@ -169,7 +170,7 @@ export class CampaignService {
|
|
169
170
|
...c,
|
170
171
|
params: params,
|
171
172
|
chain: ComputeChain,
|
172
|
-
rewardToken: RewardToken,
|
173
|
+
rewardToken: TokenService.format(RewardToken),
|
173
174
|
distributionChain: DistributionChain === null ? undefined : DistributionChain,
|
174
175
|
// Todo: need to be change to single 1 to 1 with campaign
|
175
176
|
campaignStatus: CampaignStatus?.[0],
|