@merkl/api 0.15.17 → 0.15.19
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/constants.d.ts +4 -1
- package/dist/src/constants.js +9 -1
- package/dist/src/entities/opportunity.js +58 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +4 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/BeefyProcessor.js +0 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/SpectraProcessor.d.ts +31 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/SpectraProcessor.js +41 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/SpectraYTProcessor.d.ts +31 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/SpectraYTProcessor.js +39 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +4 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +5 -1
- package/dist/src/libs/campaigns/campaignTypes/UniswapV4DynamicData.d.ts +3 -0
- package/dist/src/libs/campaigns/campaignTypes/UniswapV4DynamicData.js +228 -0
- package/dist/src/libs/campaigns/campaignsDynamicData.js +4 -0
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +1 -0
- package/dist/src/modules/v4/campaign/campaign.model.js +1 -0
- package/dist/src/modules/v4/reward/reward.service.js +2 -4
- package/dist/src/types/external/spectraAPI.d.ts +88 -0
- package/dist/src/types/external/spectraAPI.js +1 -0
- package/dist/src/utils/decodeCalls.js +9 -2
- package/dist/src/utils/encodeCalls.js +17 -2
- package/dist/src/utils/generateCardName.js +4 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -0,0 +1,88 @@
|
|
1
|
+
export interface SpectraPoolData {
|
2
|
+
address: string;
|
3
|
+
chainId: number;
|
4
|
+
lpt: {
|
5
|
+
address: string;
|
6
|
+
decimals: number;
|
7
|
+
chainId: number;
|
8
|
+
supply: string;
|
9
|
+
};
|
10
|
+
liquidity: {
|
11
|
+
underlying: number;
|
12
|
+
usd: number;
|
13
|
+
};
|
14
|
+
impliedApy: number;
|
15
|
+
lpApy: {
|
16
|
+
total: number;
|
17
|
+
details: {
|
18
|
+
fees: number;
|
19
|
+
pt: number;
|
20
|
+
ibt: number;
|
21
|
+
};
|
22
|
+
};
|
23
|
+
ibtToPt: string;
|
24
|
+
ptToIbt: string;
|
25
|
+
ptPrice: {
|
26
|
+
underlying: number;
|
27
|
+
usd: number;
|
28
|
+
};
|
29
|
+
ytPrice: {
|
30
|
+
underlying: number;
|
31
|
+
usd: number;
|
32
|
+
};
|
33
|
+
ibtAmount: string;
|
34
|
+
ptAmount: string;
|
35
|
+
feeRate: string;
|
36
|
+
outFee: string;
|
37
|
+
midFee: string;
|
38
|
+
lastPrices: string;
|
39
|
+
}
|
40
|
+
export interface SpectraObject {
|
41
|
+
address: string;
|
42
|
+
name: string;
|
43
|
+
symbol: string;
|
44
|
+
decimals: number;
|
45
|
+
chainId: number;
|
46
|
+
rate: string;
|
47
|
+
yt: {
|
48
|
+
address: string;
|
49
|
+
decimals: number;
|
50
|
+
chainId: number;
|
51
|
+
};
|
52
|
+
ibt: {
|
53
|
+
address: string;
|
54
|
+
name: string;
|
55
|
+
symbol: string;
|
56
|
+
decimals: number;
|
57
|
+
chainId: number;
|
58
|
+
rate: string;
|
59
|
+
apr: {
|
60
|
+
total: number;
|
61
|
+
details: {
|
62
|
+
base: number;
|
63
|
+
};
|
64
|
+
};
|
65
|
+
price: {
|
66
|
+
underlying: number;
|
67
|
+
usd: number;
|
68
|
+
};
|
69
|
+
protocol: string;
|
70
|
+
};
|
71
|
+
underlying: {
|
72
|
+
address: string;
|
73
|
+
name: string;
|
74
|
+
symbol: string;
|
75
|
+
decimals: number;
|
76
|
+
chainId: number;
|
77
|
+
price: {
|
78
|
+
usd: number;
|
79
|
+
};
|
80
|
+
};
|
81
|
+
maturity: number;
|
82
|
+
createdAt: number;
|
83
|
+
pools: SpectraPoolData[];
|
84
|
+
maturityValue: {
|
85
|
+
underlying: number;
|
86
|
+
usd: number;
|
87
|
+
};
|
88
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
1
|
+
import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankERC20Interface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, ZFStableSwapThreePoolInterface, } from "@sdk";
|
2
2
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
3
3
|
export function decodeCall(calls, index, key, type) {
|
4
4
|
const returnData = calls[index];
|
@@ -223,7 +223,14 @@ export function decodeReturnValue(returnData, key, type) {
|
|
223
223
|
case "coins":
|
224
224
|
return ZFStableSwapThreePoolInterface.decodeFunctionResult("coins", returnData)[0];
|
225
225
|
case "minter":
|
226
|
-
|
226
|
+
switch (type) {
|
227
|
+
case tokenType.spectra_lpt:
|
228
|
+
return CurveLPTokenInterface.decodeFunctionResult("minter", returnData)[0];
|
229
|
+
default:
|
230
|
+
return ZFStableLPINterface.decodeFunctionResult("minter", returnData)[0];
|
231
|
+
}
|
232
|
+
case "principalToken":
|
233
|
+
return SpectraYTInterface.decodeFunctionResult("getPT", returnData)[0];
|
227
234
|
case "getTokenAddresses":
|
228
235
|
switch (type) {
|
229
236
|
case tokenType.tempestStaking: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { tokenType } from "../libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType";
|
2
|
-
import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
|
2
|
+
import { AaveInterface, AccountantWithRateProvidersInterface, AuraInterface, AuraOperatorInterface, BalancerGaugeInterface, BalancerPoolInterface, BalancerVaultInterface, BeefyInterface, CPMMGammaPoolMainInterface, CompoundInterface, CurveInterface, CurveLPTokenInterface, CurveStableSwapNGInterface, DefutureVaultInterface, ERC20Interface, ERC4626Interface, EnzymeInterface, EulerInterface, FactoryInterface, FluidInterface, FraxlendInterface, GearboxVaultInterface, IonicInterface, LayerBankInterface, LendleInterface, MaverickBPLensInterface, MetamorphoInterface, MoonwellInterface, OneInchStakingInterface, PendleInterface, PendleYTInterface, RadiantInterface, RfxDatastoreInterface, RswEthStrategyInterface, SpectraYTInterface, SturdyInterface, SymetricAmbientStrategyInterface, SyncSwapClassicPoolInterface, TorosInterface, UniswapV2PoolInterface, VePufferInterface, ZFStableLPINterface, } from "@sdk";
|
3
3
|
export function createCall(target, key, type, metaData) {
|
4
4
|
switch (key) {
|
5
5
|
case "SY":
|
@@ -304,9 +304,24 @@ export function createCall(target, key, type, metaData) {
|
|
304
304
|
target: target,
|
305
305
|
};
|
306
306
|
case "minter":
|
307
|
+
switch (type) {
|
308
|
+
case tokenType.spectra_lpt:
|
309
|
+
return {
|
310
|
+
allowFailure: true,
|
311
|
+
callData: CurveLPTokenInterface.encodeFunctionData("minter"),
|
312
|
+
target: target,
|
313
|
+
};
|
314
|
+
default:
|
315
|
+
return {
|
316
|
+
allowFailure: true,
|
317
|
+
callData: ZFStableLPINterface.encodeFunctionData("minter"),
|
318
|
+
target: target,
|
319
|
+
};
|
320
|
+
}
|
321
|
+
case "principalToken":
|
307
322
|
return {
|
308
323
|
allowFailure: true,
|
309
|
-
callData:
|
324
|
+
callData: SpectraYTInterface.encodeFunctionData("getPT"),
|
310
325
|
target: target,
|
311
326
|
};
|
312
327
|
case "getTokenAddresses":
|
@@ -138,6 +138,10 @@ export function generateCardName(type, typeInfo, campaign, symbols = [""], displ
|
|
138
138
|
return `${displayName}`;
|
139
139
|
case tokenType.anglesLiquid:
|
140
140
|
return `Deposit into ${typeInfo.name} (${campaign.campaignParameters.symbolTargetToken}) Vault`;
|
141
|
+
case tokenType.spectra_lpt:
|
142
|
+
return `Provide liquidity to ${typeInfo.name}`;
|
143
|
+
case tokenType.spectra_yt:
|
144
|
+
return `Hold ${typeInfo.name}`;
|
141
145
|
default:
|
142
146
|
// OVERRIDE
|
143
147
|
switch (typeInfo.tokenAddress) {
|