@merkl/api 0.20.101 → 0.20.103
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 +54 -36
- package/dist/src/engine/campaignTVL/factory.d.ts +1 -1
- package/dist/src/engine/campaignTVL/factory.js +9 -3
- package/dist/src/engine/{erc20SubTypeProcessors/helpers/tokenType.d.ts → campaignTVL/implementations/Erc20/Erc20SubType.d.ts} +7 -13
- package/dist/src/engine/campaignTVL/implementations/Erc20/Erc20SubType.js +106 -0
- package/dist/src/engine/campaignTVL/implementations/Erc20/computeSubTypes.d.ts +8 -0
- package/dist/src/engine/campaignTVL/implementations/Erc20/computeSubTypes.js +128 -0
- package/dist/src/engine/campaignTVL/implementations/Erc20/factory.d.ts +3 -0
- package/dist/src/engine/campaignTVL/implementations/Erc20/factory.js +13 -0
- package/dist/src/engine/campaignTVL/implementations/Erc20/index.d.ts +6 -0
- package/dist/src/engine/campaignTVL/implementations/Erc20/index.js +27 -0
- package/dist/src/engine/dynamicData/implementations/Erc20.d.ts +4 -4
- package/dist/src/engine/dynamicData/implementations/Erc20.js +5 -11
- package/dist/src/engine/dynamicData/implementations/Radiant.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.d.ts +19 -19
- package/dist/src/engine/erc20SubTypeProcessors/GenericProcessor.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/helpers/factoryFinder.js +31 -31
- package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/helpers/hardcoded.js +17 -17
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/helpers/ownerFinder.js +6 -6
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AaveProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AnglesLiquid.d.ts +7 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AssetProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/AuraProcessor.d.ts +40 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.d.ts +32 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BEXRewardGaugeProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerGaugeProcessor.d.ts +29 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerPoolProcessor.d.ts +31 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BalancerV3PoolProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BeefyProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/BunniV2Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/CompoundProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ERC4626Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EnzymeProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EqualizerGaugeProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerBorrowProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FluidProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/FraxProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaALMProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GammaProcessor.d.ts +7 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/GearboxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HanjiVaultProcessor.d.ts +4 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HoldStationProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/HourglassProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MaverickBPProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/MetamorphoProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.d.ts +7 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/NoLinkVaultProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/PendleYTProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RadiantProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/RfxProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/Satlayer.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpectraYTProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SpliceProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/SturdySiloProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TempestVaultProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TemplateProcessor.d.ts +7 -7
- package/dist/src/engine/erc20SubTypeProcessors/implementations/TorosProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/UniswapProcessor.d.ts +3 -3
- package/dist/src/engine/erc20SubTypeProcessors/implementations/VicunaProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/WoofiProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/ZkSwapThreePoolProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveNPoolProcessor.d.ts +4 -4
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/curveProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.js +100 -100
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/stakedCurveProcessor.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/implementations/xU308Processor.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.d.ts +3 -2
- package/dist/src/engine/erc20SubTypeProcessors/subtypesPrices.js +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +87 -87
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound2.d.ts +2 -3
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound3.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound4.d.ts +2 -2
- package/dist/src/engine/erc20SubTypeProcessors/tokenTypeStruct.d.ts +7 -0
- package/dist/src/engine/erc20SubTypeProcessors/tokenTypeStruct.js +1 -0
- package/dist/src/engine/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.d.ts +7 -0
- package/dist/src/engine/erc20SubTypeProcessors/tokenTypeToProtocolAndAction.js +130 -0
- package/dist/src/engine/opportunityMetadata/factory.js +4 -2
- package/dist/src/engine/opportunityMetadata/implementations/ERCMultiToken.d.ts +14 -2
- package/dist/src/engine/opportunityMetadata/implementations/ERCMultiToken.js +52 -2
- package/dist/src/engine/opportunityMetadata/implementations/{Erc20.d.ts → Erc20/index.d.ts} +1 -1
- package/dist/src/engine/opportunityMetadata/implementations/{Erc20.js → Erc20/index.js} +1 -1
- package/dist/src/engine/opportunityMetadata/implementations/JsonAirdrop.d.ts +2 -2
- package/dist/src/index.d.ts +18 -12
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +6 -0
- package/dist/src/modules/v4/campaign/campaign.service.js +9 -0
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +2 -2
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +1 -1
- package/dist/src/modules/v4/computedValue/computedValue.controller.js +2 -1
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +1 -1
- package/dist/src/modules/v4/computedValue/computedValue.service.js +5 -10
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +7 -7
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +3 -3
- package/dist/src/modules/v4/programPayload/programPayload.controller.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +2 -2
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
- package/dist/src/modules/v4/router.d.ts +18 -12
- package/dist/src/modules/v4/token/token.controller.d.ts +6 -0
- package/dist/src/modules/v4/token/token.controller.js +1 -1
- package/dist/src/modules/v4/token/token.model.d.ts +3 -0
- package/dist/src/modules/v4/token/token.model.js +3 -0
- package/dist/src/modules/v4/token/token.repository.js +47 -25
- package/dist/src/modules/v4/token/token.service.d.ts +27 -6
- package/dist/src/modules/v4/token/token.service.js +29 -79
- package/dist/src/utils/decodeCalls.d.ts +3 -3
- package/dist/src/utils/decodeCalls.js +80 -80
- package/dist/src/utils/encodeCalls.d.ts +2 -2
- package/dist/src/utils/encodeCalls.js +77 -77
- package/dist/src/utils/generateCardName.d.ts +2 -2
- package/dist/src/utils/generateCardName.js +97 -97
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +0 -232
- package/dist/src/modules/v4/computedValue/index.d.ts +0 -2
- package/dist/src/modules/v4/computedValue/index.js +0 -2
@@ -1,4 +1,3 @@
|
|
1
1
|
import type { CampaignParameters, ResultDto } from "@sdk";
|
2
|
-
import type {
|
3
|
-
|
4
|
-
export declare function getTokenTypeRound2(index: number, type: tokenType, typeInfo: any, calls: ResultDto[], campaign?: CampaignParameters<ERC20SupportedCampaignType>): tokenTypeStruct;
|
2
|
+
import type { Erc20LikeCampaignEnum, Erc20SubType } from "../campaignTVL/implementations/Erc20/Erc20SubType";
|
3
|
+
export declare function getTokenTypeRound2(index: number, type: Erc20SubType, typeInfo: any, calls: ResultDto[], campaign?: CampaignParameters<Erc20LikeCampaignEnum>): import("./tokenTypeStruct").tokenTypeStruct;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { ResultDto } from "@sdk";
|
2
|
-
import type {
|
3
|
-
export declare function getTokenTypeRound3(index: number, type:
|
2
|
+
import type { Erc20SubType } from "../campaignTVL/implementations/Erc20/Erc20SubType";
|
3
|
+
export declare function getTokenTypeRound3(index: number, type: Erc20SubType, typeInfo: any, calls: ResultDto[]): import("./tokenTypeStruct").tokenTypeStruct;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { Campaign, CampaignParameters, ResultDto } from "@sdk";
|
2
|
-
import type {
|
3
|
-
export declare function getTokenTypeRound4(index: number, type:
|
2
|
+
import type { Erc20SubType } from "../campaignTVL/implementations/Erc20/Erc20SubType";
|
3
|
+
export declare function getTokenTypeRound4(index: number, type: Erc20SubType, typeInfo: any, calls: ResultDto[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): import("./tokenTypeStruct").tokenTypeStruct;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { ProtocolId } from "@/modules/v4/protocol/protocol.model";
|
2
|
+
import { OpportunityAction } from "@db/api";
|
3
|
+
import { Erc20SubType } from "../campaignTVL/implementations/Erc20/Erc20SubType";
|
4
|
+
export declare const tokenTypeToProtocolAndAction: Record<Erc20SubType, {
|
5
|
+
protocol: ProtocolId | undefined;
|
6
|
+
action: OpportunityAction;
|
7
|
+
}>;
|
@@ -0,0 +1,130 @@
|
|
1
|
+
import { OpportunityAction } from "@db/api";
|
2
|
+
import { Erc20SubType } from "../campaignTVL/implementations/Erc20/Erc20SubType";
|
3
|
+
export const tokenTypeToProtocolAndAction = {
|
4
|
+
[Erc20SubType.aave_borrowing]: { protocol: "aave", action: OpportunityAction.BORROW },
|
5
|
+
[Erc20SubType.anglesLiquid]: { protocol: "angles", action: OpportunityAction.LEND },
|
6
|
+
[Erc20SubType.aave_lending]: { protocol: "aave", action: OpportunityAction.LEND },
|
7
|
+
[Erc20SubType.aerodrome]: { protocol: "aerodrome", action: OpportunityAction.POOL },
|
8
|
+
[Erc20SubType.akron]: { protocol: "akron", action: OpportunityAction.POOL },
|
9
|
+
[Erc20SubType.aura]: { protocol: "aura", action: OpportunityAction.POOL },
|
10
|
+
[Erc20SubType.balancerGauge]: { protocol: "balancer", action: OpportunityAction.POOL },
|
11
|
+
[Erc20SubType.balancerPool]: { protocol: "balancer", action: OpportunityAction.POOL },
|
12
|
+
[Erc20SubType.baseswap]: { protocol: "base-swap", action: OpportunityAction.HOLD },
|
13
|
+
[Erc20SubType.beefy]: { protocol: "beefy", action: OpportunityAction.POOL },
|
14
|
+
[Erc20SubType.compound]: { protocol: "compound", action: OpportunityAction.LEND },
|
15
|
+
[Erc20SubType.curve]: { protocol: "curve", action: OpportunityAction.POOL },
|
16
|
+
[Erc20SubType.curve_2]: { protocol: "curve", action: OpportunityAction.POOL },
|
17
|
+
[Erc20SubType.dragonswap]: { protocol: "dragonswap", action: OpportunityAction.POOL },
|
18
|
+
[Erc20SubType.enzyme]: { protocol: "enzyme", action: OpportunityAction.HOLD },
|
19
|
+
[Erc20SubType.euler_borrow]: { protocol: "euler", action: OpportunityAction.BORROW },
|
20
|
+
[Erc20SubType.euler_lend]: { protocol: "euler", action: OpportunityAction.LEND },
|
21
|
+
[Erc20SubType.fenix]: { protocol: "fenix", action: OpportunityAction.HOLD },
|
22
|
+
[Erc20SubType.filament]: { protocol: "filament", action: OpportunityAction.LONG },
|
23
|
+
[Erc20SubType.fluid]: { protocol: "fluid", action: OpportunityAction.LEND },
|
24
|
+
[Erc20SubType.fraxlend]: { protocol: "fraxlend", action: OpportunityAction.LEND },
|
25
|
+
[Erc20SubType.gearbox]: { protocol: "gearbox", action: OpportunityAction.LEND },
|
26
|
+
[Erc20SubType.ionic]: { protocol: "ionic", action: OpportunityAction.LEND },
|
27
|
+
[Erc20SubType.ironclad_borrowing]: { protocol: "ironclad", action: OpportunityAction.HOLD },
|
28
|
+
[Erc20SubType.ironclad_lending]: { protocol: "ironclad", action: OpportunityAction.HOLD },
|
29
|
+
[Erc20SubType.koi]: { protocol: "koi", action: OpportunityAction.POOL },
|
30
|
+
[Erc20SubType.layerbank]: { protocol: "layerbank", action: OpportunityAction.LEND },
|
31
|
+
[Erc20SubType.metamorpho]: { protocol: "morpho", action: OpportunityAction.HOLD },
|
32
|
+
[Erc20SubType.moonwell]: { protocol: "moonwell", action: OpportunityAction.LEND },
|
33
|
+
[Erc20SubType.pendle]: { protocol: "pendle", action: OpportunityAction.HOLD },
|
34
|
+
[Erc20SubType.poolside]: { protocol: "poolside", action: OpportunityAction.POOL },
|
35
|
+
[Erc20SubType.ra]: { protocol: "ra", action: OpportunityAction.HOLD },
|
36
|
+
[Erc20SubType.radiant_borrow]: { protocol: "radiant", action: OpportunityAction.BORROW },
|
37
|
+
[Erc20SubType.radiant_lend]: { protocol: "radiant", action: OpportunityAction.LEND },
|
38
|
+
[Erc20SubType.reactor_fusion]: { protocol: "reactor_fusion", action: OpportunityAction.LEND },
|
39
|
+
[Erc20SubType.silostaking]: { protocol: "silo", action: OpportunityAction.LEND },
|
40
|
+
[Erc20SubType.splice]: { protocol: "splice", action: OpportunityAction.HOLD },
|
41
|
+
[Erc20SubType.sturdy_aggregator]: { protocol: "sturdy", action: OpportunityAction.LEND },
|
42
|
+
[Erc20SubType.sturdy_silo]: { protocol: "sturdy", action: OpportunityAction.LEND },
|
43
|
+
[Erc20SubType.syncswap]: { protocol: "syncswap", action: OpportunityAction.POOL },
|
44
|
+
[Erc20SubType.toros]: { protocol: "toros", action: OpportunityAction.HOLD },
|
45
|
+
[Erc20SubType.uniswapv2]: { protocol: "uniswap", action: OpportunityAction.POOL },
|
46
|
+
[Erc20SubType.velodrome]: { protocol: "velodrome", action: OpportunityAction.POOL },
|
47
|
+
[Erc20SubType.venus]: { protocol: "venus", action: OpportunityAction.LEND },
|
48
|
+
[Erc20SubType.unknown]: { protocol: undefined, action: OpportunityAction.HOLD },
|
49
|
+
[Erc20SubType.yei_borrowing]: { protocol: "yei", action: OpportunityAction.HOLD },
|
50
|
+
[Erc20SubType.yei_lending]: { protocol: "yei", action: OpportunityAction.HOLD },
|
51
|
+
[Erc20SubType.zerolend_borrowing]: { protocol: "zerolend", action: OpportunityAction.BORROW },
|
52
|
+
[Erc20SubType.zerolend_lending]: { protocol: "zerolend", action: OpportunityAction.LEND },
|
53
|
+
[Erc20SubType.zkswap]: { protocol: "zk-swap", action: OpportunityAction.POOL },
|
54
|
+
[Erc20SubType.rfx]: { protocol: "rfx", action: OpportunityAction.POOL },
|
55
|
+
[Erc20SubType.woofi]: { protocol: "woofi", action: OpportunityAction.LEND },
|
56
|
+
[Erc20SubType.ironcladStaking]: { protocol: "ironclad", action: OpportunityAction.HOLD },
|
57
|
+
[Erc20SubType.maverickBoostedPosition]: { protocol: "maverick", action: OpportunityAction.POOL },
|
58
|
+
[Erc20SubType.zkSwapThreePool]: { protocol: "zk-swap", action: OpportunityAction.POOL },
|
59
|
+
[Erc20SubType.maha]: { protocol: "maha", action: OpportunityAction.HOLD },
|
60
|
+
[Erc20SubType.tempest]: { protocol: "tempest", action: OpportunityAction.POOL },
|
61
|
+
[Erc20SubType.pendleYT]: { protocol: "pendle", action: OpportunityAction.HOLD },
|
62
|
+
[Erc20SubType.pancakeswap]: { protocol: "pancake-swap", action: OpportunityAction.POOL },
|
63
|
+
[Erc20SubType.tempestStaking]: { protocol: "tempest", action: OpportunityAction.HOLD },
|
64
|
+
[Erc20SubType.holdstation]: { protocol: "holdstation", action: OpportunityAction.HOLD },
|
65
|
+
[Erc20SubType.noLinkVault]: { protocol: undefined, action: OpportunityAction.HOLD },
|
66
|
+
[Erc20SubType.cpmmGamma]: { protocol: "gammaswap", action: OpportunityAction.POOL },
|
67
|
+
[Erc20SubType.crosscurve]: { protocol: "cross_curve", action: OpportunityAction.POOL },
|
68
|
+
[Erc20SubType.curveNPool]: { protocol: "curve", action: OpportunityAction.POOL },
|
69
|
+
[Erc20SubType.vicuna]: { protocol: "vicuna", action: OpportunityAction.POOL },
|
70
|
+
[Erc20SubType.traderJoe]: { protocol: "trader-joe", action: OpportunityAction.HOLD },
|
71
|
+
[Erc20SubType.avalon_lending]: { protocol: "avalon", action: OpportunityAction.HOLD },
|
72
|
+
[Erc20SubType.avalon_borrowing]: { protocol: "avalon", action: OpportunityAction.HOLD },
|
73
|
+
[Erc20SubType.satlayer]: { protocol: "satlayer", action: OpportunityAction.HOLD },
|
74
|
+
[Erc20SubType.veda]: { protocol: "veda", action: OpportunityAction.HOLD },
|
75
|
+
[Erc20SubType.superlend_borrowing]: { protocol: "superlend", action: OpportunityAction.BORROW },
|
76
|
+
[Erc20SubType.superlend_lending]: { protocol: "superlend", action: OpportunityAction.LEND },
|
77
|
+
[Erc20SubType.cian]: { protocol: "cian", action: OpportunityAction.HOLD },
|
78
|
+
[Erc20SubType.concrete]: { protocol: "concrete", action: OpportunityAction.HOLD },
|
79
|
+
[Erc20SubType.lendle_borrowing]: { protocol: "lendle", action: OpportunityAction.BORROW },
|
80
|
+
[Erc20SubType.lendle_lending]: { protocol: "lendle", action: OpportunityAction.LEND },
|
81
|
+
[Erc20SubType.takotako_borrowing]: { protocol: "tako-tako", action: OpportunityAction.BORROW },
|
82
|
+
[Erc20SubType.takotako_lending]: { protocol: "tako-tako", action: OpportunityAction.LEND },
|
83
|
+
[Erc20SubType.equalizer_gauge]: { protocol: "equalizer", action: OpportunityAction.HOLD },
|
84
|
+
[Erc20SubType.vicuna_lending]: { protocol: "vicuna", action: OpportunityAction.LEND },
|
85
|
+
[Erc20SubType.vicuna_borrowing]: { protocol: "vicuna", action: OpportunityAction.BORROW },
|
86
|
+
[Erc20SubType.spectra_lpt]: { protocol: "spectra", action: OpportunityAction.POOL },
|
87
|
+
[Erc20SubType.spectra_yt]: { protocol: "spectra", action: OpportunityAction.POOL },
|
88
|
+
[Erc20SubType.rfx_slv]: { protocol: "rfx", action: OpportunityAction.POOL },
|
89
|
+
[Erc20SubType.hourglass]: { protocol: "hourglass", action: OpportunityAction.HOLD },
|
90
|
+
[Erc20SubType.katana]: { protocol: "katana", action: OpportunityAction.POOL },
|
91
|
+
[Erc20SubType.balancerV3]: { protocol: "balancer", action: OpportunityAction.POOL },
|
92
|
+
[Erc20SubType.hanji_liquidity_vault_token]: { protocol: "hanji", action: OpportunityAction.POOL },
|
93
|
+
[Erc20SubType.xU308]: { protocol: "uranium", action: OpportunityAction.HOLD },
|
94
|
+
[Erc20SubType.bunniV2]: {
|
95
|
+
protocol: "bunni",
|
96
|
+
action: OpportunityAction.HOLD,
|
97
|
+
},
|
98
|
+
[Erc20SubType.beratrax_vault]: {
|
99
|
+
protocol: "beratrax",
|
100
|
+
action: OpportunityAction.HOLD,
|
101
|
+
},
|
102
|
+
[Erc20SubType.beraborrow_gauge]: {
|
103
|
+
protocol: "beraborrow",
|
104
|
+
action: OpportunityAction.HOLD,
|
105
|
+
},
|
106
|
+
[Erc20SubType.xlend_lending]: {
|
107
|
+
protocol: "xlend",
|
108
|
+
action: OpportunityAction.LEND,
|
109
|
+
},
|
110
|
+
[Erc20SubType.xlend_borrowing]: {
|
111
|
+
protocol: "xlend",
|
112
|
+
action: OpportunityAction.BORROW,
|
113
|
+
},
|
114
|
+
[Erc20SubType.curve_gauge]: {
|
115
|
+
protocol: "curve",
|
116
|
+
action: OpportunityAction.POOL,
|
117
|
+
},
|
118
|
+
[Erc20SubType.sake_borrowing]: {
|
119
|
+
protocol: "sake",
|
120
|
+
action: OpportunityAction.BORROW,
|
121
|
+
},
|
122
|
+
[Erc20SubType.sake_lending]: {
|
123
|
+
protocol: "sake",
|
124
|
+
action: OpportunityAction.LEND,
|
125
|
+
},
|
126
|
+
[Erc20SubType.gamma]: {
|
127
|
+
protocol: "gamma",
|
128
|
+
action: OpportunityAction.POOL,
|
129
|
+
},
|
130
|
+
};
|
@@ -23,8 +23,10 @@ import { RadiantMetadata } from "./implementations/Radiant";
|
|
23
23
|
import { SiloMetadata } from "./implementations/Silo";
|
24
24
|
import { UniswapV4Metadata } from "./implementations/UniswapV4";
|
25
25
|
import { VestMetadata } from "./implementations/Vest";
|
26
|
-
|
27
|
-
|
26
|
+
/**
|
27
|
+
* @dev Casts are made to enforce type safety
|
28
|
+
* @dev A type error must be thrown if a new campaign type is added and the corresponding builder is not implemented
|
29
|
+
*/
|
28
30
|
const map = {
|
29
31
|
[Campaign.INVALID]: new InvalidMetadata(),
|
30
32
|
[Campaign.ERC20]: new Erc20Metadata(),
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ProtocolId } from "@/modules/v4/protocol/protocol.model";
|
2
|
+
import { type Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
|
2
3
|
import type { MetadataBuilder } from "../interface";
|
3
4
|
type campaignType = CampaignEnum.ERC1155 | CampaignEnum.ERC1155FIXAPR | CampaignEnum.ERC6909 | CampaignEnum.ERC6909FIXAPR;
|
4
5
|
export declare class ERCMultiTokenMetadata implements MetadataBuilder<campaignType> {
|
@@ -7,8 +8,19 @@ export declare class ERCMultiTokenMetadata implements MetadataBuilder<campaignTy
|
|
7
8
|
name: string;
|
8
9
|
tokens: {
|
9
10
|
chainId: ChainId;
|
10
|
-
address: any
|
11
|
+
address: CampaignParameters<any>;
|
11
12
|
}[];
|
13
|
+
explorerAddress: CampaignParameters<any>;
|
14
|
+
mainProtocol: ProtocolId;
|
15
|
+
depositUrl: string;
|
16
|
+
} | {
|
17
|
+
action: "HOLD";
|
18
|
+
name: string;
|
19
|
+
tokens: {
|
20
|
+
chainId: ChainId;
|
21
|
+
address: CampaignParameters<any>;
|
22
|
+
}[];
|
23
|
+
explorerAddress: CampaignParameters<any>;
|
12
24
|
mainProtocol: undefined;
|
13
25
|
depositUrl: undefined;
|
14
26
|
}>;
|
@@ -1,10 +1,60 @@
|
|
1
1
|
import { OpportunityAction } from "@db/api";
|
2
|
+
import { ChainInteractionService, TokenInteractionService, } from "@sdk";
|
3
|
+
import { utils } from "ethers";
|
2
4
|
export class ERCMultiTokenMetadata {
|
3
5
|
async build(computeChainId, params) {
|
6
|
+
const { targetToken, tokenId } = params;
|
7
|
+
// Sonic Market Case
|
8
|
+
try {
|
9
|
+
const BOOK_MANAGER = "0xD4aD5Ed9E1436904624b6dB8B1BE31f36317C636";
|
10
|
+
const tokenInterface = new utils.Interface(["function getBookPairs(bytes32) view returns (uint192,uint192)"]);
|
11
|
+
const bookManagerInterface = new utils.Interface([
|
12
|
+
"function getBookKey(uint192) view returns (address,uint64,address,uint64,address,uint64)",
|
13
|
+
]);
|
14
|
+
const callResult1 = await ChainInteractionService(computeChainId).fetchState([
|
15
|
+
{
|
16
|
+
target: targetToken,
|
17
|
+
callData: tokenInterface.encodeFunctionData("getBookPairs", [tokenId]),
|
18
|
+
allowFailure: true,
|
19
|
+
},
|
20
|
+
]);
|
21
|
+
const pairAId = tokenInterface.decodeFunctionResult("getBookPairs", callResult1[0].returnData)[0];
|
22
|
+
const pairBId = tokenInterface.decodeFunctionResult("getBookPairs", callResult1[0].returnData)[1];
|
23
|
+
const callResult2 = await ChainInteractionService(computeChainId).fetchState([
|
24
|
+
{
|
25
|
+
target: BOOK_MANAGER,
|
26
|
+
callData: bookManagerInterface.encodeFunctionData("getBookKey", [pairAId]),
|
27
|
+
allowFailure: true,
|
28
|
+
},
|
29
|
+
{
|
30
|
+
target: BOOK_MANAGER,
|
31
|
+
callData: bookManagerInterface.encodeFunctionData("getBookKey", [pairBId]),
|
32
|
+
allowFailure: true,
|
33
|
+
},
|
34
|
+
]);
|
35
|
+
const baseCurrency = bookManagerInterface.decodeFunctionResult("getBookKey", callResult2[0].returnData)[0];
|
36
|
+
const quoteCurrency = bookManagerInterface.decodeFunctionResult("getBookKey", callResult2[1].returnData)[0];
|
37
|
+
const baseCurrencyInfo = await TokenInteractionService(computeChainId).info(baseCurrency);
|
38
|
+
const quoteCurrencyInfo = await TokenInteractionService(computeChainId).info(quoteCurrency);
|
39
|
+
return {
|
40
|
+
action: OpportunityAction.HOLD,
|
41
|
+
name: `Participate to Sonic Market ${baseCurrencyInfo.symbol}-${quoteCurrencyInfo.symbol}`,
|
42
|
+
tokens: [
|
43
|
+
{ chainId: computeChainId, address: targetToken },
|
44
|
+
{ chainId: computeChainId, address: baseCurrency },
|
45
|
+
{ chainId: computeChainId, address: quoteCurrency },
|
46
|
+
],
|
47
|
+
explorerAddress: targetToken,
|
48
|
+
mainProtocol: "sonicmarket",
|
49
|
+
depositUrl: `https://www.sonic.market/earn/${tokenId}?chain=${computeChainId}`,
|
50
|
+
};
|
51
|
+
}
|
52
|
+
catch { }
|
4
53
|
return {
|
5
54
|
action: OpportunityAction.HOLD,
|
6
|
-
name: `Hold ${params.symbolTargetToken} with token ID ${
|
7
|
-
tokens: [{ chainId: computeChainId, address:
|
55
|
+
name: `Hold ${params.symbolTargetToken} with token ID ${tokenId}`,
|
56
|
+
tokens: [{ chainId: computeChainId, address: targetToken }],
|
57
|
+
explorerAddress: targetToken,
|
8
58
|
mainProtocol: undefined,
|
9
59
|
depositUrl: undefined,
|
10
60
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type CampaignDynamicData, Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
|
2
|
-
import type { MetadataBuilder } from "
|
2
|
+
import type { MetadataBuilder } from "../../interface";
|
3
3
|
type campaignType = CampaignEnum.ERC20;
|
4
4
|
export declare class Erc20Metadata implements MetadataBuilder<campaignType> {
|
5
5
|
build(computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"], _subType: CampaignParameters<campaignType>["campaignSubType"], rewardTokenAddress: string, distributionChainId: ChainId, campaignId: string): Promise<{
|
@@ -2,7 +2,7 @@ import { dynamicDataBuilderFactory } from "@/engine/dynamicData/factory";
|
|
2
2
|
import { log } from "@/utils/logger";
|
3
3
|
import { Campaign as CampaignEnum, } from "@sdk";
|
4
4
|
import { getAddress } from "viem";
|
5
|
-
import { ProtocolService } from "
|
5
|
+
import { ProtocolService } from "../../../../modules/v4/protocol/protocol.service";
|
6
6
|
export class Erc20Metadata {
|
7
7
|
async build(computeChainId, params, _subType, rewardTokenAddress, distributionChainId, campaignId) {
|
8
8
|
let action = "HOLD";
|
@@ -9,13 +9,13 @@ export declare class JsonAirdropMetadata implements MetadataBuilder<campaignType
|
|
9
9
|
chainId: ChainId;
|
10
10
|
address: string;
|
11
11
|
}[];
|
12
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "
|
12
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | undefined;
|
13
13
|
depositUrl?: undefined;
|
14
14
|
} | {
|
15
15
|
action: "DROP";
|
16
16
|
name: string;
|
17
17
|
tokens: never[];
|
18
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "
|
18
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | undefined;
|
19
19
|
depositUrl: any;
|
20
20
|
}>;
|
21
21
|
static generateUrl(_computeChainId: ChainId, params: CampaignParameters<campaignType>["campaignParameters"]): any;
|
package/dist/src/index.d.ts
CHANGED
@@ -301,7 +301,7 @@ declare const app: Elysia<"", false, {
|
|
301
301
|
} & {
|
302
302
|
price?: number | null | undefined;
|
303
303
|
})[];
|
304
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "
|
304
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | undefined;
|
305
305
|
depositUrl: any;
|
306
306
|
explorerAddress: string | undefined;
|
307
307
|
tags: string[];
|
@@ -365,7 +365,7 @@ declare const app: Elysia<"", false, {
|
|
365
365
|
} & {
|
366
366
|
price?: number | null | undefined;
|
367
367
|
})[];
|
368
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "
|
368
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | undefined;
|
369
369
|
depositUrl: any;
|
370
370
|
explorerAddress: string | undefined;
|
371
371
|
tags: string[];
|
@@ -398,9 +398,9 @@ declare const app: Elysia<"", false, {
|
|
398
398
|
mainProtocolId?: string | undefined;
|
399
399
|
campaigns?: boolean | undefined;
|
400
400
|
point?: boolean | undefined;
|
401
|
-
test?: boolean | undefined;
|
402
401
|
rewardTokenSymbol?: string | undefined;
|
403
402
|
order?: string | undefined;
|
403
|
+
test?: boolean | undefined;
|
404
404
|
minimumTvl?: number | undefined;
|
405
405
|
};
|
406
406
|
headers: unknown;
|
@@ -601,9 +601,9 @@ declare const app: Elysia<"", false, {
|
|
601
601
|
mainProtocolId?: string | undefined;
|
602
602
|
campaigns?: boolean | undefined;
|
603
603
|
point?: boolean | undefined;
|
604
|
-
test?: boolean | undefined;
|
605
604
|
rewardTokenSymbol?: string | undefined;
|
606
605
|
order?: string | undefined;
|
606
|
+
test?: boolean | undefined;
|
607
607
|
minimumTvl?: number | undefined;
|
608
608
|
};
|
609
609
|
headers: unknown;
|
@@ -1107,9 +1107,9 @@ declare const app: Elysia<"", false, {
|
|
1107
1107
|
mainProtocolId?: string | undefined;
|
1108
1108
|
campaigns?: boolean | undefined;
|
1109
1109
|
point?: boolean | undefined;
|
1110
|
-
test?: boolean | undefined;
|
1111
1110
|
rewardTokenSymbol?: string | undefined;
|
1112
1111
|
order?: string | undefined;
|
1112
|
+
test?: boolean | undefined;
|
1113
1113
|
minimumTvl?: number | undefined;
|
1114
1114
|
};
|
1115
1115
|
headers: unknown;
|
@@ -1150,9 +1150,9 @@ declare const app: Elysia<"", false, {
|
|
1150
1150
|
mainProtocolId?: string | undefined;
|
1151
1151
|
campaigns?: boolean | undefined;
|
1152
1152
|
point?: boolean | undefined;
|
1153
|
-
test?: boolean | undefined;
|
1154
1153
|
rewardTokenSymbol?: string | undefined;
|
1155
1154
|
order?: string | undefined;
|
1155
|
+
test?: boolean | undefined;
|
1156
1156
|
minimumTvl?: number | undefined;
|
1157
1157
|
};
|
1158
1158
|
headers: unknown;
|
@@ -1194,9 +1194,9 @@ declare const app: Elysia<"", false, {
|
|
1194
1194
|
mainProtocolId?: string | undefined;
|
1195
1195
|
campaigns?: boolean | undefined;
|
1196
1196
|
point?: boolean | undefined;
|
1197
|
-
test?: boolean | undefined;
|
1198
1197
|
rewardTokenSymbol?: string | undefined;
|
1199
1198
|
order?: string | undefined;
|
1199
|
+
test?: boolean | undefined;
|
1200
1200
|
minimumTvl?: number | undefined;
|
1201
1201
|
};
|
1202
1202
|
headers: unknown;
|
@@ -2045,7 +2045,7 @@ declare const app: Elysia<"", false, {
|
|
2045
2045
|
} & {
|
2046
2046
|
price?: number | null | undefined;
|
2047
2047
|
})[];
|
2048
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "
|
2048
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | undefined;
|
2049
2049
|
depositUrl: any;
|
2050
2050
|
explorerAddress: string | undefined;
|
2051
2051
|
tags: string[];
|
@@ -2108,7 +2108,7 @@ declare const app: Elysia<"", false, {
|
|
2108
2108
|
} & {
|
2109
2109
|
price?: number | null | undefined;
|
2110
2110
|
})[];
|
2111
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "
|
2111
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | undefined;
|
2112
2112
|
depositUrl: any;
|
2113
2113
|
explorerAddress: string | undefined;
|
2114
2114
|
tags: string[];
|
@@ -2132,8 +2132,8 @@ declare const app: Elysia<"", false, {
|
|
2132
2132
|
items?: number | undefined;
|
2133
2133
|
tags?: string[] | undefined;
|
2134
2134
|
page?: number | undefined;
|
2135
|
-
test?: boolean | undefined;
|
2136
2135
|
ids?: string[] | undefined;
|
2136
|
+
test?: boolean | undefined;
|
2137
2137
|
opportunityTag?: string | undefined;
|
2138
2138
|
};
|
2139
2139
|
headers: unknown;
|
@@ -2166,8 +2166,8 @@ declare const app: Elysia<"", false, {
|
|
2166
2166
|
items?: number | undefined;
|
2167
2167
|
tags?: string[] | undefined;
|
2168
2168
|
page?: number | undefined;
|
2169
|
-
test?: boolean | undefined;
|
2170
2169
|
ids?: string[] | undefined;
|
2170
|
+
test?: boolean | undefined;
|
2171
2171
|
opportunityTag?: string | undefined;
|
2172
2172
|
};
|
2173
2173
|
headers: unknown;
|
@@ -2427,7 +2427,10 @@ declare const app: Elysia<"", false, {
|
|
2427
2427
|
query: {
|
2428
2428
|
symbol?: string | undefined;
|
2429
2429
|
id?: string[] | undefined;
|
2430
|
+
search?: string | undefined;
|
2430
2431
|
name?: string | undefined;
|
2432
|
+
items?: number | undefined;
|
2433
|
+
page?: number | undefined;
|
2431
2434
|
address?: string | undefined;
|
2432
2435
|
chainId?: number | undefined;
|
2433
2436
|
displaySymbol?: string | undefined;
|
@@ -2465,7 +2468,10 @@ declare const app: Elysia<"", false, {
|
|
2465
2468
|
query: {
|
2466
2469
|
symbol?: string | undefined;
|
2467
2470
|
id?: string[] | undefined;
|
2471
|
+
search?: string | undefined;
|
2468
2472
|
name?: string | undefined;
|
2473
|
+
items?: number | undefined;
|
2474
|
+
page?: number | undefined;
|
2469
2475
|
address?: string | undefined;
|
2470
2476
|
chainId?: number | undefined;
|
2471
2477
|
displaySymbol?: string | undefined;
|
@@ -4644,9 +4650,9 @@ declare const app: Elysia<"", false, {
|
|
4644
4650
|
marketId?: string | undefined;
|
4645
4651
|
strategy?: string | undefined;
|
4646
4652
|
poolId?: string | undefined;
|
4653
|
+
targetToken?: string | undefined;
|
4647
4654
|
forwarders?: (string | {})[] | undefined;
|
4648
4655
|
whitelist?: string[] | undefined;
|
4649
|
-
targetToken?: string | undefined;
|
4650
4656
|
isOutOfRangeIncentivized?: boolean | undefined;
|
4651
4657
|
weightFees?: number | undefined;
|
4652
4658
|
weightToken0?: number | undefined;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { CampaignConfigMinimalModel, CampaignUnique, CampaignWithParams, CreateCampaignModel, GetCampaignQueryModel, UpdateCampaignCreatorModel, UpdateCampaignModel, UpdateMetaDataCampaignModel } from "@/modules/v4/campaign";
|
2
2
|
import type { CampaignManualOverride } from "@db/api";
|
3
3
|
import { Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
|
4
|
+
import type { GetCampaignComputedValueModel } from "../computedValue/computedValue.model";
|
4
5
|
import { CampaignRepository } from "./campaign.repository";
|
5
6
|
export declare abstract class CampaignService {
|
6
7
|
static hashId(campaign: CampaignUnique): string;
|
@@ -635,6 +636,11 @@ export declare abstract class CampaignService {
|
|
635
636
|
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
636
637
|
createdAt: Date;
|
637
638
|
}>;
|
639
|
+
static findCampaignValue(params: GetCampaignComputedValueModel): Promise<{
|
640
|
+
averageBoost: number | null;
|
641
|
+
totalDistributedInUSD: number | null;
|
642
|
+
forfeitingBoost: number | null;
|
643
|
+
} | null>;
|
638
644
|
static removeManualOverride(campaign: CampaignUnique | string, field: CampaignManualOverride): Promise<void>;
|
639
645
|
static findCampaignsToProcess(distributionChainId: ChainId): Promise<{
|
640
646
|
campaignId: string;
|
@@ -8,6 +8,7 @@ import { log } from "@/utils/logger";
|
|
8
8
|
import { Campaign as CampaignEnum, NETWORK_LABELS, } from "@sdk";
|
9
9
|
import { utils } from "ethers";
|
10
10
|
import moment from "moment";
|
11
|
+
import { ComputedValueService } from "../computedValue/computedValue.service";
|
11
12
|
import { CampaignRepository } from "./campaign.repository";
|
12
13
|
export class CampaignService {
|
13
14
|
static hashId(campaign) {
|
@@ -181,6 +182,14 @@ export class CampaignService {
|
|
181
182
|
const id = typeof campaign === "string" ? campaign : CampaignService.hashId(campaign);
|
182
183
|
return await CampaignRepository.findUniqueOrThrow(id, withOpportunity);
|
183
184
|
}
|
185
|
+
static async findCampaignValue(params) {
|
186
|
+
if (params.campaignId.includes("-") && params.campaignId.startsWith("0x")) {
|
187
|
+
const [campaignId, distributionChain] = params.campaignId.split("-");
|
188
|
+
return await ComputedValueService.findCampaignValue(CampaignService.hashId({ campaignId, distributionChain: Number.parseInt(distributionChain) }), params.field);
|
189
|
+
}
|
190
|
+
const campaignId = (await CampaignService.findMany({ campaignId: params.campaignId }))[0].id;
|
191
|
+
return await ComputedValueService.findCampaignValue(campaignId, params.field);
|
192
|
+
}
|
184
193
|
static async removeManualOverride(campaign, field) {
|
185
194
|
const id = typeof campaign === "string" ? campaign : CampaignService.hashId(campaign);
|
186
195
|
return await CampaignRepository.removeManualOverride(id, field);
|