@merkl/api 0.13.14 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/eden/index.d.ts +25 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/jobs/etl/pendings.js +3 -1
- package/dist/src/jobs/etl/reward-breakdowns.js +3 -1
- package/dist/src/jobs/etl/rewards.js +4 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.d.ts +2 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.d.ts +8 -12
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.js +28 -24
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerLendProcessor.d.ts +7 -11
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerLendProcessor.js +20 -21
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.d.ts +6 -5
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.js +4 -4
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/RfxProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/RfxProcessor.js +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +3 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.js +2 -2
- package/dist/src/libs/campaigns/campaignsDynamicData.js +1 -2
- package/dist/src/modules/v4/bucket/bucket.model.d.ts +10 -0
- package/dist/src/modules/v4/bucket/bucket.model.js +85 -0
- package/dist/src/modules/v4/bucket/bucket.service.d.ts +8 -6
- package/dist/src/modules/v4/bucket/bucket.service.js +145 -83
- package/dist/src/modules/v4/campaign/campaign.repository.js +1 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.js +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +2 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +61 -1
- package/dist/src/modules/v4/router.d.ts +5 -0
- package/dist/src/utils/generateCardName.js +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.d.ts +0 -3
- package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.js +0 -165
package/dist/src/eden/index.d.ts
CHANGED
@@ -455,6 +455,7 @@ declare const eden: {
|
|
455
455
|
query: {
|
456
456
|
sort?: string | undefined;
|
457
457
|
name?: string | undefined;
|
458
|
+
type?: string | undefined;
|
458
459
|
tokens?: string | undefined;
|
459
460
|
status?: string | undefined;
|
460
461
|
items?: number | undefined;
|
@@ -566,6 +567,7 @@ declare const eden: {
|
|
566
567
|
query: {
|
567
568
|
sort?: string | undefined;
|
568
569
|
name?: string | undefined;
|
570
|
+
type?: string | undefined;
|
569
571
|
tokens?: string | undefined;
|
570
572
|
status?: string | undefined;
|
571
573
|
items?: number | undefined;
|
@@ -758,6 +760,7 @@ declare const eden: {
|
|
758
760
|
query: {
|
759
761
|
sort?: string | undefined;
|
760
762
|
name?: string | undefined;
|
763
|
+
type?: string | undefined;
|
761
764
|
tokens?: string | undefined;
|
762
765
|
status?: string | undefined;
|
763
766
|
items?: number | undefined;
|
@@ -786,6 +789,7 @@ declare const eden: {
|
|
786
789
|
query: {
|
787
790
|
sort?: string | undefined;
|
788
791
|
name?: string | undefined;
|
792
|
+
type?: string | undefined;
|
789
793
|
tokens?: string | undefined;
|
790
794
|
status?: string | undefined;
|
791
795
|
items?: number | undefined;
|
@@ -814,6 +818,7 @@ declare const eden: {
|
|
814
818
|
query: {
|
815
819
|
sort?: string | undefined;
|
816
820
|
name?: string | undefined;
|
821
|
+
type?: string | undefined;
|
817
822
|
tokens?: string | undefined;
|
818
823
|
status?: string | undefined;
|
819
824
|
items?: number | undefined;
|
@@ -3497,6 +3502,7 @@ declare const eden: {
|
|
3497
3502
|
query: {
|
3498
3503
|
sort?: string | undefined;
|
3499
3504
|
name?: string | undefined;
|
3505
|
+
type?: string | undefined;
|
3500
3506
|
tokens?: string | undefined;
|
3501
3507
|
status?: string | undefined;
|
3502
3508
|
items?: number | undefined;
|
@@ -3608,6 +3614,7 @@ declare const eden: {
|
|
3608
3614
|
query: {
|
3609
3615
|
sort?: string | undefined;
|
3610
3616
|
name?: string | undefined;
|
3617
|
+
type?: string | undefined;
|
3611
3618
|
tokens?: string | undefined;
|
3612
3619
|
status?: string | undefined;
|
3613
3620
|
items?: number | undefined;
|
@@ -3800,6 +3807,7 @@ declare const eden: {
|
|
3800
3807
|
query: {
|
3801
3808
|
sort?: string | undefined;
|
3802
3809
|
name?: string | undefined;
|
3810
|
+
type?: string | undefined;
|
3803
3811
|
tokens?: string | undefined;
|
3804
3812
|
status?: string | undefined;
|
3805
3813
|
items?: number | undefined;
|
@@ -3828,6 +3836,7 @@ declare const eden: {
|
|
3828
3836
|
query: {
|
3829
3837
|
sort?: string | undefined;
|
3830
3838
|
name?: string | undefined;
|
3839
|
+
type?: string | undefined;
|
3831
3840
|
tokens?: string | undefined;
|
3832
3841
|
status?: string | undefined;
|
3833
3842
|
items?: number | undefined;
|
@@ -3856,6 +3865,7 @@ declare const eden: {
|
|
3856
3865
|
query: {
|
3857
3866
|
sort?: string | undefined;
|
3858
3867
|
name?: string | undefined;
|
3868
|
+
type?: string | undefined;
|
3859
3869
|
tokens?: string | undefined;
|
3860
3870
|
status?: string | undefined;
|
3861
3871
|
items?: number | undefined;
|
@@ -7026,6 +7036,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7026
7036
|
query: {
|
7027
7037
|
sort?: string | undefined;
|
7028
7038
|
name?: string | undefined;
|
7039
|
+
type?: string | undefined;
|
7029
7040
|
tokens?: string | undefined;
|
7030
7041
|
status?: string | undefined;
|
7031
7042
|
items?: number | undefined;
|
@@ -7142,6 +7153,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7142
7153
|
query: {
|
7143
7154
|
sort?: string | undefined;
|
7144
7155
|
name?: string | undefined;
|
7156
|
+
type?: string | undefined;
|
7145
7157
|
tokens?: string | undefined;
|
7146
7158
|
status?: string | undefined;
|
7147
7159
|
items?: number | undefined;
|
@@ -7614,6 +7626,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7614
7626
|
query: {
|
7615
7627
|
sort?: string | undefined;
|
7616
7628
|
name?: string | undefined;
|
7629
|
+
type?: string | undefined;
|
7617
7630
|
tokens?: string | undefined;
|
7618
7631
|
status?: string | undefined;
|
7619
7632
|
items?: number | undefined;
|
@@ -7650,6 +7663,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7650
7663
|
query: {
|
7651
7664
|
sort?: string | undefined;
|
7652
7665
|
name?: string | undefined;
|
7666
|
+
type?: string | undefined;
|
7653
7667
|
tokens?: string | undefined;
|
7654
7668
|
status?: string | undefined;
|
7655
7669
|
items?: number | undefined;
|
@@ -7687,6 +7701,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
7687
7701
|
query: {
|
7688
7702
|
sort?: string | undefined;
|
7689
7703
|
name?: string | undefined;
|
7704
|
+
type?: string | undefined;
|
7690
7705
|
tokens?: string | undefined;
|
7691
7706
|
status?: string | undefined;
|
7692
7707
|
items?: number | undefined;
|
@@ -11895,6 +11910,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
11895
11910
|
query: {
|
11896
11911
|
sort?: string | undefined;
|
11897
11912
|
name?: string | undefined;
|
11913
|
+
type?: string | undefined;
|
11898
11914
|
tokens?: string | undefined;
|
11899
11915
|
status?: string | undefined;
|
11900
11916
|
items?: number | undefined;
|
@@ -12006,6 +12022,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12006
12022
|
query: {
|
12007
12023
|
sort?: string | undefined;
|
12008
12024
|
name?: string | undefined;
|
12025
|
+
type?: string | undefined;
|
12009
12026
|
tokens?: string | undefined;
|
12010
12027
|
status?: string | undefined;
|
12011
12028
|
items?: number | undefined;
|
@@ -12198,6 +12215,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12198
12215
|
query: {
|
12199
12216
|
sort?: string | undefined;
|
12200
12217
|
name?: string | undefined;
|
12218
|
+
type?: string | undefined;
|
12201
12219
|
tokens?: string | undefined;
|
12202
12220
|
status?: string | undefined;
|
12203
12221
|
items?: number | undefined;
|
@@ -12226,6 +12244,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12226
12244
|
query: {
|
12227
12245
|
sort?: string | undefined;
|
12228
12246
|
name?: string | undefined;
|
12247
|
+
type?: string | undefined;
|
12229
12248
|
tokens?: string | undefined;
|
12230
12249
|
status?: string | undefined;
|
12231
12250
|
items?: number | undefined;
|
@@ -12254,6 +12273,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12254
12273
|
query: {
|
12255
12274
|
sort?: string | undefined;
|
12256
12275
|
name?: string | undefined;
|
12276
|
+
type?: string | undefined;
|
12257
12277
|
tokens?: string | undefined;
|
12258
12278
|
status?: string | undefined;
|
12259
12279
|
items?: number | undefined;
|
@@ -14937,6 +14957,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14937
14957
|
query: {
|
14938
14958
|
sort?: string | undefined;
|
14939
14959
|
name?: string | undefined;
|
14960
|
+
type?: string | undefined;
|
14940
14961
|
tokens?: string | undefined;
|
14941
14962
|
status?: string | undefined;
|
14942
14963
|
items?: number | undefined;
|
@@ -15048,6 +15069,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15048
15069
|
query: {
|
15049
15070
|
sort?: string | undefined;
|
15050
15071
|
name?: string | undefined;
|
15072
|
+
type?: string | undefined;
|
15051
15073
|
tokens?: string | undefined;
|
15052
15074
|
status?: string | undefined;
|
15053
15075
|
items?: number | undefined;
|
@@ -15240,6 +15262,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15240
15262
|
query: {
|
15241
15263
|
sort?: string | undefined;
|
15242
15264
|
name?: string | undefined;
|
15265
|
+
type?: string | undefined;
|
15243
15266
|
tokens?: string | undefined;
|
15244
15267
|
status?: string | undefined;
|
15245
15268
|
items?: number | undefined;
|
@@ -15268,6 +15291,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15268
15291
|
query: {
|
15269
15292
|
sort?: string | undefined;
|
15270
15293
|
name?: string | undefined;
|
15294
|
+
type?: string | undefined;
|
15271
15295
|
tokens?: string | undefined;
|
15272
15296
|
status?: string | undefined;
|
15273
15297
|
items?: number | undefined;
|
@@ -15296,6 +15320,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
15296
15320
|
query: {
|
15297
15321
|
sort?: string | undefined;
|
15298
15322
|
name?: string | undefined;
|
15323
|
+
type?: string | undefined;
|
15299
15324
|
tokens?: string | undefined;
|
15300
15325
|
status?: string | undefined;
|
15301
15326
|
items?: number | undefined;
|
package/dist/src/index.d.ts
CHANGED
@@ -253,6 +253,7 @@ declare const app: Elysia<"", false, {
|
|
253
253
|
query: {
|
254
254
|
sort?: string | undefined;
|
255
255
|
name?: string | undefined;
|
256
|
+
type?: string | undefined;
|
256
257
|
tokens?: string | undefined;
|
257
258
|
status?: string | undefined;
|
258
259
|
items?: number | undefined;
|
@@ -369,6 +370,7 @@ declare const app: Elysia<"", false, {
|
|
369
370
|
query: {
|
370
371
|
sort?: string | undefined;
|
371
372
|
name?: string | undefined;
|
373
|
+
type?: string | undefined;
|
372
374
|
tokens?: string | undefined;
|
373
375
|
status?: string | undefined;
|
374
376
|
items?: number | undefined;
|
@@ -841,6 +843,7 @@ declare const app: Elysia<"", false, {
|
|
841
843
|
query: {
|
842
844
|
sort?: string | undefined;
|
843
845
|
name?: string | undefined;
|
846
|
+
type?: string | undefined;
|
844
847
|
tokens?: string | undefined;
|
845
848
|
status?: string | undefined;
|
846
849
|
items?: number | undefined;
|
@@ -877,6 +880,7 @@ declare const app: Elysia<"", false, {
|
|
877
880
|
query: {
|
878
881
|
sort?: string | undefined;
|
879
882
|
name?: string | undefined;
|
883
|
+
type?: string | undefined;
|
880
884
|
tokens?: string | undefined;
|
881
885
|
status?: string | undefined;
|
882
886
|
items?: number | undefined;
|
@@ -914,6 +918,7 @@ declare const app: Elysia<"", false, {
|
|
914
918
|
query: {
|
915
919
|
sort?: string | undefined;
|
916
920
|
name?: string | undefined;
|
921
|
+
type?: string | undefined;
|
917
922
|
tokens?: string | undefined;
|
918
923
|
status?: string | undefined;
|
919
924
|
items?: number | undefined;
|
@@ -17,7 +17,9 @@ const gcsClient = new S3Client({
|
|
17
17
|
endpoint: process.env.GCS_ENDPOINT,
|
18
18
|
bucket: `merkl-rewards-lake-${process.env.ENV}`,
|
19
19
|
});
|
20
|
-
|
20
|
+
let file = gcsClient.file(`pendings/${process.env.FILENAME}`);
|
21
|
+
if (!(await file.exists))
|
22
|
+
file = gcsClient.file(`pendings/${process.env.FILENAME}.gz`);
|
21
23
|
// ─── Extract ─────────────────────────────────────────────────────────────────
|
22
24
|
const extract = async () => {
|
23
25
|
if (!file.exists())
|
@@ -13,7 +13,9 @@ const gcsClient = new S3Client({
|
|
13
13
|
endpoint: process.env.GCS_ENDPOINT,
|
14
14
|
bucket: `merkl-rewards-lake-${process.env.ENV}`,
|
15
15
|
});
|
16
|
-
|
16
|
+
let file = gcsClient.file(`breakdowns/${process.env.CHAIN_ID}-${process.env.ROOT}`);
|
17
|
+
if (!(await file.exists()))
|
18
|
+
file = gcsClient.file(`breakdowns/${process.env.CHAIN_ID}-${process.env.ROOT}.gz`);
|
17
19
|
const failedBatches = [];
|
18
20
|
// ─── Extract ─────────────────────────────────────────────────────────────────
|
19
21
|
const extract = async () => {
|
@@ -13,7 +13,9 @@ const gcsClient = new S3Client({
|
|
13
13
|
endpoint: process.env.GCS_ENDPOINT,
|
14
14
|
bucket: `merkl-rewards-lake-${process.env.ENV}`,
|
15
15
|
});
|
16
|
-
|
16
|
+
let file = gcsClient.file(`rewards/${process.env.CHAIN_ID}-${process.env.ROOT}`);
|
17
|
+
if (!(await file.exists()))
|
18
|
+
file = gcsClient.file(`rewards/${process.env.CHAIN_ID}-${process.env.ROOT}.gz`);
|
17
19
|
const failedBatches = [];
|
18
20
|
// ─── Extract ─────────────────────────────────────────────────────────────────
|
19
21
|
const extract = async () => {
|
@@ -99,8 +101,7 @@ export const main = async () => {
|
|
99
101
|
log.error("rewards", `${failedBatches.length} batches failed.`);
|
100
102
|
process.exit(1);
|
101
103
|
}
|
102
|
-
if (failedBatches.length === 0)
|
104
|
+
if (failedBatches.length === 0)
|
103
105
|
await file.delete();
|
104
|
-
}
|
105
106
|
};
|
106
107
|
main();
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { type Campaign, type CampaignDynamicData, type CampaignParameters, type MerklChainId } from "@sdk";
|
2
2
|
import type { UncachedResult } from "../../../utils/execute";
|
3
|
-
export
|
3
|
+
export type ERC20SupportedCampaignType = Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR | Campaign.EULER;
|
4
|
+
export declare function ERC20DynamicData(chainId: MerklChainId, campaigns: CampaignParameters<ERC20SupportedCampaignType>[]): Promise<UncachedResult<Partial<CampaignDynamicData<ERC20SupportedCampaignType>[]>>>;
|
@@ -76,7 +76,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
76
76
|
for (const campaign of campaigns) {
|
77
77
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
78
78
|
const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
|
79
|
-
tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound2(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultRound2);
|
79
|
+
tokenTypesByCampaign[campaign.campaignId] = getTokenTypeRound2(j, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, resultRound2, campaign);
|
80
80
|
j += callsForCampaign;
|
81
81
|
callsRounds3.push(...tokenTypesByCampaign[campaign.campaignId].calls);
|
82
82
|
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.d.ts
CHANGED
@@ -9,22 +9,17 @@ type callType = {
|
|
9
9
|
metaData?: keyof callKeysEuler;
|
10
10
|
};
|
11
11
|
type callKeysEuler = mandatoryCallKeys & {
|
12
|
-
|
13
|
-
underlying: string;
|
14
|
-
symbolUnderlyingToken: string;
|
15
|
-
decimalsUnderlyingToken: string;
|
16
|
-
targetTotalAsset: string;
|
12
|
+
addressVault: string;
|
17
13
|
totalAssets: string;
|
18
14
|
};
|
19
15
|
type dataRawEuler = callKeysEuler & {};
|
20
16
|
type dataTypeEuler = dataType & {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
addressVault: string;
|
18
|
+
asset: string;
|
19
|
+
symbolAsset: string;
|
20
|
+
decimalsAsset: number;
|
25
21
|
totalSupply: number;
|
26
|
-
|
27
|
-
totalAssets: string;
|
22
|
+
totalBorrows: string;
|
28
23
|
};
|
29
24
|
export declare class EulerBorrowProcessor extends GenericProcessor<callKeysEuler, dataRawEuler, dataTypeEuler> {
|
30
25
|
rounds: {
|
@@ -33,6 +28,7 @@ export declare class EulerBorrowProcessor extends GenericProcessor<callKeysEuler
|
|
33
28
|
round3: callType[];
|
34
29
|
round4: callType[];
|
35
30
|
};
|
36
|
-
|
31
|
+
processingRound2(typeInfo: dataRawEuler, campaign: CampaignParameters<Campaign.EULER>): void;
|
32
|
+
processingRound5(_index: number, type: tokenType, typeInfo: dataRawEuler, _calls: string[], campaign: CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeEuler>;
|
37
33
|
}
|
38
34
|
export {};
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerBorrowProcessor.js
CHANGED
@@ -1,46 +1,50 @@
|
|
1
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
-
import { BN2Number } from "@sdk";
|
2
|
+
import { BN2Number, EulerSubCampaignType } from "@sdk";
|
3
3
|
import { fetchEulerVaultName } from "../helpers/eulerVaultNames";
|
4
4
|
import { GenericProcessor } from "./GenericProcessor";
|
5
5
|
export class EulerBorrowProcessor extends GenericProcessor {
|
6
6
|
rounds = {
|
7
|
-
round1: [
|
8
|
-
round2: [
|
9
|
-
round3: [
|
10
|
-
{ key: "decimalsUnderlyingToken", call: "decimals", target: "underlying" },
|
11
|
-
{ key: "symbolUnderlyingToken", call: "symbol", target: "underlying" },
|
12
|
-
],
|
7
|
+
round1: [],
|
8
|
+
round2: [],
|
9
|
+
round3: [],
|
13
10
|
round4: [
|
14
11
|
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
15
|
-
{ key: "totalAssets", call: "totalAssets", target: "
|
12
|
+
{ key: "totalAssets", call: "totalAssets", target: "addressVault" },
|
16
13
|
],
|
17
14
|
};
|
18
|
-
|
15
|
+
processingRound2(typeInfo, campaign) {
|
16
|
+
typeInfo.addressVault = campaign.campaignParameters.evkAddress;
|
17
|
+
}
|
19
18
|
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
20
19
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
21
|
-
const
|
22
|
-
|
23
|
-
|
24
|
-
const
|
25
|
-
|
26
|
-
|
27
|
-
typeInfo.totalAssets, decimalsUnderlyingToken);
|
28
|
-
cardName = generateCardName(type, typeInfo, campaign);
|
29
|
-
const vaultName = await fetchEulerVaultName(typeInfo.vault, campaign.chainId);
|
20
|
+
const symbolAsset = campaign.campaignParameters.symbolAsset;
|
21
|
+
const decimalsAsset = Number(campaign.campaignParameters.decimalsAsset);
|
22
|
+
const priceAsset = (await pricer.get({ symbol: symbolAsset })) ?? 1;
|
23
|
+
const totalBorrows = BN2Number(typeInfo.totalAssets, decimalsAsset);
|
24
|
+
let cardName = generateCardName(type, typeInfo, campaign);
|
25
|
+
const vaultName = await fetchEulerVaultName(campaign.campaignParameters.evkAddress, campaign.chainId);
|
30
26
|
if (!!vaultName) {
|
31
27
|
cardName = `Borrow from ${vaultName} vault`;
|
32
28
|
}
|
33
|
-
|
29
|
+
if (campaign.campaignSubType === EulerSubCampaignType.BORROW_FROM_COLLATERAL) {
|
30
|
+
cardName = `${cardName} using ${campaign.campaignParameters.symbolCollateral}`;
|
31
|
+
// TODO
|
32
|
+
}
|
33
|
+
const tvl = priceAsset * totalBorrows;
|
34
34
|
const priceTargetToken = tvl / totalSupply;
|
35
35
|
return {
|
36
36
|
...typeInfo,
|
37
|
-
|
37
|
+
asset: campaign.campaignParameters.addressAsset,
|
38
|
+
addressVault: typeInfo.addressVault,
|
38
39
|
blacklistedSupply,
|
39
|
-
whitelistedSupplyTargetToken,
|
40
|
-
tvl,
|
41
|
-
priceTargetToken,
|
42
40
|
cardName: cardName,
|
43
|
-
|
41
|
+
decimalsAsset,
|
42
|
+
priceTargetToken,
|
43
|
+
symbolAsset,
|
44
|
+
totalBorrows: typeInfo.totalAssets.toString(),
|
45
|
+
totalSupply,
|
46
|
+
tvl,
|
47
|
+
whitelistedSupplyTargetToken,
|
44
48
|
};
|
45
49
|
}
|
46
50
|
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/EulerLendProcessor.d.ts
CHANGED
@@ -9,21 +9,16 @@ type callType = {
|
|
9
9
|
metaData?: keyof callKeysEuler;
|
10
10
|
};
|
11
11
|
type callKeysEuler = mandatoryCallKeys & {
|
12
|
-
|
13
|
-
underlying: string;
|
14
|
-
symbolUnderlyingToken: string;
|
15
|
-
decimalsUnderlyingToken: string;
|
16
|
-
targetTotalAsset: string;
|
12
|
+
addressVault: string;
|
17
13
|
totalAssets: string;
|
18
14
|
};
|
19
15
|
type dataRawEuler = callKeysEuler & {};
|
20
16
|
type dataTypeEuler = dataType & {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
addressVault: string;
|
18
|
+
asset: string;
|
19
|
+
symbolAsset: string;
|
20
|
+
decimalsAsset: number;
|
25
21
|
totalSupply: number;
|
26
|
-
targetTotalAsset: string;
|
27
22
|
totalAssets: string;
|
28
23
|
};
|
29
24
|
export declare class EulerLendProcessor extends GenericProcessor<callKeysEuler, dataRawEuler, dataTypeEuler> {
|
@@ -33,6 +28,7 @@ export declare class EulerLendProcessor extends GenericProcessor<callKeysEuler,
|
|
33
28
|
round3: callType[];
|
34
29
|
round4: callType[];
|
35
30
|
};
|
36
|
-
|
31
|
+
processingRound2(typeInfo: dataRawEuler, campaign: CampaignParameters<Campaign.EULER>): void;
|
32
|
+
processingRound5(index: number, type: tokenType, typeInfo: dataRawEuler, calls: string[], campaign: CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeEuler>;
|
37
33
|
}
|
38
34
|
export {};
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { decodeCall } from "../../../../../utils/decodeCalls";
|
2
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
3
2
|
import { BN2Number } from "@sdk";
|
4
3
|
import { fetchEulerVaultName } from "../helpers/eulerVaultNames";
|
@@ -6,42 +5,42 @@ import { GenericProcessor } from "./GenericProcessor";
|
|
6
5
|
export class EulerLendProcessor extends GenericProcessor {
|
7
6
|
rounds = {
|
8
7
|
round1: [],
|
9
|
-
round2: [
|
10
|
-
round3: [
|
11
|
-
{ key: "decimalsUnderlyingToken", call: "decimals", target: "underlying" },
|
12
|
-
{ key: "symbolUnderlyingToken", call: "symbol", target: "underlying" },
|
13
|
-
],
|
8
|
+
round2: [],
|
9
|
+
round3: [],
|
14
10
|
round4: [
|
15
11
|
{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" },
|
16
12
|
{ key: "totalAssets", call: "totalAssets", target: "tokenAddress" },
|
17
13
|
],
|
18
14
|
};
|
19
|
-
|
15
|
+
processingRound2(typeInfo, campaign) {
|
16
|
+
typeInfo.addressVault = campaign.campaignParameters.evkAddress;
|
17
|
+
}
|
20
18
|
async processingRound5(index, type, typeInfo, calls, campaign, pricer) {
|
21
19
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
22
|
-
const
|
23
|
-
|
24
|
-
|
25
|
-
const
|
26
|
-
|
27
|
-
// eulerInterface.decodeFunctionResult("totalAssets", calls[index++])[0],
|
28
|
-
decodeCall(calls, index++, "totalAssets", type), decimalsUnderlyingToken);
|
29
|
-
cardName = generateCardName(type, typeInfo, campaign);
|
20
|
+
const symbolAsset = campaign.campaignParameters.symbolAsset;
|
21
|
+
const decimalsAsset = Number(campaign.campaignParameters.decimalsAsset);
|
22
|
+
const priceAsset = (await pricer.get({ symbol: symbolAsset })) ?? 1;
|
23
|
+
const totalAssets = BN2Number(typeInfo.totalAssets, decimalsAsset);
|
24
|
+
let cardName = generateCardName(type, typeInfo, campaign);
|
30
25
|
const vaultName = await fetchEulerVaultName(typeInfo.tokenAddress, campaign.chainId);
|
31
26
|
if (!!vaultName) {
|
32
|
-
cardName = `Supply ${
|
27
|
+
cardName = `Supply ${symbolAsset} on ${vaultName} vault`;
|
33
28
|
}
|
34
|
-
const tvl =
|
29
|
+
const tvl = priceAsset * totalAssets;
|
35
30
|
const priceTargetToken = tvl / totalSupply;
|
36
31
|
return {
|
37
32
|
...typeInfo,
|
38
|
-
|
33
|
+
asset: campaign.campaignParameters.addressAsset,
|
34
|
+
addressVault: typeInfo.addressVault,
|
39
35
|
blacklistedSupply,
|
36
|
+
cardName: cardName,
|
37
|
+
decimalsAsset,
|
38
|
+
priceTargetToken,
|
39
|
+
symbolAsset,
|
40
|
+
totalAssets: typeInfo.totalAssets.toString(),
|
41
|
+
totalSupply,
|
40
42
|
tvl,
|
41
43
|
whitelistedSupplyTargetToken,
|
42
|
-
priceTargetToken,
|
43
|
-
cardName: cardName,
|
44
|
-
totalAssets: typeInfo.totalAssets,
|
45
44
|
};
|
46
45
|
}
|
47
46
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Pricer } from "../../../../../utils/pricer";
|
2
2
|
import { type CallDto, type Campaign, type CampaignParameters } from "@sdk";
|
3
|
+
import type { ERC20SupportedCampaignType } from "../../ERC20DynamicData";
|
3
4
|
import { type tokenType, type tokenTypeStruct } from "../helpers/tokenType";
|
4
5
|
export declare enum roundType {
|
5
6
|
one = "round1",
|
@@ -51,8 +52,8 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
51
52
|
round4: callType[];
|
52
53
|
};
|
53
54
|
debug: boolean;
|
54
|
-
processingRound1(typeInfo: DataRaw
|
55
|
-
processingRound2(typeInfo: DataRaw): void;
|
55
|
+
processingRound1(typeInfo: DataRaw): void;
|
56
|
+
processingRound2(typeInfo: DataRaw, campaign?: CampaignParameters<ERC20SupportedCampaignType>): void;
|
56
57
|
processingRound3(typeInfo: DataRaw): void;
|
57
58
|
processingRound4(typeInfo: DataRaw): void;
|
58
59
|
handleWhiteListBlacklistRound5(typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): {
|
@@ -62,10 +63,10 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
62
63
|
};
|
63
64
|
processingRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<Output>;
|
64
65
|
computeRound1(type: tokenType, typeInfo: DataRaw): tokenTypeStruct;
|
65
|
-
computeRound2(index: number, type: tokenType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
66
|
+
computeRound2(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign?: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
66
67
|
computeRound3(index: number, type: tokenType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
67
|
-
computeRound4(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<
|
68
|
-
computeRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<
|
68
|
+
computeRound4(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
69
|
+
computeRound5(index: number, type: tokenType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<ERC20SupportedCampaignType>, pricer: Pricer): Promise<tokenTypeStruct>;
|
69
70
|
generateWhitelistCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
70
71
|
generateBlackListCall(type: tokenType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
71
72
|
decodeListedSupply(index: number, decimals: number, list: string[], calls: string[]): string;
|
@@ -18,8 +18,8 @@ export class GenericProcessor {
|
|
18
18
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
19
19
|
};
|
20
20
|
debug = false;
|
21
|
-
processingRound1(typeInfo
|
22
|
-
processingRound2(typeInfo) { }
|
21
|
+
processingRound1(typeInfo) { }
|
22
|
+
processingRound2(typeInfo, campaign) { }
|
23
23
|
processingRound3(typeInfo) { }
|
24
24
|
processingRound4(typeInfo) { }
|
25
25
|
handleWhiteListBlacklistRound5(typeInfo, campaign) {
|
@@ -65,9 +65,9 @@ export class GenericProcessor {
|
|
65
65
|
typeInfo,
|
66
66
|
};
|
67
67
|
}
|
68
|
-
computeRound2(index, type, typeInfo, calls) {
|
68
|
+
computeRound2(index, type, typeInfo, calls, campaign) {
|
69
69
|
this.decodePreviousRound(roundType.one, calls, typeInfo, type, index);
|
70
|
-
this.processingRound2(typeInfo);
|
70
|
+
this.processingRound2(typeInfo, campaign);
|
71
71
|
if (this.debug) {
|
72
72
|
console.log("Round 2", {
|
73
73
|
type: type,
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.d.ts
CHANGED
@@ -43,7 +43,7 @@ export declare class MaverickBPProcessor extends GenericProcessor<callKeysMaveri
|
|
43
43
|
round3: callType[];
|
44
44
|
round4: callType[];
|
45
45
|
};
|
46
|
-
processingRound1(typeInfo: dataRawMaverickBP
|
46
|
+
processingRound1(typeInfo: dataRawMaverickBP): void;
|
47
47
|
processingRound2(typeInfo: dataRawMaverickBP): void;
|
48
48
|
processingRound5(_index: number, type: tokenType, typeInfo: dataRawMaverickBP, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeMaverickBP>;
|
49
49
|
}
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js
CHANGED
@@ -37,7 +37,7 @@ export class MaverickBPProcessor extends GenericProcessor {
|
|
37
37
|
round3: [],
|
38
38
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
39
39
|
};
|
40
|
-
processingRound1(typeInfo
|
40
|
+
processingRound1(typeInfo) {
|
41
41
|
typeInfo.lensAddress = MAVERICK_ZKSYNC_BP_LENS_ADDRESS;
|
42
42
|
}
|
43
43
|
processingRound2(typeInfo) {
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.d.ts
CHANGED
@@ -27,7 +27,7 @@ export declare class NoLinkVaultProcessor extends GenericProcessor<callKeysNoLin
|
|
27
27
|
round3: callType[];
|
28
28
|
round4: callType[];
|
29
29
|
};
|
30
|
-
processingRound1(typeInfo: dataRawNoLinkVault
|
30
|
+
processingRound1(typeInfo: dataRawNoLinkVault): void;
|
31
31
|
processingRound5(index: number, type: tokenType, typeInfo: dataRawNoLinkVault, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeNoLinkVault>;
|
32
32
|
computeRound1(type: tokenType, typeInfo: dataRawNoLinkVault): tokenTypeStruct;
|
33
33
|
computeRound2(index: number, type: tokenType, typeInfo: dataRawNoLinkVault, calls: string[]): tokenTypeStruct;
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js
CHANGED
@@ -12,7 +12,7 @@ export class NoLinkVaultProcessor extends GenericProcessor {
|
|
12
12
|
round3: [{ key: "baseSymbol", call: "symbol", target: "base" }],
|
13
13
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
14
14
|
};
|
15
|
-
processingRound1(typeInfo
|
15
|
+
processingRound1(typeInfo) {
|
16
16
|
if (typeInfo.tokenAddress === "0x196ead472583Bc1e9aF7A05F860D9857e1Bd3dCc") {
|
17
17
|
typeInfo.protocol = "Unifi";
|
18
18
|
typeInfo.rateAccountant = "0xA9fB7e2922216deBE3Fd5E1bBE7591eE446Dc21c";
|
@@ -25,7 +25,7 @@ export class NoLinkVaultProcessor extends GenericProcessor {
|
|
25
25
|
typeInfo.protocol = "Unifi";
|
26
26
|
typeInfo.rateAccountant = "0xe0bDb7b9225A2CeB42998dc2E51D4D3CDeb7e3Be";
|
27
27
|
}
|
28
|
-
if (type === tokenType.veda) {
|
28
|
+
if (typeInfo.type === tokenType.veda) {
|
29
29
|
// To retrieve the rateAccountant, look at a transaction, find the teller, then find the accountant.
|
30
30
|
if (typeInfo.tokenAddress === "0x08c6F91e2B681FaF5e17227F2a44C307b3C1364C")
|
31
31
|
typeInfo.rateAccountant = "0xc315D6e14DDCDC7407784e2Caf815d131Bc1D3E7";
|
@@ -34,7 +34,7 @@ export declare class RfxProcessor extends GenericProcessor<callKeysRfx, dataRawT
|
|
34
34
|
round3: callType[];
|
35
35
|
round4: callType[];
|
36
36
|
};
|
37
|
-
processingRound1(typeInfo: dataRawTemplate
|
37
|
+
processingRound1(typeInfo: dataRawTemplate): void;
|
38
38
|
processingRound5(index: number, type: tokenType, typeInfo: dataRawTemplate, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeRfx>;
|
39
39
|
}
|
40
40
|
export {};
|
@@ -32,7 +32,7 @@ export class RfxProcessor extends GenericProcessor {
|
|
32
32
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
33
33
|
};
|
34
34
|
// override computeRound1(): void {}
|
35
|
-
processingRound1(typeInfo
|
35
|
+
processingRound1(typeInfo) {
|
36
36
|
const hexShortToken = ethers.utils.keccak256(ethers.utils.defaultAbiCoder.encode(["string"], ["SHORT_TOKEN"]));
|
37
37
|
const hexLongToken = ethers.utils.keccak256(ethers.utils.defaultAbiCoder.encode(["string"], ["LONG_TOKEN"]));
|
38
38
|
typeInfo.RFX_DATASTORE = RFX_DATASTORE;
|