@merkl/api 0.20.134 → 0.20.136
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 +3 -3
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts +1 -2
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.js +13 -8
- package/dist/src/errors/UnableToFindPrice.error.d.ts +4 -0
- package/dist/src/errors/UnableToFindPrice.error.js +7 -0
- package/dist/src/errors/index.d.ts +1 -0
- package/dist/src/errors/index.js +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/modules/v4/price/price.controller.d.ts +1 -1
- package/dist/src/modules/v4/price/price.controller.js +1 -0
- package/dist/src/modules/v4/price/price.service.js +12 -1
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +42 -12
- package/dist/src/modules/v4/router.d.ts +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -3045,7 +3045,7 @@ declare const eden: {
|
|
3045
3045
|
query?: Record<string, unknown> | undefined;
|
3046
3046
|
fetch?: RequestInit | undefined;
|
3047
3047
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
3048
|
-
200: number
|
3048
|
+
200: number;
|
3049
3049
|
}>>;
|
3050
3050
|
};
|
3051
3051
|
symbol: ((params: {
|
@@ -8891,7 +8891,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8891
8891
|
authorization: string;
|
8892
8892
|
};
|
8893
8893
|
response: {
|
8894
|
-
200: number
|
8894
|
+
200: number;
|
8895
8895
|
};
|
8896
8896
|
};
|
8897
8897
|
};
|
@@ -14732,7 +14732,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14732
14732
|
query?: Record<string, unknown> | undefined;
|
14733
14733
|
fetch?: RequestInit | undefined;
|
14734
14734
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14735
|
-
200: number
|
14735
|
+
200: number;
|
14736
14736
|
}>>;
|
14737
14737
|
};
|
14738
14738
|
symbol: ((params: {
|
package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import type { Erc20SubType } from "@/engine/implementations/Erc20/subTypes";
|
2
|
-
import type { Pricer } from "@/utils/pricer";
|
3
2
|
import { type Campaign, type CampaignParameters } from "@sdk";
|
4
3
|
import { GenericProcessor, type dataType, type mandatoryCallKeys } from "../GenericProcessor";
|
5
4
|
type callType = {
|
@@ -31,6 +30,6 @@ export declare class EulerLendProcessor extends GenericProcessor<callKeysEuler,
|
|
31
30
|
round4: callType[];
|
32
31
|
};
|
33
32
|
processingRound2(typeInfo: dataRawEuler, campaign: CampaignParameters<Campaign.EULER>): void;
|
34
|
-
processingRound5(
|
33
|
+
processingRound5(_index: number, type: Erc20SubType, typeInfo: dataRawEuler, _calls: string[], campaign: CampaignParameters<Campaign.EULER>): Promise<dataTypeEuler>;
|
35
34
|
}
|
36
35
|
export {};
|
package/dist/src/engine/deprecated/erc20SubTypeProcessors/implementations/EulerLendProcessor.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { TokenService } from "@/modules/v4/token/token.service";
|
1
2
|
import { generateCardName } from "@/utils/generateCardName";
|
2
3
|
import { log } from "@/utils/logger";
|
3
4
|
import { BN2Number } from "@sdk";
|
@@ -16,23 +17,27 @@ export class EulerLendProcessor extends GenericProcessor {
|
|
16
17
|
processingRound2(typeInfo, campaign) {
|
17
18
|
typeInfo.addressVault = campaign.campaignParameters.evkAddress;
|
18
19
|
}
|
19
|
-
async processingRound5(
|
20
|
+
async processingRound5(_index, type, typeInfo, _calls, campaign) {
|
20
21
|
const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
|
21
|
-
const
|
22
|
+
const chainId = campaign.computeChainId;
|
23
|
+
const underlyingAsset = campaign.campaignParameters.addressAsset;
|
24
|
+
const underlyingToken = await TokenService.findUniqueFillOrThrow({
|
25
|
+
chainId,
|
26
|
+
address: underlyingAsset,
|
27
|
+
});
|
22
28
|
let decimalsAsset = Number(campaign.campaignParameters.decimalsAsset) ?? 18;
|
23
|
-
const priceAsset = (await pricer.get({ symbol: symbolAsset })) ?? 1;
|
24
29
|
if (Number.isNaN(decimalsAsset)) {
|
25
|
-
log.warn(`decimalsAsset is NaN for ${
|
30
|
+
log.warn(`decimalsAsset is NaN for ${underlyingToken.symbol} on campaign ${campaign.campaignId}`);
|
26
31
|
decimalsAsset = 18;
|
27
32
|
}
|
28
33
|
const totalAssets = BN2Number(typeInfo.totalAssets, decimalsAsset);
|
29
|
-
typeInfo.symbolUnderlyingToken =
|
34
|
+
typeInfo.symbolUnderlyingToken = underlyingToken.symbol;
|
30
35
|
let cardName = generateCardName(type, typeInfo, campaign);
|
31
36
|
const vaultName = await fetchEulerVaultName(typeInfo.tokenAddress, campaign.chainId);
|
32
37
|
if (!!vaultName) {
|
33
|
-
cardName = `Supply ${
|
38
|
+
cardName = `Supply ${underlyingToken.symbol} on ${vaultName} vault`;
|
34
39
|
}
|
35
|
-
const tvl =
|
40
|
+
const tvl = (underlyingToken.price ?? 1) * totalAssets;
|
36
41
|
const priceTargetToken = tvl / totalSupply;
|
37
42
|
return {
|
38
43
|
...typeInfo,
|
@@ -42,7 +47,7 @@ export class EulerLendProcessor extends GenericProcessor {
|
|
42
47
|
cardName: cardName,
|
43
48
|
decimalsAsset,
|
44
49
|
priceTargetToken,
|
45
|
-
symbolAsset,
|
50
|
+
symbolAsset: underlyingToken.symbol,
|
46
51
|
totalAssets: typeInfo.totalAssets.toString(),
|
47
52
|
totalSupply,
|
48
53
|
tvl,
|
package/dist/src/errors/index.js
CHANGED
package/dist/src/index.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { UnableToFindPrice } from "@/errors";
|
1
2
|
import { Pricer } from "@/utils/pricer";
|
2
3
|
import PriceFetcherFactory from "@/utils/prices/priceFetcherFactory";
|
3
4
|
import { PriceSourceMethod } from "@db/api";
|
@@ -33,7 +34,17 @@ export class PriceService {
|
|
33
34
|
}
|
34
35
|
static async createPriceSource(priceSource) {
|
35
36
|
const created = await PriceRepository.create(priceSource);
|
36
|
-
|
37
|
+
try {
|
38
|
+
const price = await PriceService.fetchPriceBySymbol(created.symbol);
|
39
|
+
if (price === undefined || price === null) {
|
40
|
+
throw new Error();
|
41
|
+
}
|
42
|
+
return price;
|
43
|
+
}
|
44
|
+
catch {
|
45
|
+
await PriceRepository.deleteBySymbol(created.symbol);
|
46
|
+
throw new UnableToFindPrice();
|
47
|
+
}
|
37
48
|
}
|
38
49
|
static async updatePriceSource(symbol, newPriceSource) {
|
39
50
|
return await PriceRepository.updateBySymbol(symbol, newPriceSource);
|
@@ -88,7 +88,9 @@ export declare enum swapxCampaigns {
|
|
88
88
|
Swapx_wstkscUSD_bUSDCe20_wstkscUSD_gauge_Swapx = "Swapx wstkscUSD/bUSDC.e-20 wstkscUSD gauge Swapx 0x85279f76f6ce5bb26f721931ba4e3188cd28ad51",
|
89
89
|
Swapx_wstkscUSD_bUSDCe20_bUSDCe20_gauge_Swapx = "Swapx wstkscUSD/bUSDC.e-20 bUSDC.e-20 gauge Swapx 0x85279f76f6ce5bb26f721931ba4e3188cd28ad51",
|
90
90
|
Swapx_wstkscUSD_aSonUSDC_aSonUSDC_gauge_Swapx = "Swapx wstkscUSD/aSonUSDC aSonUSDC gauge Swapx 0xf248b0EF6d45Aa492C73699B71748b5D1a6770C6",
|
91
|
-
Swapx_wstkscUSD_aSonUSDC_wstkscUSD_gauge_Swapx = "Swapx wstkscUSD/aSonUSDC wstkscUSD gauge Swapx 0xF2a497F783C6bfEe0670757462a31f9429fdE53d"
|
91
|
+
Swapx_wstkscUSD_aSonUSDC_wstkscUSD_gauge_Swapx = "Swapx wstkscUSD/aSonUSDC wstkscUSD gauge Swapx 0xF2a497F783C6bfEe0670757462a31f9429fdE53d",
|
92
|
+
Swapx_beS_OS_beS_gauge_Swapx = "Swapx beS/OS beS gauge Swapx 0xfBA3606310f3d492031176eC85DFbeD67F5799F2",
|
93
|
+
Swapx_beS_OS_OS_gauge_Swapx = "Swapx beS/OS OS gauge Swapx 0x77546B40445d3eca6111944DFe902de0514A4F80"
|
92
94
|
}
|
93
95
|
export declare enum celoCampaigns {
|
94
96
|
UniswapV3_cUSD_USDT_Celo = "UniswapV3 cUSD/USDT Celo 0x5dC631aD6C26BEA1a59fBF2C2680CF3df43d249f",
|
@@ -501,7 +503,7 @@ declare const RoninInterfaceCampaigns: {
|
|
501
503
|
hooks: never[];
|
502
504
|
targetToken: string;
|
503
505
|
whitelist: never[];
|
504
|
-
blacklist:
|
506
|
+
blacklist: string[];
|
505
507
|
url: string;
|
506
508
|
subCampaignType: any;
|
507
509
|
};
|
@@ -155,6 +155,8 @@ export var swapxCampaigns;
|
|
155
155
|
swapxCampaigns["Swapx_wstkscUSD_bUSDCe20_bUSDCe20_gauge_Swapx"] = "Swapx wstkscUSD/bUSDC.e-20 bUSDC.e-20 gauge Swapx 0x85279f76f6ce5bb26f721931ba4e3188cd28ad51";
|
156
156
|
swapxCampaigns["Swapx_wstkscUSD_aSonUSDC_aSonUSDC_gauge_Swapx"] = "Swapx wstkscUSD/aSonUSDC aSonUSDC gauge Swapx 0xf248b0EF6d45Aa492C73699B71748b5D1a6770C6";
|
157
157
|
swapxCampaigns["Swapx_wstkscUSD_aSonUSDC_wstkscUSD_gauge_Swapx"] = "Swapx wstkscUSD/aSonUSDC wstkscUSD gauge Swapx 0xF2a497F783C6bfEe0670757462a31f9429fdE53d";
|
158
|
+
swapxCampaigns["Swapx_beS_OS_beS_gauge_Swapx"] = "Swapx beS/OS beS gauge Swapx 0xfBA3606310f3d492031176eC85DFbeD67F5799F2";
|
159
|
+
swapxCampaigns["Swapx_beS_OS_OS_gauge_Swapx"] = "Swapx beS/OS OS gauge Swapx 0x77546B40445d3eca6111944DFe902de0514A4F80";
|
158
160
|
})(swapxCampaigns || (swapxCampaigns = {}));
|
159
161
|
export var celoCampaigns;
|
160
162
|
(function (celoCampaigns) {
|
@@ -524,8 +526,8 @@ const RoninInterfaceCampaigns = {
|
|
524
526
|
forwarders: [],
|
525
527
|
isOutOfRangeIncentivized: false,
|
526
528
|
weightFees: 1500,
|
527
|
-
weightToken0:
|
528
|
-
weightToken1:
|
529
|
+
weightToken0: 5500,
|
530
|
+
weightToken1: 3000,
|
529
531
|
},
|
530
532
|
[roninCampaigns.Katana_AXS_RON_Ronin]: {
|
531
533
|
campaignType: Campaign.CLAMM,
|
@@ -537,9 +539,9 @@ const RoninInterfaceCampaigns = {
|
|
537
539
|
url: "https://app.roninchain.com/liquidity/v3/0x3230b903e8a5d6e46b5a5028470dd33e7b673722",
|
538
540
|
forwarders: [],
|
539
541
|
isOutOfRangeIncentivized: false,
|
540
|
-
weightFees:
|
541
|
-
weightToken0:
|
542
|
-
weightToken1:
|
542
|
+
weightFees: 2000,
|
543
|
+
weightToken0: 500,
|
544
|
+
weightToken1: 7500,
|
543
545
|
},
|
544
546
|
[roninCampaigns.Katana_USDC_RON_Ronin]: {
|
545
547
|
campaignType: Campaign.CLAMM,
|
@@ -551,9 +553,9 @@ const RoninInterfaceCampaigns = {
|
|
551
553
|
url: "https://app.roninchain.com/liquidity/v3/0x392d372f2a51610e9ac5b741379d5631ca9a1c7f",
|
552
554
|
forwarders: [],
|
553
555
|
isOutOfRangeIncentivized: false,
|
554
|
-
weightFees:
|
555
|
-
weightToken0:
|
556
|
-
weightToken1:
|
556
|
+
weightFees: 3000,
|
557
|
+
weightToken0: 4500,
|
558
|
+
weightToken1: 2500,
|
557
559
|
},
|
558
560
|
[roninCampaigns.Katana_LRON_RON_Ronin]: {
|
559
561
|
campaignType: Campaign.CLAMM,
|
@@ -566,8 +568,8 @@ const RoninInterfaceCampaigns = {
|
|
566
568
|
forwarders: [],
|
567
569
|
isOutOfRangeIncentivized: false,
|
568
570
|
weightFees: 1000,
|
569
|
-
weightToken0:
|
570
|
-
weightToken1:
|
571
|
+
weightToken0: 6500,
|
572
|
+
weightToken1: 2500,
|
571
573
|
},
|
572
574
|
[roninCampaigns.Supply_WETH_Compound_Ronin]: {
|
573
575
|
campaignType: Campaign.COMPOUND_V3,
|
@@ -575,8 +577,8 @@ const RoninInterfaceCampaigns = {
|
|
575
577
|
hooks: [],
|
576
578
|
targetToken: "0x4006eD4097Ee51c09A04c3B0951D28CCf19e6DFE",
|
577
579
|
whitelist: [],
|
578
|
-
blacklist: [],
|
579
|
-
url: "",
|
580
|
+
blacklist: ["0xfeef9d78980083f605c9902c0367df6035d47276"],
|
581
|
+
url: "https://complend.tech/lend/weth-ronin/",
|
580
582
|
subCampaignType: CompoundV3SubCampaignType.SUPPLY,
|
581
583
|
},
|
582
584
|
};
|
@@ -965,6 +967,34 @@ const EtherlinkInterfaceCampaigns = {
|
|
965
967
|
},
|
966
968
|
};
|
967
969
|
const SwapxInterfaceCampaigns = {
|
970
|
+
[swapxCampaigns.Swapx_beS_OS_beS_gauge_Swapx]: {
|
971
|
+
campaignType: Campaign.CLAMM,
|
972
|
+
computeChainId: ChainId.SONIC,
|
973
|
+
hooks: [],
|
974
|
+
poolAddress: "0x97fE831cC56da84321f404a300e2Be81b5bd668A",
|
975
|
+
whitelist: ["0xfBA3606310f3d492031176eC85DFbeD67F5799F2"],
|
976
|
+
blacklist: [],
|
977
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
978
|
+
forwarders: [],
|
979
|
+
isOutOfRangeIncentivized: false,
|
980
|
+
weightFees: 2000,
|
981
|
+
weightToken0: 4000,
|
982
|
+
weightToken1: 4000,
|
983
|
+
},
|
984
|
+
[swapxCampaigns.Swapx_beS_OS_OS_gauge_Swapx]: {
|
985
|
+
campaignType: Campaign.CLAMM,
|
986
|
+
computeChainId: ChainId.SONIC,
|
987
|
+
hooks: [],
|
988
|
+
poolAddress: "0x97fE831cC56da84321f404a300e2Be81b5bd668A",
|
989
|
+
whitelist: ["0x77546B40445d3eca6111944DFe902de0514A4F80"],
|
990
|
+
blacklist: [],
|
991
|
+
url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
|
992
|
+
forwarders: [],
|
993
|
+
isOutOfRangeIncentivized: false,
|
994
|
+
weightFees: 2000,
|
995
|
+
weightToken0: 4000,
|
996
|
+
weightToken1: 4000,
|
997
|
+
},
|
968
998
|
[swapxCampaigns.Swapx_wstkscUSD_aSonUSDC_wstkscUSD_gauge_Swapx]: {
|
969
999
|
campaignType: Campaign.CLAMM,
|
970
1000
|
computeChainId: ChainId.SONIC,
|