@merkl/api 0.10.417 → 0.10.419
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.
@@ -1,4 +1,6 @@
|
|
1
1
|
import { merklChainDataWithCache } from "../../merklChainData";
|
2
|
+
import { TokenRepository } from "../../../modules/v4/token/token.repository";
|
3
|
+
import { log } from "../../../utils/logger";
|
2
4
|
import { BN2Number, BalancerPoolInterface, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, } from "@sdk";
|
3
5
|
import { Pricer } from "../../../utils/pricer";
|
4
6
|
import { getLastEligibilityRatio } from "../utils/getLastEligibilityRatio";
|
@@ -115,6 +117,13 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
115
117
|
// Get the data from the final round and process it to get the price of the target token and some extra info
|
116
118
|
const callsForCampaign = tokenTypesByCampaign[campaign.campaignId].calls.length;
|
117
119
|
tokenTypesByCampaign[campaign.campaignId] = await getTokenPricesInfo(i, tokenTypesByCampaign[campaign.campaignId].type, tokenTypesByCampaign[campaign.campaignId].typeInfo, result, campaign, pricer);
|
120
|
+
try {
|
121
|
+
if (!!tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken)
|
122
|
+
await TokenRepository.updateAddressPrices(campaign.campaignParameters.targetToken, tokenTypesByCampaign[campaign.campaignId]?.typeInfo.priceTargetToken);
|
123
|
+
}
|
124
|
+
catch (e) {
|
125
|
+
log.warn(`failed to update target token price: ${e}`);
|
126
|
+
}
|
118
127
|
i += callsForCampaign;
|
119
128
|
const whitelistedSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.whitelistedSupplyTargetToken;
|
120
129
|
const totalSupplyTargetToken = whitelistedSupplyTargetToken;
|
@@ -2,21 +2,10 @@ import { Redis } from "../../../cache";
|
|
2
2
|
import { batchMulticallCallWithRetry } from "../../../utils/generic";
|
3
3
|
import { log } from "../../../utils/logger";
|
4
4
|
import { providers } from "../../../utils/providers";
|
5
|
-
import {
|
5
|
+
import { ERC20Interface, EVC_CREATION_BLOCK, EulerEVKInterface, EulerVaultLensInterface, EulerVault__factory, NETWORK_LABELS, VAULT_LENS_ADDRESS, eulerChainds, } from "@sdk";
|
6
6
|
import { getAddress } from "ethers/lib/utils";
|
7
7
|
import { fetchEulerVaultName } from "../campaignTypes/ERC20SubTypes/helpers/eulerVaultNames";
|
8
8
|
import { safeFetchLogs } from "./fetchLogs";
|
9
|
-
const VAULT_LENS_ADDRESS = {
|
10
|
-
[ChainId.MAINNET]: "0x57904B4DF131F00DEE9BB75a8FA1D27744035c90",
|
11
|
-
[ChainId.SWELL]: "0x7caA3c60D730D94D4b5E0E80E3b7D461fD153526",
|
12
|
-
[ChainId.BASE]: "0xc20B6e1d52ce377a450512958EEE8142063436CD",
|
13
|
-
};
|
14
|
-
const EVC_CREATION_BLOCK = {
|
15
|
-
[ChainId.MAINNET]: 20529207,
|
16
|
-
[ChainId.SWELL]: 485320,
|
17
|
-
[ChainId.BASE]: 22952137,
|
18
|
-
};
|
19
|
-
const eulerChainds = [ChainId.MAINNET, ChainId.SWELL, ChainId.BASE];
|
20
9
|
async function getEulerV2Vaults() {
|
21
10
|
let vaults = [];
|
22
11
|
for (const chainId of eulerChainds) {
|
@@ -95,7 +84,7 @@ async function getEulerV2Vaults() {
|
|
95
84
|
}))));
|
96
85
|
}
|
97
86
|
catch (e) {
|
98
|
-
log.error(`issue when fetching vaults on ${chainId}`, e);
|
87
|
+
log.error(`issue when fetching vaults on ${NETWORK_LABELS[chainId]}`, e);
|
99
88
|
}
|
100
89
|
}
|
101
90
|
return vaults;
|