@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,7 +1,10 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import type { Campaign } from "@sdk";
|
2
|
+
export type Erc20LikeCampaignEnum = Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR | Campaign.EULER | Campaign.ERC20_FIX_APR;
|
3
|
+
/**
|
4
|
+
* @warning
|
5
|
+
* @dev This enum's order is important, do not change it unless you know what you are doing
|
6
|
+
*/
|
7
|
+
export declare enum Erc20SubType {
|
5
8
|
aura = "aura",
|
6
9
|
anglesLiquid = "anglesLiquid",
|
7
10
|
poolside = "poolside",
|
@@ -102,12 +105,3 @@ export declare enum tokenType {
|
|
102
105
|
sake_lending = "sake_lending",
|
103
106
|
gamma = "gamma"
|
104
107
|
}
|
105
|
-
export declare const tokenTypeToProtocolAndAction: Record<tokenType, {
|
106
|
-
protocol: ProtocolId | undefined;
|
107
|
-
action: OpportunityAction;
|
108
|
-
}>;
|
109
|
-
export type tokenTypeStruct = {
|
110
|
-
type: tokenType;
|
111
|
-
calls: CallDto[];
|
112
|
-
typeInfo: any;
|
113
|
-
};
|
@@ -0,0 +1,106 @@
|
|
1
|
+
/**
|
2
|
+
* @warning
|
3
|
+
* @dev This enum's order is important, do not change it unless you know what you are doing
|
4
|
+
*/
|
5
|
+
export var Erc20SubType;
|
6
|
+
(function (Erc20SubType) {
|
7
|
+
Erc20SubType["aura"] = "aura";
|
8
|
+
Erc20SubType["anglesLiquid"] = "anglesLiquid";
|
9
|
+
Erc20SubType["poolside"] = "poolside";
|
10
|
+
Erc20SubType["balancerGauge"] = "balancerGauge";
|
11
|
+
Erc20SubType["gearbox"] = "gearbox";
|
12
|
+
Erc20SubType["euler_borrow"] = "euler_borrow";
|
13
|
+
Erc20SubType["euler_lend"] = "euler_lend";
|
14
|
+
Erc20SubType["filament"] = "filament";
|
15
|
+
Erc20SubType["fluid"] = "fluid";
|
16
|
+
Erc20SubType["compound"] = "compound";
|
17
|
+
Erc20SubType["radiant_lend"] = "radiant_lend";
|
18
|
+
Erc20SubType["radiant_borrow"] = "radiant_borrow";
|
19
|
+
Erc20SubType["ionic"] = "ionic";
|
20
|
+
Erc20SubType["layerbank"] = "layerbank";
|
21
|
+
Erc20SubType["moonwell"] = "moonwell";
|
22
|
+
Erc20SubType["yei_borrowing"] = "yei_borrowing";
|
23
|
+
Erc20SubType["ironclad_borrowing"] = "ironclad_borrowing";
|
24
|
+
Erc20SubType["zerolend_borrowing"] = "zerolend_borrowing";
|
25
|
+
Erc20SubType["yei_lending"] = "yei_lending";
|
26
|
+
Erc20SubType["ironclad_lending"] = "ironclad_lending";
|
27
|
+
Erc20SubType["zerolend_lending"] = "zerolend_lending";
|
28
|
+
Erc20SubType["aave_borrowing"] = "aave_borrowing";
|
29
|
+
Erc20SubType["aave_lending"] = "aave_lending";
|
30
|
+
Erc20SubType["sturdy_aggregator"] = "sturdy_aggregator";
|
31
|
+
Erc20SubType["sturdy_silo"] = "sturdy_silo";
|
32
|
+
Erc20SubType["fraxlend"] = "fraxlend";
|
33
|
+
Erc20SubType["uniswapv2"] = "uniswapv2";
|
34
|
+
Erc20SubType["fenix"] = "fenix";
|
35
|
+
Erc20SubType["ra"] = "ra";
|
36
|
+
Erc20SubType["syncswap"] = "syncswap";
|
37
|
+
Erc20SubType["curve_2"] = "curve_2";
|
38
|
+
Erc20SubType["silostaking"] = "silostaking";
|
39
|
+
Erc20SubType["beefy"] = "beefy";
|
40
|
+
Erc20SubType["balancerPool"] = "balancerPool";
|
41
|
+
Erc20SubType["unknown"] = "unknown";
|
42
|
+
Erc20SubType["metamorpho"] = "metamorpho";
|
43
|
+
Erc20SubType["aerodrome"] = "aerodrome";
|
44
|
+
Erc20SubType["velodrome"] = "velodrome";
|
45
|
+
Erc20SubType["curve"] = "curve";
|
46
|
+
Erc20SubType["splice"] = "splice";
|
47
|
+
Erc20SubType["toros"] = "toros";
|
48
|
+
Erc20SubType["akron"] = "akron";
|
49
|
+
Erc20SubType["enzyme"] = "enzyme";
|
50
|
+
Erc20SubType["dragonswap"] = "dragonswap";
|
51
|
+
Erc20SubType["koi"] = "koi";
|
52
|
+
Erc20SubType["baseswap"] = "baseswap";
|
53
|
+
Erc20SubType["zkswap"] = "zkswap";
|
54
|
+
Erc20SubType["ironcladStaking"] = "ironcladStaking";
|
55
|
+
Erc20SubType["rfx_slv"] = "rfx_slv";
|
56
|
+
Erc20SubType["rfx"] = "rfx";
|
57
|
+
Erc20SubType["woofi"] = "woofi";
|
58
|
+
Erc20SubType["pendle"] = "pendle";
|
59
|
+
Erc20SubType["maverickBoostedPosition"] = "maverickBoostedPosition";
|
60
|
+
Erc20SubType["zkSwapThreePool"] = "zkSwapThreePool";
|
61
|
+
Erc20SubType["maha"] = "maha";
|
62
|
+
Erc20SubType["tempest"] = "tempest";
|
63
|
+
Erc20SubType["pendleYT"] = "pendleYT";
|
64
|
+
Erc20SubType["pancakeswap"] = "pancakeswap";
|
65
|
+
Erc20SubType["tempestStaking"] = "tempestStaking";
|
66
|
+
Erc20SubType["holdstation"] = "holdstation";
|
67
|
+
Erc20SubType["noLinkVault"] = "noLinkVault";
|
68
|
+
Erc20SubType["cpmmGamma"] = "cpmmGamma";
|
69
|
+
Erc20SubType["crosscurve"] = "crosscurve";
|
70
|
+
Erc20SubType["venus"] = "venus";
|
71
|
+
Erc20SubType["reactor_fusion"] = "reactor_fusion";
|
72
|
+
Erc20SubType["vicuna"] = "vicuna";
|
73
|
+
Erc20SubType["traderJoe"] = "traderJoe";
|
74
|
+
Erc20SubType["curveNPool"] = "curveNPool";
|
75
|
+
Erc20SubType["avalon_borrowing"] = "avalon_borrowing";
|
76
|
+
Erc20SubType["avalon_lending"] = "avalon_lending";
|
77
|
+
Erc20SubType["satlayer"] = "satlayer";
|
78
|
+
Erc20SubType["veda"] = "veda";
|
79
|
+
Erc20SubType["superlend_borrowing"] = "superlend_borrowing";
|
80
|
+
Erc20SubType["superlend_lending"] = "superlend_lending";
|
81
|
+
Erc20SubType["cian"] = "cian";
|
82
|
+
Erc20SubType["concrete"] = "concrete";
|
83
|
+
Erc20SubType["lendle_borrowing"] = "lendle_borrowing";
|
84
|
+
Erc20SubType["lendle_lending"] = "lendle_lending";
|
85
|
+
Erc20SubType["takotako_borrowing"] = "takotako_borrowing";
|
86
|
+
Erc20SubType["takotako_lending"] = "takotako_lending";
|
87
|
+
Erc20SubType["xlend_borrowing"] = "xlend_borrowing";
|
88
|
+
Erc20SubType["xlend_lending"] = "xlend_lending";
|
89
|
+
Erc20SubType["equalizer_gauge"] = "equalizer_gauge";
|
90
|
+
Erc20SubType["vicuna_lending"] = "vicuna_lending";
|
91
|
+
Erc20SubType["vicuna_borrowing"] = "vicuna_borrowing";
|
92
|
+
Erc20SubType["spectra_lpt"] = "spectra_lpt";
|
93
|
+
Erc20SubType["spectra_yt"] = "spectra_yt";
|
94
|
+
Erc20SubType["hourglass"] = "hourglass";
|
95
|
+
Erc20SubType["katana"] = "katana";
|
96
|
+
Erc20SubType["balancerV3"] = "balancerV3";
|
97
|
+
Erc20SubType["hanji_liquidity_vault_token"] = "hanji_liquidity_vault_token";
|
98
|
+
Erc20SubType["xU308"] = "xU308";
|
99
|
+
Erc20SubType["bunniV2"] = "bunniV2";
|
100
|
+
Erc20SubType["beratrax_vault"] = "beratrax_vault";
|
101
|
+
Erc20SubType["beraborrow_gauge"] = "beraborrow_gauge";
|
102
|
+
Erc20SubType["curve_gauge"] = "curve_gauge";
|
103
|
+
Erc20SubType["sake_borrowing"] = "sake_borrowing";
|
104
|
+
Erc20SubType["sake_lending"] = "sake_lending";
|
105
|
+
Erc20SubType["gamma"] = "gamma";
|
106
|
+
})(Erc20SubType || (Erc20SubType = {}));
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { type Erc20LikeCampaignEnum, Erc20SubType } from "@/engine/campaignTVL/implementations/Erc20/Erc20SubType";
|
2
|
+
import { type CampaignParameters, type MerklChainId } from "@sdk";
|
3
|
+
/**
|
4
|
+
* @notice Compute the subtypes of the campaigns
|
5
|
+
* @warning
|
6
|
+
* @dev This function should return an array of length campaigns.length
|
7
|
+
*/
|
8
|
+
export declare const computeSubTypes: (chainId: MerklChainId, campaigns: CampaignParameters<Erc20LikeCampaignEnum>[]) => Promise<Erc20SubType[]>;
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import { Erc20SubType } from "@/engine/campaignTVL/implementations/Erc20/Erc20SubType";
|
2
|
+
import { getTypeFromFactoryAddress } from "@/engine/erc20SubTypeProcessors/helpers/factoryFinder";
|
3
|
+
import { getTypeFromAddressChain } from "@/engine/erc20SubTypeProcessors/helpers/hardcoded";
|
4
|
+
import { getTypeFromOwnerAddress } from "@/engine/erc20SubTypeProcessors/helpers/ownerFinder";
|
5
|
+
import { processNamingConditionsInOrder } from "@/engine/erc20SubTypeProcessors/subtypesRound1";
|
6
|
+
import { decodeReturnValue } from "@/utils/decodeCalls";
|
7
|
+
import { BalancerPoolInterface, BalancerV3StablePoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, } from "@sdk";
|
8
|
+
/**
|
9
|
+
* @notice Compute the subtypes of the campaigns
|
10
|
+
* @warning
|
11
|
+
* @dev This function should return an array of length campaigns.length
|
12
|
+
*/
|
13
|
+
export const computeSubTypes = async (chainId, campaigns) => {
|
14
|
+
// 1. Do a generic multicall per campaign to see which functions are supported
|
15
|
+
const callsPerCampaign = 7;
|
16
|
+
const calls = [];
|
17
|
+
for (const [index, campaign] of campaigns.entries()) {
|
18
|
+
const { targetToken } = campaign.campaignParameters;
|
19
|
+
calls.push({
|
20
|
+
allowFailure: true,
|
21
|
+
callData: FactoryInterface.encodeFunctionData("factory"),
|
22
|
+
target: targetToken,
|
23
|
+
}, {
|
24
|
+
allowFailure: true,
|
25
|
+
callData: MetamorphoInterface.encodeFunctionData("MORPHO"),
|
26
|
+
target: targetToken,
|
27
|
+
}, {
|
28
|
+
allowFailure: true,
|
29
|
+
callData: ERC20Interface.encodeFunctionData("name"),
|
30
|
+
target: targetToken,
|
31
|
+
}, {
|
32
|
+
allowFailure: true,
|
33
|
+
callData: BalancerPoolInterface.encodeFunctionData("getPoolId"),
|
34
|
+
target: targetToken,
|
35
|
+
}, {
|
36
|
+
allowFailure: true,
|
37
|
+
callData: EnzymeInterface.encodeFunctionData("getCreator"),
|
38
|
+
target: targetToken,
|
39
|
+
}, {
|
40
|
+
allowFailure: true,
|
41
|
+
callData: LayerBankERC20Interface.encodeFunctionData("owner"),
|
42
|
+
target: targetToken,
|
43
|
+
}, {
|
44
|
+
allowFailure: true,
|
45
|
+
callData: BalancerV3StablePoolInterface.encodeFunctionData("getVault"),
|
46
|
+
target: targetToken,
|
47
|
+
});
|
48
|
+
if (calls.length !== callsPerCampaign * index)
|
49
|
+
throw new Error("computeSubTypes: calls.length !== callsPerCampaign * index");
|
50
|
+
}
|
51
|
+
const callResult = await ChainInteractionService(chainId).fetchState(calls);
|
52
|
+
// 2. Decode result from the multicalls and using try catch, try to interprete the result
|
53
|
+
const res = [];
|
54
|
+
let index = -callsPerCampaign;
|
55
|
+
for (const campaign of campaigns) {
|
56
|
+
const { targetToken } = campaign.campaignParameters;
|
57
|
+
index += callsPerCampaign;
|
58
|
+
const values = {
|
59
|
+
factory: callResult[index].returnData,
|
60
|
+
metamorpho: callResult[index + 1].returnData,
|
61
|
+
name: callResult[index + 2].returnData,
|
62
|
+
poolId: callResult[index + 3].returnData,
|
63
|
+
creator: callResult[index + 4].returnData,
|
64
|
+
owner: callResult[index + 5].returnData,
|
65
|
+
vault: callResult[index + 6].returnData,
|
66
|
+
};
|
67
|
+
// Get erc20SubType from factory address
|
68
|
+
try {
|
69
|
+
const factory = decodeReturnValue(values.factory, "factory");
|
70
|
+
res.push(getTypeFromFactoryAddress(factory));
|
71
|
+
continue;
|
72
|
+
}
|
73
|
+
catch { }
|
74
|
+
// Get erc20SubType from owner address
|
75
|
+
try {
|
76
|
+
const owner = decodeReturnValue(values.owner, "owner");
|
77
|
+
res.push(getTypeFromOwnerAddress(owner));
|
78
|
+
continue;
|
79
|
+
}
|
80
|
+
catch { }
|
81
|
+
// Get erc20SubType from address
|
82
|
+
try {
|
83
|
+
res.push(getTypeFromAddressChain(chainId, targetToken));
|
84
|
+
continue;
|
85
|
+
}
|
86
|
+
catch { }
|
87
|
+
// Get erc20SubType for enzyme (factory is replaced by dispatcher)
|
88
|
+
try {
|
89
|
+
const factory = decodeReturnValue(values.creator, "getCreator");
|
90
|
+
res.push(getTypeFromFactoryAddress(factory));
|
91
|
+
continue;
|
92
|
+
}
|
93
|
+
catch { }
|
94
|
+
// Get erc20SubType for morpho
|
95
|
+
try {
|
96
|
+
decodeReturnValue(values.metamorpho, "MORPHO");
|
97
|
+
res.push(Erc20SubType.metamorpho);
|
98
|
+
}
|
99
|
+
catch { }
|
100
|
+
// Starting from this point, assume the name is working
|
101
|
+
try {
|
102
|
+
const name = decodeReturnValue(values.name, "name");
|
103
|
+
// Get erc20SubType for balancer
|
104
|
+
try {
|
105
|
+
decodeReturnValue(values.poolId, "getPoolId");
|
106
|
+
res.push(Erc20SubType.balancerPool);
|
107
|
+
}
|
108
|
+
catch { }
|
109
|
+
try {
|
110
|
+
decodeReturnValue(values.vault, "getVault");
|
111
|
+
res.push(Erc20SubType.balancerPool);
|
112
|
+
}
|
113
|
+
catch { }
|
114
|
+
// Get erc20SubType by parsing information from the erc20 name
|
115
|
+
const typeInfoFromName = processNamingConditionsInOrder(name, targetToken, campaign);
|
116
|
+
if (!!typeInfoFromName) {
|
117
|
+
res.push(typeInfoFromName.type);
|
118
|
+
continue;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
catch { }
|
122
|
+
// Default
|
123
|
+
res.push(Erc20SubType.unknown);
|
124
|
+
}
|
125
|
+
if (res.length !== campaigns.length)
|
126
|
+
throw new Error("computeSubTypes: res.length !== campaigns.length");
|
127
|
+
return [];
|
128
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* @dev TYPE SAFETY DISABLED FOR NOW AS WE DON'T HAVE ALL THE CAMPAIGNS IMPLEMENTED
|
3
|
+
*
|
4
|
+
* @dev Casts are made to enforce type safety
|
5
|
+
* @dev A type error must be thrown if a new erc20Subtype is added and the corresponding builder is not implemented
|
6
|
+
*/
|
7
|
+
const map = {};
|
8
|
+
export const erc20SubTypeTVLBuilderFactory = (erc20Subtype) => {
|
9
|
+
if (!map[erc20Subtype]) {
|
10
|
+
return null;
|
11
|
+
}
|
12
|
+
return map[erc20Subtype];
|
13
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CampaignParameters, MerklChainId } from "@sdk";
|
2
|
+
import type { CampaignTVLBuilder, TVLData } from "../../interface";
|
3
|
+
import type { Erc20LikeCampaignEnum } from "./Erc20SubType";
|
4
|
+
export declare class Erc20CampaignTVLBuilder implements CampaignTVLBuilder<Erc20LikeCampaignEnum> {
|
5
|
+
build(chainId: MerklChainId, campaigns: CampaignParameters<Erc20LikeCampaignEnum>[]): Promise<TVLData>;
|
6
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Erc20DynamicData } from "@/engine/dynamicData/implementations/Erc20";
|
2
|
+
import { computeSubTypes } from "./computeSubTypes";
|
3
|
+
import { erc20SubTypeTVLBuilderFactory } from "./factory";
|
4
|
+
export class Erc20CampaignTVLBuilder {
|
5
|
+
async build(chainId, campaigns) {
|
6
|
+
const subTypes = await computeSubTypes(chainId, campaigns);
|
7
|
+
let tvls = [];
|
8
|
+
for (const subtype of new Set(subTypes)) {
|
9
|
+
const builder = erc20SubTypeTVLBuilderFactory(subtype);
|
10
|
+
if (!!builder) {
|
11
|
+
tvls = tvls.concat(await builder.build(chainId, campaigns.filter((_campaign, index) => subTypes[index] === subtype)));
|
12
|
+
}
|
13
|
+
else {
|
14
|
+
// @deprecated In case we don't have the new builder, use the old erc20 dynamic data
|
15
|
+
const dynamicDataList = await new Erc20DynamicData().build(chainId, campaigns);
|
16
|
+
for (const [index, dynamicData] of dynamicDataList.entries()) {
|
17
|
+
tvls.push({
|
18
|
+
campaign: campaigns[index],
|
19
|
+
tvl: dynamicData.tvl,
|
20
|
+
tvlBreakdown: [],
|
21
|
+
});
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
return tvls;
|
26
|
+
}
|
27
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { type
|
1
|
+
import { type Erc20LikeCampaignEnum } from "@/engine/campaignTVL/implementations/Erc20/Erc20SubType";
|
2
|
+
import { type CampaignParameters, type MerklChainId } from "@sdk";
|
2
3
|
import type { DynamicDataBuilder } from "../interface";
|
3
|
-
export
|
4
|
-
|
5
|
-
build(chainId: MerklChainId, campaigns: CampaignParameters<ERC20SupportedCampaignType>[]): Promise<any[]>;
|
4
|
+
export declare class Erc20DynamicData implements DynamicDataBuilder<Erc20LikeCampaignEnum> {
|
5
|
+
build(chainId: MerklChainId, campaigns: CampaignParameters<Erc20LikeCampaignEnum>[]): Promise<any[]>;
|
6
6
|
}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import { Erc20SubType } from "@/engine/campaignTVL/implementations/Erc20/Erc20SubType";
|
2
2
|
import { getTokenPricesInfo } from "@/engine/erc20SubTypeProcessors/subtypesPrices";
|
3
3
|
import { getTokenTypeRound1 } from "@/engine/erc20SubTypeProcessors/subtypesRound1";
|
4
4
|
import { getTokenTypeRound2 } from "@/engine/erc20SubTypeProcessors/subtypesRound2";
|
5
5
|
import { getTokenTypeRound3 } from "@/engine/erc20SubTypeProcessors/subtypesRound3";
|
6
6
|
import { getTokenTypeRound4 } from "@/engine/erc20SubTypeProcessors/subtypesRound4";
|
7
|
-
import { ComputedValueService } from "@/modules/v4/computedValue";
|
7
|
+
import { ComputedValueService } from "@/modules/v4/computedValue/computedValue.service";
|
8
8
|
import { TokenRepository } from "@/modules/v4/token/token.repository";
|
9
9
|
import { TokenService } from "@/modules/v4/token/token.service";
|
10
10
|
import { log } from "@/utils/logger";
|
@@ -19,7 +19,7 @@ export class Erc20DynamicData {
|
|
19
19
|
const tokenTypesByCampaign = {};
|
20
20
|
for (const campaign of campaigns) {
|
21
21
|
const typeStruct = {
|
22
|
-
type:
|
22
|
+
type: Erc20SubType.unknown,
|
23
23
|
calls: [],
|
24
24
|
typeInfo: {},
|
25
25
|
};
|
@@ -133,18 +133,12 @@ export class Erc20DynamicData {
|
|
133
133
|
let lastEligibilityRatio = 1;
|
134
134
|
if (!!campaign.campaignParameters.hooks?.length) {
|
135
135
|
lastEligibilityRatio =
|
136
|
-
(await ComputedValueService.findCampaignValue({
|
137
|
-
campaignId: `${campaign.campaignId}-${chainId}`,
|
138
|
-
field: "averageBoost",
|
139
|
-
}))?.averageBoost ?? 1;
|
136
|
+
(await ComputedValueService.findCampaignValue(Bun.hash(`${campaign.chainId}${campaign.campaignId}`).toString(), "averageBoost"))?.averageBoost ?? 1;
|
140
137
|
}
|
141
138
|
const forfeitingBoost = 1;
|
142
139
|
if (!!campaign.campaignParameters.hooks?.length) {
|
143
140
|
lastEligibilityRatio =
|
144
|
-
(await ComputedValueService.findCampaignValue({
|
145
|
-
campaignId: `${campaign.campaignId}-${chainId}`,
|
146
|
-
field: "forfeitingBoost",
|
147
|
-
}))?.forfeitingBoost ?? 1;
|
141
|
+
(await ComputedValueService.findCampaignValue(Bun.hash(`${campaign.chainId}${campaign.campaignId}`).toString(), "forfeitingBoost"))?.forfeitingBoost ?? 1;
|
148
142
|
}
|
149
143
|
let apr = (lastEligibilityRatio *
|
150
144
|
forfeitingBoost *
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { CampaignService } from "@/modules/v4/campaign";
|
2
2
|
import { TokenService } from "@/modules/v4/token/token.service";
|
3
3
|
import { engineDbClient } from "@db";
|
4
4
|
import { BN2Number, ChainInteractionService, ERC20Interface, NULL_ADDRESS, RadiantInterface, RadiantPoolInterface, YEAR, } from "@sdk";
|
@@ -57,7 +57,7 @@ export class RadiantDynamicData {
|
|
57
57
|
if (!!campaign.campaignParameters.hooks?.length) {
|
58
58
|
for (const campaignId of [campaign.campaignId, ...backupCampaignIds]) {
|
59
59
|
lastEligibilityRatio =
|
60
|
-
(await
|
60
|
+
(await CampaignService.findCampaignValue({
|
61
61
|
campaignId: `${campaignId}-${chainId}`,
|
62
62
|
field: "averageBoost",
|
63
63
|
}))?.averageBoost ?? 1;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Pricer } from "@/utils/pricer";
|
2
2
|
import { type CallDto, type Campaign, type CampaignParameters } from "@sdk";
|
3
|
-
import type {
|
4
|
-
import
|
3
|
+
import type { Erc20LikeCampaignEnum, Erc20SubType } from "../campaignTVL/implementations/Erc20/Erc20SubType";
|
4
|
+
import type { tokenTypeStruct } from "./tokenTypeStruct";
|
5
5
|
export declare enum Round {
|
6
6
|
one = "round1",
|
7
7
|
two = "round2",
|
@@ -16,7 +16,7 @@ export type callType = {
|
|
16
16
|
optional?: boolean;
|
17
17
|
};
|
18
18
|
export type mandatoryCallKeys = {
|
19
|
-
type:
|
19
|
+
type: Erc20SubType;
|
20
20
|
protocol: string;
|
21
21
|
tokenAddress: string;
|
22
22
|
blacklistedSupply: string;
|
@@ -42,7 +42,7 @@ export type dataRaw = {
|
|
42
42
|
} & stakingKeys;
|
43
43
|
export type dataType = {
|
44
44
|
protocol: string;
|
45
|
-
type:
|
45
|
+
type: Erc20SubType;
|
46
46
|
tokenAddress: string;
|
47
47
|
totalSupply: number;
|
48
48
|
blacklistedSupply: number;
|
@@ -77,7 +77,7 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
77
77
|
};
|
78
78
|
debug: boolean;
|
79
79
|
processingRound1(_typeInfo: DataRaw): void;
|
80
|
-
processingRound2(_typeInfo: DataRaw, _campaign?: CampaignParameters<
|
80
|
+
processingRound2(_typeInfo: DataRaw, _campaign?: CampaignParameters<Erc20LikeCampaignEnum>): void;
|
81
81
|
processingRound3(_typeInfo: DataRaw): void;
|
82
82
|
processingRound4(_typeInfo: DataRaw): void;
|
83
83
|
handleWhiteListBlacklistRound5(typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): {
|
@@ -85,19 +85,19 @@ export declare class GenericProcessor<Input extends callKeys, DataRaw extends da
|
|
85
85
|
totalSupply: any;
|
86
86
|
blacklistedSupply: any;
|
87
87
|
};
|
88
|
-
processingRound5(_index: number, type:
|
89
|
-
computeRound1(type:
|
90
|
-
computeRound2(index: number, type:
|
91
|
-
computeRound3(index: number, type:
|
92
|
-
computeRound4(index: number, type:
|
93
|
-
computeRound5(index: number, type:
|
94
|
-
generateWhitelistCall(type:
|
95
|
-
generateBlackListCall(type:
|
88
|
+
processingRound5(_index: number, type: Erc20SubType, typeInfo: DataRaw, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<Output>;
|
89
|
+
computeRound1(type: Erc20SubType, typeInfo: DataRaw): tokenTypeStruct;
|
90
|
+
computeRound2(index: number, type: Erc20SubType, typeInfo: DataRaw, calls: string[], campaign?: CampaignParameters<Erc20LikeCampaignEnum>): tokenTypeStruct;
|
91
|
+
computeRound3(index: number, type: Erc20SubType, typeInfo: DataRaw, calls: string[]): tokenTypeStruct;
|
92
|
+
computeRound4(index: number, type: Erc20SubType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<Erc20LikeCampaignEnum>): tokenTypeStruct;
|
93
|
+
computeRound5(index: number, type: Erc20SubType, typeInfo: DataRaw, calls: string[], campaign: CampaignParameters<Erc20LikeCampaignEnum>, pricer: Pricer): Promise<tokenTypeStruct>;
|
94
|
+
generateWhitelistCall(type: Erc20SubType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
95
|
+
generateBlackListCall(type: Erc20SubType, typeInfo: DataRaw, campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.ERC20LOGPROCESSOR> | CampaignParameters<Campaign.ERC20REBASELOGPROCESSOR> | CampaignParameters<Campaign.EULER>): CallDto[];
|
96
96
|
decodeListedSupply(index: number, list: string[], calls: string[]): string;
|
97
|
-
decodeRound(round: callType[], index: number, calls: string[], type:
|
98
|
-
decodePreviousRound(round: Round, calls: string[], data: DataRaw, type:
|
99
|
-
decodePreviousStakingRound(round: Round, calls: string[], data: DataRaw, type:
|
100
|
-
encodeRound(round: callType[], callInfo: Input, type:
|
101
|
-
encodeNextRound(round: Round, type:
|
102
|
-
encodeStakingNextRound(round: Round, type:
|
97
|
+
decodeRound(round: callType[], index: number, calls: string[], type: Erc20SubType, data: DataRaw): void;
|
98
|
+
decodePreviousRound(round: Round, calls: string[], data: DataRaw, type: Erc20SubType, index: number): void;
|
99
|
+
decodePreviousStakingRound(round: Round, calls: string[], data: DataRaw, type: Erc20SubType, index: number): void;
|
100
|
+
encodeRound(round: callType[], callInfo: Input, type: Erc20SubType): CallDto[];
|
101
|
+
encodeNextRound(round: Round, type: Erc20SubType, data: DataRaw): CallDto[];
|
102
|
+
encodeStakingNextRound(round: Round, type: Erc20SubType, data: DataRaw): CallDto[];
|
103
103
|
}
|
@@ -3,7 +3,7 @@ import { decodeCall } from "@/utils/decodeCalls";
|
|
3
3
|
import { createCall } from "@/utils/encodeCalls";
|
4
4
|
import { generateCardName } from "@/utils/generateCardName";
|
5
5
|
import { BN2Number } from "@sdk";
|
6
|
-
import { tokenTypeToProtocolAndAction } from "./
|
6
|
+
import { tokenTypeToProtocolAndAction } from "./tokenTypeToProtocolAndAction";
|
7
7
|
export var Round;
|
8
8
|
(function (Round) {
|
9
9
|
Round["one"] = "round1";
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export declare function getTypeFromFactoryAddress(address: string):
|
1
|
+
import { Erc20SubType } from "../../campaignTVL/implementations/Erc20/Erc20SubType";
|
2
|
+
export declare function getTypeFromFactoryAddress(address: string): Erc20SubType;
|
3
3
|
export declare const enzymeFundValueCalculatorRouterMapping: {
|
4
4
|
[address: string]: string;
|
5
5
|
};
|
@@ -1,40 +1,40 @@
|
|
1
|
-
import {
|
1
|
+
import { Erc20SubType } from "../../campaignTVL/implementations/Erc20/Erc20SubType";
|
2
2
|
const factoryAddresses = {
|
3
|
-
"0x420DD381b31aEf6683db6B902084cB0FFECe40Da":
|
4
|
-
"0x31832f2a97Fd20664D76Cc421207669b55CE4BC0":
|
5
|
-
"0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F":
|
6
|
-
"0xc6C09471Ee39C7E30a067952FcC89c8922f9Ab53":
|
7
|
-
"0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F":
|
8
|
-
"0x9e6d12097339ddd5402FDD39fc0Ef86Eec54AB39":
|
9
|
-
"0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F":
|
10
|
-
"0xAf39606bec181887951Ab6912Ac7EA216Bd6E4B4":
|
11
|
-
"0xC3DC853dD716bd5754f421ef94fdCbac3902ab32":
|
12
|
-
"0x2e25271297537B8124b8f883a92fFd95C4032733":
|
13
|
-
"0x71f6b49ae1558357bBb5A6074f1143c46cBcA03d":
|
14
|
-
"0x40be1cBa6C5B47cDF9da7f963B6F761F4C60627D":
|
15
|
-
"0xFDa619b6d20975be80A10332cD39b9a4b0FAa8BB":
|
16
|
-
"0xa19C51D91891D3DF7C13Ed22a2f89d328A82950f":
|
17
|
-
"0x3a76e377ED58c8731F9DF3A36155942438744Ce3":
|
18
|
-
"0x6fcf753f2C67b83f7B09746Bbc4FA0047b35D050":
|
19
|
-
"0x35A338522a435D46f77Be32C70E215B813D0e3aC":
|
20
|
-
"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73":
|
21
|
-
"0x70ee0A6DB4F5a2Dc4d9c0b57bE97B9987e75BAFD":
|
22
|
-
"0x0582D93FD9c9d42f26bE5D86a5f75291F92102C2":
|
23
|
-
"0xFeE31A6eC6eBefa0b5A594Bf5b1139e3c6fAA0fB":
|
24
|
-
"0xFD513630F697A9C1731F196185fb9ebA6eAAc20B":
|
25
|
-
"0x9Ad6C38BE94206cA50bb0d90783181662f0Cfa10":
|
26
|
-
"0x5Ea9DD3b6f042A34Df818C6c1324BC5A7c61427a":
|
27
|
-
"0xd7E72f3615aa65b92A4DBdC211E296a35512988B":
|
28
|
-
"0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a":
|
29
|
-
"0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8":
|
30
|
-
"0xA5961898870943c68037F6848d2D866Ed2016bcB":
|
31
|
-
"0xB255D6A720BB7c39fee173cE22113397119cB930":
|
3
|
+
"0x420DD381b31aEf6683db6B902084cB0FFECe40Da": Erc20SubType.aerodrome, // Aerodrome Base Factory
|
4
|
+
"0x31832f2a97Fd20664D76Cc421207669b55CE4BC0": Erc20SubType.velodrome, // Velodrome Mode Factory
|
5
|
+
"0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F": Erc20SubType.curve, // Curve Factory Fraxtal
|
6
|
+
"0xc6C09471Ee39C7E30a067952FcC89c8922f9Ab53": Erc20SubType.curve, // Curve Optimism Factory
|
7
|
+
"0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F": Erc20SubType.curve, // Curve Mainnet Factory
|
8
|
+
"0x9e6d12097339ddd5402FDD39fc0Ef86Eec54AB39": Erc20SubType.splice, // Splice Mode Factory
|
9
|
+
"0x49Afe3abCf66CF09Fab86cb1139D8811C8afe56F": Erc20SubType.toros, // Toros Base Factory
|
10
|
+
"0xAf39606bec181887951Ab6912Ac7EA216Bd6E4B4": Erc20SubType.akron, // Akron Arbitrum Factory
|
11
|
+
"0xC3DC853dD716bd5754f421ef94fdCbac3902ab32": Erc20SubType.enzyme, // Enzyme ETH Factory
|
12
|
+
"0x2e25271297537B8124b8f883a92fFd95C4032733": Erc20SubType.enzyme, // Enzyme Polygon Factory
|
13
|
+
"0x71f6b49ae1558357bBb5A6074f1143c46cBcA03d": Erc20SubType.dragonswap, // DragonSwap SEI Factory
|
14
|
+
"0x40be1cBa6C5B47cDF9da7f963B6F761F4C60627D": Erc20SubType.koi, // Silo Staking Factory
|
15
|
+
"0xFDa619b6d20975be80A10332cD39b9a4b0FAa8BB": Erc20SubType.baseswap, // Poolside Factory
|
16
|
+
"0xa19C51D91891D3DF7C13Ed22a2f89d328A82950f": Erc20SubType.fenix, // Fenix Factory
|
17
|
+
"0x3a76e377ED58c8731F9DF3A36155942438744Ce3": Erc20SubType.zkswap, // ZKSwap Factory
|
18
|
+
"0x6fcf753f2C67b83f7B09746Bbc4FA0047b35D050": Erc20SubType.pendle, // Pendle Factory
|
19
|
+
"0x35A338522a435D46f77Be32C70E215B813D0e3aC": Erc20SubType.pendleYT, // Pendle YT Factory
|
20
|
+
"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73": Erc20SubType.pancakeswap, // PancakeSwap Factory BNB
|
21
|
+
"0x70ee0A6DB4F5a2Dc4d9c0b57bE97B9987e75BAFD": Erc20SubType.pendleYT, // Pendle YT Factory
|
22
|
+
"0x0582D93FD9c9d42f26bE5D86a5f75291F92102C2": Erc20SubType.pendleYT, // Pendle Factory
|
23
|
+
"0xFeE31A6eC6eBefa0b5A594Bf5b1139e3c6fAA0fB": Erc20SubType.pendle, // Pendle Factory
|
24
|
+
"0xFD513630F697A9C1731F196185fb9ebA6eAAc20B": Erc20SubType.cpmmGamma, // CPMMGAMMA Factory
|
25
|
+
"0x9Ad6C38BE94206cA50bb0d90783181662f0Cfa10": Erc20SubType.traderJoe, // Trader Joe Factory
|
26
|
+
"0x5Ea9DD3b6f042A34Df818C6c1324BC5A7c61427a": Erc20SubType.curve, // Curve Corn 2crypto Factory
|
27
|
+
"0xd7E72f3615aa65b92A4DBdC211E296a35512988B": Erc20SubType.curveNPool, // Curve Corn Stableswap Factory
|
28
|
+
"0x7Ca46A636b02D4aBC66883D7FF164bDE506DC66a": Erc20SubType.curveNPool, // Curve Corn 3crypto Factory
|
29
|
+
"0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8": Erc20SubType.curveNPool, // Curve Arbitrum 3crypto Factory
|
30
|
+
"0xA5961898870943c68037F6848d2D866Ed2016bcB": Erc20SubType.curveNPool, // Curve Base
|
31
|
+
"0xB255D6A720BB7c39fee173cE22113397119cB930": Erc20SubType.katana, // Katana Ronin
|
32
32
|
};
|
33
33
|
export function getTypeFromFactoryAddress(address) {
|
34
34
|
if (factoryAddresses[address]) {
|
35
35
|
return factoryAddresses[address];
|
36
36
|
}
|
37
|
-
return
|
37
|
+
return Erc20SubType.unknown;
|
38
38
|
}
|
39
39
|
// Mapping of dispatcher to fund value calculator for enzyme
|
40
40
|
export const enzymeFundValueCalculatorRouterMapping = {
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ChainId } from "@sdk";
|
2
|
-
import {
|
3
|
-
export declare function getTypeFromAddressChain(chain: ChainId, token: string):
|
2
|
+
import { Erc20SubType } from "../../campaignTVL/implementations/Erc20/Erc20SubType";
|
3
|
+
export declare function getTypeFromAddressChain(chain: ChainId, token: string): Erc20SubType;
|
@@ -1,30 +1,30 @@
|
|
1
1
|
import { ChainId } from "@sdk";
|
2
|
-
import {
|
2
|
+
import { Erc20SubType } from "../../campaignTVL/implementations/Erc20/Erc20SubType";
|
3
3
|
const chainAddressToType = {
|
4
4
|
[ChainId.CORN]: {
|
5
|
-
"0xab3291b73a1087265e126e330cede0cfd4b8a693":
|
6
|
-
"0xf024586aacaf91fc4f77468fa758df280b2c9cd4":
|
7
|
-
"0x29c1b0baa9ac0182cf9f6ffceaf143f3ef3546a0":
|
8
|
-
"0xebe423b5466f9675669b2a4521b6e9f852dd1f52":
|
9
|
-
"0xb27d447cf1d211ca60676728ac28060ecfb90800":
|
5
|
+
"0xab3291b73a1087265e126e330cede0cfd4b8a693": Erc20SubType.curveNPool,
|
6
|
+
"0xf024586aacaf91fc4f77468fa758df280b2c9cd4": Erc20SubType.curveNPool,
|
7
|
+
"0x29c1b0baa9ac0182cf9f6ffceaf143f3ef3546a0": Erc20SubType.curveNPool,
|
8
|
+
"0xebe423b5466f9675669b2a4521b6e9f852dd1f52": Erc20SubType.curveNPool,
|
9
|
+
"0xb27d447cf1d211ca60676728ac28060ecfb90800": Erc20SubType.curveNPool,
|
10
10
|
},
|
11
11
|
[ChainId.MAINNET]: {
|
12
|
-
"0x08c6F91e2B681FaF5e17227F2a44C307b3C1364C":
|
13
|
-
"0x5401b8620E5FB570064CA9114fd1e135fd77D57c":
|
14
|
-
"0xFE0C961A49E1aEe2AE2d842fE40157365C6d978f":
|
15
|
-
"0x42A03534DBe07077d705311854E3B6933dD6Af85":
|
16
|
-
"0x352180974C71f84a934953Cf49C4E538a6F9c997":
|
17
|
-
"0xeDa663610638E6557c27e2f4e973D3393e844E70":
|
18
|
-
"0xf0bb20865277aBd641a307eCe5Ee04E79073416C":
|
19
|
-
"0xFF94993fA7EA27Efc943645F95Adb36C1b81244b":
|
12
|
+
"0x08c6F91e2B681FaF5e17227F2a44C307b3C1364C": Erc20SubType.veda,
|
13
|
+
"0x5401b8620E5FB570064CA9114fd1e135fd77D57c": Erc20SubType.veda,
|
14
|
+
"0xFE0C961A49E1aEe2AE2d842fE40157365C6d978f": Erc20SubType.veda,
|
15
|
+
"0x42A03534DBe07077d705311854E3B6933dD6Af85": Erc20SubType.veda,
|
16
|
+
"0x352180974C71f84a934953Cf49C4E538a6F9c997": Erc20SubType.veda,
|
17
|
+
"0xeDa663610638E6557c27e2f4e973D3393e844E70": Erc20SubType.veda,
|
18
|
+
"0xf0bb20865277aBd641a307eCe5Ee04E79073416C": Erc20SubType.veda,
|
19
|
+
"0xFF94993fA7EA27Efc943645F95Adb36C1b81244b": Erc20SubType.gearbox,
|
20
20
|
},
|
21
21
|
[ChainId.BOB]: {
|
22
|
-
"0x9998e05030Aee3Af9AD3df35A34F5C51e1628779":
|
22
|
+
"0x9998e05030Aee3Af9AD3df35A34F5C51e1628779": Erc20SubType.veda,
|
23
23
|
},
|
24
24
|
[ChainId.ETHERLINK]: {
|
25
|
-
"0x79052Ab3C166D4899a1e0DD033aC3b379AF0B1fD":
|
25
|
+
"0x79052Ab3C166D4899a1e0DD033aC3b379AF0B1fD": Erc20SubType.xU308,
|
26
26
|
},
|
27
27
|
};
|
28
28
|
export function getTypeFromAddressChain(chain, token) {
|
29
|
-
return chainAddressToType?.[chain]?.[token] ??
|
29
|
+
return chainAddressToType?.[chain]?.[token] ?? Erc20SubType.unknown;
|
30
30
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
2
|
-
export declare function getTypeFromOwnerAddress(address: string):
|
1
|
+
import { Erc20SubType } from "../../campaignTVL/implementations/Erc20/Erc20SubType";
|
2
|
+
export declare function getTypeFromOwnerAddress(address: string): Erc20SubType;
|