@merkl/api 0.10.418 → 0.10.420
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,7 +2,7 @@ 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 { ERC20Interface, EVC_CREATION_BLOCK, EulerEVKInterface, EulerVaultLensInterface, EulerVault__factory, NETWORK_LABELS,
|
5
|
+
import { ERC20Interface, EULER_ADDRESSES, EVC_CREATION_BLOCK, EulerEVKInterface, EulerVaultLensInterface, EulerVault__factory, NETWORK_LABELS, 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";
|
@@ -33,7 +33,7 @@ async function getEulerV2Vaults() {
|
|
33
33
|
return {
|
34
34
|
allowFailure: true,
|
35
35
|
callData: EulerVaultLensInterface.encodeFunctionData("getRecognizedCollateralsLTVInfo", [vault.address]),
|
36
|
-
target:
|
36
|
+
target: EULER_ADDRESSES[chainId].VAULT_LENS,
|
37
37
|
};
|
38
38
|
}),
|
39
39
|
});
|