@merkl/api 0.10.356 → 0.10.358
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/database/api/.generated/edge.js +45 -19
- package/dist/database/api/.generated/index-browser.js +49 -23
- package/dist/database/api/.generated/index.d.ts +11316 -8029
- package/dist/database/api/.generated/index.js +45 -19
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +39 -15
- package/dist/database/api/.generated/wasm.js +49 -23
- package/dist/src/eden/index.d.ts +3 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +6 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.js +5 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/hardcoded.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/hardcoded.js +26 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/ownerFinder.d.ts +2 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/ownerFinder.js +11 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +7 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +12 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.js +1 -1
- 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 +4 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js +32 -4
- 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/processor/Satlayer.d.ts +34 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/Satlayer.js +27 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +7 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +71 -20
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +3 -0
- package/dist/src/modules/v4/campaign/campaign.model.js +3 -0
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +116 -0
- package/dist/src/modules/v4/computedValue/computedValue.controller.js +43 -0
- package/dist/src/modules/v4/computedValue/computedValue.model.d.ts +27 -0
- package/dist/src/modules/v4/computedValue/computedValue.model.js +22 -0
- package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +13 -0
- package/dist/src/modules/v4/computedValue/computedValue.repository.js +41 -0
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +13 -0
- package/dist/src/modules/v4/computedValue/computedValue.service.js +15 -0
- package/dist/src/modules/v4/computedValue/index.d.ts +3 -0
- package/dist/src/modules/v4/computedValue/index.js +3 -0
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +1 -0
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.model.d.ts +1 -0
- package/dist/src/modules/v4/dynamicData/dynamicData.model.js +1 -0
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -1
- package/dist/src/modules/v4/router.d.ts +1 -0
- package/dist/src/utils/decodeCalls.d.ts +1 -0
- package/dist/src/utils/decodeCalls.js +12 -1
- package/dist/src/utils/encodeCalls.js +4 -0
- package/dist/src/utils/generateCardName.js +8 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -33,11 +33,44 @@ model Campaign {
|
|
33
33
|
creatorAddress String @db.Char(42)
|
34
34
|
// Should probably be a 1 to 1 relation if we do not want to keep historic records
|
35
35
|
CampaignStatus CampaignStatus[]
|
36
|
+
CampaignEngineValues CampaignComputedValue[]
|
37
|
+
UserComputedValue UserComputedValue[]
|
36
38
|
|
37
39
|
@@unique([distributionChainId, campaignId])
|
38
40
|
@@index([opportunityId], type: Hash)
|
39
41
|
}
|
40
42
|
|
43
|
+
// SubTable of Campaigns that should be here as soon as the campaign is processed
|
44
|
+
model CampaignStatus {
|
45
|
+
campaignId String @id
|
46
|
+
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
47
|
+
computedUntil BigInt @default(0)
|
48
|
+
processingStarted BigInt @default(0)
|
49
|
+
status RunStatus @default(SUCCESS)
|
50
|
+
error String @default("")
|
51
|
+
details Json @default("{}")
|
52
|
+
}
|
53
|
+
|
54
|
+
// SubTable of Campaigns that will contain values populated by the Engine when it's running
|
55
|
+
model CampaignComputedValue {
|
56
|
+
campaignId String @id
|
57
|
+
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
58
|
+
averageBoost Float? // Average boost in case of boosting hook
|
59
|
+
totalDistributedInUSD Float? // Used in case there is a distribution cap
|
60
|
+
forfeitingBoost Float? // In case some rewards are forfeited, resulting boost for remaining users
|
61
|
+
}
|
62
|
+
|
63
|
+
model UserComputedValue {
|
64
|
+
campaignId String @id
|
65
|
+
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
66
|
+
address String @db.Char(42)
|
67
|
+
User User? @relation(fields: [address], references: [address])
|
68
|
+
reason String
|
69
|
+
boost Float?
|
70
|
+
|
71
|
+
@@unique([campaignId, address, reason])
|
72
|
+
}
|
73
|
+
|
41
74
|
model Chain {
|
42
75
|
id Int @id
|
43
76
|
name String
|
@@ -197,11 +230,12 @@ model DailyRewardsBreakdown {
|
|
197
230
|
}
|
198
231
|
|
199
232
|
model User {
|
200
|
-
address
|
201
|
-
Rewards
|
202
|
-
Blacklist
|
203
|
-
CampaignsCreated
|
204
|
-
|
233
|
+
address String @id @db.Char(42)
|
234
|
+
Rewards Reward[]
|
235
|
+
Blacklist Blacklist[]
|
236
|
+
CampaignsCreated Campaign[]
|
237
|
+
UserComputedValue UserComputedValue[]
|
238
|
+
tags String[]
|
205
239
|
}
|
206
240
|
|
207
241
|
model Reward {
|
@@ -297,16 +331,6 @@ model Dump {
|
|
297
331
|
@@unique([chainId, fromTokenId, toTokenId, timestamp])
|
298
332
|
}
|
299
333
|
|
300
|
-
model CampaignStatus {
|
301
|
-
campaignId String @id
|
302
|
-
Campaign Campaign @relation(fields: [campaignId], references: [id])
|
303
|
-
computedUntil BigInt @default(0)
|
304
|
-
processingStarted BigInt @default(0)
|
305
|
-
status RunStatus @default(SUCCESS)
|
306
|
-
error String @default("")
|
307
|
-
details Json @default("{}")
|
308
|
-
}
|
309
|
-
|
310
334
|
// enums
|
311
335
|
|
312
336
|
enum RunStatus {
|
@@ -138,6 +138,29 @@ exports.Prisma.RelationLoadStrategy = {
|
|
138
138
|
join: 'join'
|
139
139
|
};
|
140
140
|
|
141
|
+
exports.Prisma.CampaignStatusScalarFieldEnum = {
|
142
|
+
campaignId: 'campaignId',
|
143
|
+
computedUntil: 'computedUntil',
|
144
|
+
processingStarted: 'processingStarted',
|
145
|
+
status: 'status',
|
146
|
+
error: 'error',
|
147
|
+
details: 'details'
|
148
|
+
};
|
149
|
+
|
150
|
+
exports.Prisma.CampaignComputedValueScalarFieldEnum = {
|
151
|
+
campaignId: 'campaignId',
|
152
|
+
averageBoost: 'averageBoost',
|
153
|
+
totalDistributedInUSD: 'totalDistributedInUSD',
|
154
|
+
forfeitingBoost: 'forfeitingBoost'
|
155
|
+
};
|
156
|
+
|
157
|
+
exports.Prisma.UserComputedValueScalarFieldEnum = {
|
158
|
+
campaignId: 'campaignId',
|
159
|
+
address: 'address',
|
160
|
+
reason: 'reason',
|
161
|
+
boost: 'boost'
|
162
|
+
};
|
163
|
+
|
141
164
|
exports.Prisma.ChainScalarFieldEnum = {
|
142
165
|
id: 'id',
|
143
166
|
name: 'name',
|
@@ -299,15 +322,6 @@ exports.Prisma.DumpScalarFieldEnum = {
|
|
299
322
|
timestamp: 'timestamp'
|
300
323
|
};
|
301
324
|
|
302
|
-
exports.Prisma.CampaignStatusScalarFieldEnum = {
|
303
|
-
campaignId: 'campaignId',
|
304
|
-
computedUntil: 'computedUntil',
|
305
|
-
processingStarted: 'processingStarted',
|
306
|
-
status: 'status',
|
307
|
-
error: 'error',
|
308
|
-
details: 'details'
|
309
|
-
};
|
310
|
-
|
311
325
|
exports.Prisma.SortOrder = {
|
312
326
|
asc: 'asc',
|
313
327
|
desc: 'desc'
|
@@ -347,6 +361,21 @@ exports.Prisma.CampaignOrderByRelevanceFieldEnum = {
|
|
347
361
|
creatorAddress: 'creatorAddress'
|
348
362
|
};
|
349
363
|
|
364
|
+
exports.Prisma.CampaignStatusOrderByRelevanceFieldEnum = {
|
365
|
+
campaignId: 'campaignId',
|
366
|
+
error: 'error'
|
367
|
+
};
|
368
|
+
|
369
|
+
exports.Prisma.CampaignComputedValueOrderByRelevanceFieldEnum = {
|
370
|
+
campaignId: 'campaignId'
|
371
|
+
};
|
372
|
+
|
373
|
+
exports.Prisma.UserComputedValueOrderByRelevanceFieldEnum = {
|
374
|
+
campaignId: 'campaignId',
|
375
|
+
address: 'address',
|
376
|
+
reason: 'reason'
|
377
|
+
};
|
378
|
+
|
350
379
|
exports.Prisma.ChainOrderByRelevanceFieldEnum = {
|
351
380
|
name: 'name',
|
352
381
|
icon: 'icon'
|
@@ -465,11 +494,6 @@ exports.Prisma.DumpOrderByRelevanceFieldEnum = {
|
|
465
494
|
amountIn: 'amountIn',
|
466
495
|
amountOut: 'amountOut'
|
467
496
|
};
|
468
|
-
|
469
|
-
exports.Prisma.CampaignStatusOrderByRelevanceFieldEnum = {
|
470
|
-
campaignId: 'campaignId',
|
471
|
-
error: 'error'
|
472
|
-
};
|
473
497
|
exports.CampaignType = exports.$Enums.CampaignType = {
|
474
498
|
INVALID: 'INVALID',
|
475
499
|
ERC20: 'ERC20',
|
@@ -496,6 +520,13 @@ exports.CampaignType = exports.$Enums.CampaignType = {
|
|
496
520
|
HYPERDRIVELOGFIXPROCESSOR: 'HYPERDRIVELOGFIXPROCESSOR'
|
497
521
|
};
|
498
522
|
|
523
|
+
exports.RunStatus = exports.$Enums.RunStatus = {
|
524
|
+
PROCESSING: 'PROCESSING',
|
525
|
+
SUCCESS: 'SUCCESS',
|
526
|
+
FAILED: 'FAILED',
|
527
|
+
SKIPPED: 'SKIPPED'
|
528
|
+
};
|
529
|
+
|
499
530
|
exports.ExplorerType = exports.$Enums.ExplorerType = {
|
500
531
|
ETHERSCAN: 'ETHERSCAN',
|
501
532
|
BLOCKSCOUT: 'BLOCKSCOUT'
|
@@ -541,15 +572,11 @@ exports.PriceSourceMethod = exports.$Enums.PriceSourceMethod = {
|
|
541
572
|
DEFILLAMA: 'DEFILLAMA'
|
542
573
|
};
|
543
574
|
|
544
|
-
exports.RunStatus = exports.$Enums.RunStatus = {
|
545
|
-
PROCESSING: 'PROCESSING',
|
546
|
-
SUCCESS: 'SUCCESS',
|
547
|
-
FAILED: 'FAILED',
|
548
|
-
SKIPPED: 'SKIPPED'
|
549
|
-
};
|
550
|
-
|
551
575
|
exports.Prisma.ModelName = {
|
552
576
|
Campaign: 'Campaign',
|
577
|
+
CampaignStatus: 'CampaignStatus',
|
578
|
+
CampaignComputedValue: 'CampaignComputedValue',
|
579
|
+
UserComputedValue: 'UserComputedValue',
|
553
580
|
Chain: 'Chain',
|
554
581
|
Explorer: 'Explorer',
|
555
582
|
Opportunity: 'Opportunity',
|
@@ -567,8 +594,7 @@ exports.Prisma.ModelName = {
|
|
567
594
|
MerklRoot: 'MerklRoot',
|
568
595
|
PriceSource: 'PriceSource',
|
569
596
|
Blacklist: 'Blacklist',
|
570
|
-
Dump: 'Dump'
|
571
|
-
CampaignStatus: 'CampaignStatus'
|
597
|
+
Dump: 'Dump'
|
572
598
|
};
|
573
599
|
|
574
600
|
/**
|
package/dist/src/eden/index.d.ts
CHANGED
@@ -2233,6 +2233,7 @@ declare const eden: {
|
|
2233
2233
|
authorization: string;
|
2234
2234
|
};
|
2235
2235
|
query: {
|
2236
|
+
decimals?: number | undefined;
|
2236
2237
|
chainId: number;
|
2237
2238
|
tokenAddress: string;
|
2238
2239
|
};
|
@@ -6059,6 +6060,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
6059
6060
|
body: unknown;
|
6060
6061
|
params: {};
|
6061
6062
|
query: {
|
6063
|
+
decimals?: number | undefined;
|
6062
6064
|
chainId: number;
|
6063
6065
|
tokenAddress: string;
|
6064
6066
|
};
|
@@ -9618,6 +9620,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9618
9620
|
authorization: string;
|
9619
9621
|
};
|
9620
9622
|
query: {
|
9623
|
+
decimals?: number | undefined;
|
9621
9624
|
chainId: number;
|
9622
9625
|
tokenAddress: string;
|
9623
9626
|
};
|
package/dist/src/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { merklChainDataWithCache } from "../../merklChainData";
|
2
|
-
import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, MetamorphoInterface, YEAR, } from "@sdk";
|
2
|
+
import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, } from "@sdk";
|
3
3
|
import { Pricer } from "../../../utils/pricer";
|
4
4
|
import { getLastEligibilityRatio } from "../utils/getLastEligibilityRatio";
|
5
5
|
import { getTVL } from "./ERC20SubTypes/helpers/getTVL";
|
@@ -54,6 +54,10 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
54
54
|
allowFailure: true,
|
55
55
|
callData: EnzymeInterface.encodeFunctionData("getCreator"),
|
56
56
|
target: campaign.campaignParameters.targetToken,
|
57
|
+
}, {
|
58
|
+
allowFailure: true,
|
59
|
+
callData: LayerBankERC20Interface.encodeFunctionData("owner"),
|
60
|
+
target: campaign.campaignParameters.targetToken,
|
57
61
|
});
|
58
62
|
}
|
59
63
|
const resultRound1 = await ChainInteractionService(chainId).fetchState(callsRounds1);
|
@@ -68,7 +72,7 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
68
72
|
typeInfo: {},
|
69
73
|
};
|
70
74
|
typeStruct = getTokenTypeRound1(resultRound1, campaign.campaignParameters.targetToken, i, campaign);
|
71
|
-
i +=
|
75
|
+
i += callsRounds1.length;
|
72
76
|
tokenTypesByCampaign[campaign.campaignId] = typeStruct;
|
73
77
|
callsRounds2.push(...typeStruct.calls);
|
74
78
|
}
|
@@ -21,6 +21,11 @@ const factoryAddresses = {
|
|
21
21
|
"0x70ee0A6DB4F5a2Dc4d9c0b57bE97B9987e75BAFD": tokenType.pendleYT, // Pendle YT Factory
|
22
22
|
"0xFD513630F697A9C1731F196185fb9ebA6eAAc20B": tokenType.cpmmGamma, // CPMMGAMMA Factory
|
23
23
|
"0x9Ad6C38BE94206cA50bb0d90783181662f0Cfa10": tokenType.traderJoe, // Trader Joe Factory
|
24
|
+
"0x5Ea9DD3b6f042A34Df818C6c1324BC5A7c61427a": tokenType.curve, // Curve Corn 2crypto Factory
|
25
|
+
"0xd7E72f3615aa65b92A4DBdC211E296a35512988B": tokenType.curveNPool, // Curve Corn Stableswap Factory
|
26
|
+
"0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a": tokenType.curveNPool, // Curve Corn 3crypto Factory
|
27
|
+
"0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8": tokenType.curveNPool, // Curve Arbitrum 3crypto Factory
|
28
|
+
"0xA5961898870943c68037F6848d2D866Ed2016bcB": tokenType.curveNPool, // Curve Base
|
24
29
|
};
|
25
30
|
export function getTypeFromFactoryAddress(address) {
|
26
31
|
if (factoryAddresses[address]) {
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { ChainId } from "@sdk";
|
2
|
+
import { tokenType } from "./tokenType";
|
3
|
+
const chainAddressToType = {
|
4
|
+
[ChainId.CORN]: {
|
5
|
+
"0xab3291b73a1087265e126e330cede0cfd4b8a693": tokenType.curveNPool,
|
6
|
+
"0xf024586aacaf91fc4f77468fa758df280b2c9cd4": tokenType.curveNPool,
|
7
|
+
"0x29c1b0baa9ac0182cf9f6ffceaf143f3ef3546a0": tokenType.curveNPool,
|
8
|
+
"0xebe423b5466f9675669b2a4521b6e9f852dd1f52": tokenType.curveNPool,
|
9
|
+
"0xb27d447cf1d211ca60676728ac28060ecfb90800": tokenType.curveNPool,
|
10
|
+
},
|
11
|
+
[ChainId.MAINNET]: {
|
12
|
+
"0x08c6F91e2B681FaF5e17227F2a44C307b3C1364C": tokenType.veda,
|
13
|
+
"0x5401b8620E5FB570064CA9114fd1e135fd77D57c": tokenType.veda,
|
14
|
+
"0xFE0C961A49E1aEe2AE2d842fE40157365C6d978f": tokenType.veda,
|
15
|
+
"0x42A03534DBe07077d705311854E3B6933dD6Af85": tokenType.veda,
|
16
|
+
"0x352180974C71f84a934953Cf49C4E538a6F9c997": tokenType.veda,
|
17
|
+
"0xeDa663610638E6557c27e2f4e973D3393e844E70": tokenType.veda,
|
18
|
+
"0xf0bb20865277aBd641a307eCe5Ee04E79073416C": tokenType.veda,
|
19
|
+
},
|
20
|
+
};
|
21
|
+
export function getTypeFromAddressChain(chain, token) {
|
22
|
+
if (!!chainAddressToType[chain] && !!chainAddressToType[chain][token]) {
|
23
|
+
return chainAddressToType[chain][token];
|
24
|
+
}
|
25
|
+
return tokenType.unknown;
|
26
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { tokenType } from "./tokenType";
|
2
|
+
const ownerAddresses = {
|
3
|
+
"0xbF7E49483881C76487b0989CD7d9A8239B20CA41": tokenType.curve_2,
|
4
|
+
"0x42a856dbEBB97AbC1269EAB32f3bb40C15102819": tokenType.satlayer,
|
5
|
+
};
|
6
|
+
export function getTypeFromOwnerAddress(address) {
|
7
|
+
if (ownerAddresses[address]) {
|
8
|
+
return ownerAddresses[address];
|
9
|
+
}
|
10
|
+
return tokenType.unknown;
|
11
|
+
}
|
@@ -66,7 +66,13 @@ export declare enum tokenType {
|
|
66
66
|
reactor_fusion = "reactor_fusion",
|
67
67
|
vicuna = "vicuna",
|
68
68
|
traderJoe = "traderJoe",
|
69
|
-
curveNPool = "curveNPool"
|
69
|
+
curveNPool = "curveNPool",
|
70
|
+
avalon_borrowing = "avalon_borrowing",
|
71
|
+
avalon_lending = "avalon_lending",
|
72
|
+
satlayer = "satlayer",
|
73
|
+
veda = "veda",
|
74
|
+
superlend_borrowing = "superlend_borrowing",
|
75
|
+
superlend_lending = "superlend_lending"
|
70
76
|
}
|
71
77
|
export declare const tokenTypeToProtocol: {
|
72
78
|
[key in tokenType]: {
|
@@ -68,6 +68,12 @@ export var tokenType;
|
|
68
68
|
tokenType["vicuna"] = "vicuna";
|
69
69
|
tokenType["traderJoe"] = "traderJoe";
|
70
70
|
tokenType["curveNPool"] = "curveNPool";
|
71
|
+
tokenType["avalon_borrowing"] = "avalon_borrowing";
|
72
|
+
tokenType["avalon_lending"] = "avalon_lending";
|
73
|
+
tokenType["satlayer"] = "satlayer";
|
74
|
+
tokenType["veda"] = "veda";
|
75
|
+
tokenType["superlend_borrowing"] = "superlend_borrowing";
|
76
|
+
tokenType["superlend_lending"] = "superlend_lending";
|
71
77
|
})(tokenType || (tokenType = {}));
|
72
78
|
export const tokenTypeToProtocol = {
|
73
79
|
[tokenType.aave_borrowing]: { protocol: "Aave" },
|
@@ -167,4 +173,10 @@ export const tokenTypeToProtocol = {
|
|
167
173
|
},
|
168
174
|
[tokenType.vicuna]: { protocol: "Vicuna" },
|
169
175
|
[tokenType.traderJoe]: { protocol: "Trader Joe" },
|
176
|
+
[tokenType.avalon_lending]: { protocol: "Avalon" },
|
177
|
+
[tokenType.avalon_borrowing]: { protocol: "Avalon" },
|
178
|
+
[tokenType.satlayer]: { protocol: "Satlayer" },
|
179
|
+
[tokenType.veda]: { protocol: "Veda" },
|
180
|
+
[tokenType.superlend_borrowing]: { protocol: "Superlend" },
|
181
|
+
[tokenType.superlend_lending]: { protocol: "Superlend" },
|
170
182
|
};
|
@@ -51,7 +51,7 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
51
51
|
round4: callType[];
|
52
52
|
};
|
53
53
|
debug: boolean;
|
54
|
-
processingRound1(typeInfo: DataRaw): void;
|
54
|
+
processingRound1(typeInfo: DataRaw, type?: tokenType): void;
|
55
55
|
processingRound2(typeInfo: DataRaw): void;
|
56
56
|
processingRound3(typeInfo: DataRaw): void;
|
57
57
|
processingRound4(typeInfo: DataRaw): void;
|
@@ -18,7 +18,7 @@ export class GenericProcessor {
|
|
18
18
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
19
19
|
};
|
20
20
|
debug = false;
|
21
|
-
processingRound1(typeInfo) { }
|
21
|
+
processingRound1(typeInfo, type) { }
|
22
22
|
processingRound2(typeInfo) { }
|
23
23
|
processingRound3(typeInfo) { }
|
24
24
|
processingRound4(typeInfo) { }
|
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): void;
|
46
|
+
processingRound1(typeInfo: dataRawMaverickBP, type: tokenType): 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, type) {
|
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
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Pricer } from "../../../../../utils/pricer";
|
2
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
3
|
-
import
|
3
|
+
import { tokenType, type tokenTypeStruct } from "../helpers/tokenType";
|
4
4
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
|
5
5
|
type callType = {
|
6
6
|
key: keyof dataRawNoLinkVault;
|
@@ -11,12 +11,14 @@ type callType = {
|
|
11
11
|
type callKeysNoLinkVault = mandatoryCallKeys & {
|
12
12
|
rateAccountant: string;
|
13
13
|
base: string;
|
14
|
+
baseSymbol: string;
|
14
15
|
};
|
15
16
|
type dataRawNoLinkVault = callKeysNoLinkVault & {
|
16
17
|
rate: string;
|
17
18
|
};
|
18
19
|
type dataTypeNoLinkVault = dataType & {
|
19
20
|
rate: number;
|
21
|
+
baseSymbol: string;
|
20
22
|
};
|
21
23
|
export declare class NoLinkVaultProcessor extends GenericProcessor<callKeysNoLinkVault, dataRawNoLinkVault, dataTypeNoLinkVault> {
|
22
24
|
rounds: {
|
@@ -25,7 +27,7 @@ export declare class NoLinkVaultProcessor extends GenericProcessor<callKeysNoLin
|
|
25
27
|
round3: callType[];
|
26
28
|
round4: callType[];
|
27
29
|
};
|
28
|
-
processingRound1(typeInfo: dataRawNoLinkVault): void;
|
30
|
+
processingRound1(typeInfo: dataRawNoLinkVault, type: tokenType): void;
|
29
31
|
processingRound5(index: number, type: tokenType, typeInfo: dataRawNoLinkVault, calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeNoLinkVault>;
|
30
32
|
computeRound1(type: tokenType, typeInfo: dataRawNoLinkVault): tokenTypeStruct;
|
31
33
|
computeRound2(index: number, type: tokenType, typeInfo: dataRawNoLinkVault, calls: string[]): tokenTypeStruct;
|
package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
2
|
import { BN2Number } from "@sdk";
|
3
|
+
import { tokenType } from "../helpers/tokenType";
|
3
4
|
import { GenericProcessor } from "./GenericProcessor";
|
4
5
|
export class NoLinkVaultProcessor extends GenericProcessor {
|
5
6
|
rounds = {
|
@@ -8,21 +9,48 @@ export class NoLinkVaultProcessor extends GenericProcessor {
|
|
8
9
|
{ key: "rate", call: "getRate", target: "rateAccountant" },
|
9
10
|
{ key: "base", call: "base", target: "rateAccountant" },
|
10
11
|
],
|
11
|
-
round3: [],
|
12
|
+
round3: [{ key: "baseSymbol", call: "symbol", target: "base" }],
|
12
13
|
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
13
14
|
};
|
14
|
-
processingRound1(typeInfo) {
|
15
|
+
processingRound1(typeInfo, type) {
|
15
16
|
if (typeInfo.tokenAddress === "0x196ead472583Bc1e9aF7A05F860D9857e1Bd3dCc") {
|
17
|
+
typeInfo.protocol = "Unifi";
|
16
18
|
typeInfo.rateAccountant = "0xA9fB7e2922216deBE3Fd5E1bBE7591eE446Dc21c";
|
17
19
|
}
|
20
|
+
if (typeInfo.tokenAddress === "0x170D847A8320F3B6A77eE15B0CAE430e3eC933a0") {
|
21
|
+
typeInfo.protocol = "Unifi";
|
22
|
+
typeInfo.rateAccountant = "0x2afb28b0561d99b5e00829EC2eF54946a00a35f7";
|
23
|
+
}
|
24
|
+
if (typeInfo.tokenAddress === "0x82c40e07277eBb92935f79cE92268F80dDc7caB4") {
|
25
|
+
typeInfo.protocol = "Unifi";
|
26
|
+
typeInfo.rateAccountant = "0xe0bDb7b9225A2CeB42998dc2E51D4D3CDeb7e3Be";
|
27
|
+
}
|
28
|
+
if (type === tokenType.veda) {
|
29
|
+
// To retrieve the rateAccountant, look at a transaction, find the teller, then find the accountant.
|
30
|
+
if (typeInfo.tokenAddress === "0x08c6F91e2B681FaF5e17227F2a44C307b3C1364C")
|
31
|
+
typeInfo.rateAccountant = "0xc315D6e14DDCDC7407784e2Caf815d131Bc1D3E7";
|
32
|
+
if (typeInfo.tokenAddress === "0x5401b8620E5FB570064CA9114fd1e135fd77D57c")
|
33
|
+
typeInfo.rateAccountant = "0x28634D0c5edC67CF2450E74deA49B90a4FF93dCE";
|
34
|
+
if (typeInfo.tokenAddress === "0xFE0C961A49E1aEe2AE2d842fE40157365C6d978f")
|
35
|
+
typeInfo.rateAccountant = "0xf1ecf4802C2b5Cf9c830A4AF297842Daa6D0f986";
|
36
|
+
if (typeInfo.tokenAddress === "0x42A03534DBe07077d705311854E3B6933dD6Af85")
|
37
|
+
typeInfo.rateAccountant = "0x1c217f17d57d3CCD1CB3d8CB16B21e8f0b544156";
|
38
|
+
if (typeInfo.tokenAddress === "0x352180974C71f84a934953Cf49C4E538a6F9c997")
|
39
|
+
typeInfo.rateAccountant = "0xBae19b38Bf727Be64AF0B578c34985c3D612e2Ba";
|
40
|
+
if (typeInfo.tokenAddress === "0xeDa663610638E6557c27e2f4e973D3393e844E70")
|
41
|
+
typeInfo.rateAccountant = "0x1D4F0F05e50312d3E7B65659Ef7d06aa74651e0C";
|
42
|
+
if (typeInfo.tokenAddress === "0xf0bb20865277aBd641a307eCe5Ee04E79073416C")
|
43
|
+
typeInfo.rateAccountant = "0x0d05D94a5F1E76C18fbeB7A13d17C8a314088198";
|
44
|
+
}
|
18
45
|
}
|
19
46
|
async processingRound5(index, type, typeInfo, calls, campaign, pricer) {
|
20
47
|
const rate = BN2Number(typeInfo.rate, Number(campaign.campaignParameters.decimalsTargetToken));
|
21
48
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
22
|
-
|
23
|
-
const priceTargetToken = rate * ((await pricer.get({ symbol: typeInfo.base })) ?? 0);
|
49
|
+
const priceTargetToken = rate * ((await pricer.get({ symbol: typeInfo.baseSymbol })) ?? 0);
|
24
50
|
const tvl = whitelistedSupplyTargetToken * priceTargetToken;
|
25
51
|
return {
|
52
|
+
...typeInfo,
|
53
|
+
baseSymbol: typeInfo.baseSymbol,
|
26
54
|
tokenAddress: typeInfo.tokenAddress,
|
27
55
|
whitelistedSupplyTargetToken,
|
28
56
|
rate,
|
@@ -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): void;
|
37
|
+
processingRound1(typeInfo: dataRawTemplate, type: tokenType): 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, type) {
|
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;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type { Pricer } from "../../../../../utils/pricer";
|
2
|
+
import type { Campaign, 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 dataRawSatlayer;
|
7
|
+
call: string;
|
8
|
+
target: keyof callKeysSatlayer;
|
9
|
+
metaData?: keyof callKeysSatlayer;
|
10
|
+
};
|
11
|
+
export type callKeysSatlayer = mandatoryCallKeys & {
|
12
|
+
owner: string;
|
13
|
+
symbol: string;
|
14
|
+
symbolUnderlyingToken: string;
|
15
|
+
underlying: string;
|
16
|
+
};
|
17
|
+
type dataRawSatlayer = callKeysSatlayer & {};
|
18
|
+
type dataTypeSatlayer = dataType & {
|
19
|
+
owner: string;
|
20
|
+
symbol: string;
|
21
|
+
underlying: string;
|
22
|
+
symbolUnderlyingToken: string;
|
23
|
+
priceTargetToken: number;
|
24
|
+
};
|
25
|
+
export declare class SatlayerProcessor extends GenericProcessor<callKeysSatlayer, dataRawSatlayer, dataTypeSatlayer> {
|
26
|
+
rounds: {
|
27
|
+
round1: callType[];
|
28
|
+
round2: callType[];
|
29
|
+
round3: callType[];
|
30
|
+
round4: callType[];
|
31
|
+
};
|
32
|
+
processingRound5(_index: number, type: tokenType, typeInfo: dataRawSatlayer, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeSatlayer>;
|
33
|
+
}
|
34
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { generateCardName } from "../../../../../utils/generateCardName";
|
2
|
+
import { GenericProcessor } from "./GenericProcessor";
|
3
|
+
export class SatlayerProcessor extends GenericProcessor {
|
4
|
+
rounds = {
|
5
|
+
round1: [{ key: "symbol", call: "symbol", target: "tokenAddress" }],
|
6
|
+
round2: [],
|
7
|
+
round3: [],
|
8
|
+
round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
|
9
|
+
};
|
10
|
+
// // override computeRound1(): void {}
|
11
|
+
async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
|
12
|
+
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
13
|
+
typeInfo.symbolUnderlyingToken = typeInfo.symbol.replace("sat", "");
|
14
|
+
const priceUnderlying = (await pricer.get({ symbol: typeInfo.symbolUnderlyingToken })) ?? 0;
|
15
|
+
const tvl = priceUnderlying * totalSupply;
|
16
|
+
const priceTargetToken = priceUnderlying;
|
17
|
+
return {
|
18
|
+
...typeInfo,
|
19
|
+
whitelistedSupplyTargetToken,
|
20
|
+
tvl: tvl,
|
21
|
+
priceTargetToken,
|
22
|
+
cardName: generateCardName(type, typeInfo, campaign),
|
23
|
+
blacklistedSupply,
|
24
|
+
totalSupply,
|
25
|
+
};
|
26
|
+
}
|
27
|
+
}
|
@@ -22,6 +22,7 @@ import { PendleProcessor } from "./PendleProcessor";
|
|
22
22
|
import { PendleYTProcessor } from "./PendleYTProcessor";
|
23
23
|
import { RadiantProcessor } from "./RadiantProcessor";
|
24
24
|
import { RfxProcessor } from "./RfxProcessor";
|
25
|
+
import { SatlayerProcessor } from "./Satlayer";
|
25
26
|
import { SpliceProcessor } from "./SpliceProcessor";
|
26
27
|
import { StakingProcessor } from "./StakingProcessor";
|
27
28
|
import { SturdySiloProcessor } from "./SturdySiloProcessor";
|
@@ -102,4 +103,10 @@ export const processorMapping = {
|
|
102
103
|
[tokenType.vicuna]: VicunaProcessor,
|
103
104
|
[tokenType.traderJoe]: UniswapProcessor,
|
104
105
|
[tokenType.curveNPool]: CurveNPoolProcessor,
|
106
|
+
[tokenType.avalon_lending]: AaveProcessor,
|
107
|
+
[tokenType.avalon_borrowing]: AaveProcessor,
|
108
|
+
[tokenType.satlayer]: SatlayerProcessor,
|
109
|
+
[tokenType.veda]: NoLinkVaultProcessor,
|
110
|
+
[tokenType.superlend_lending]: AaveProcessor,
|
111
|
+
[tokenType.superlend_borrowing]: AaveProcessor,
|
105
112
|
};
|