@merkl/api 0.20.15 → 0.20.17
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/engine/dynamicData/implementations/EventBased.js +3 -2
- package/dist/src/engine/dynamicData/implementations/UniswapV4.js +3 -2
- package/dist/src/engine/opportunityMetadata/implementations/Morpho.js +2 -1
- package/dist/src/jobs/update-euler-vaults.js +9 -2
- package/dist/src/jobs/update-rpc-calls-cache.js +6 -5
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -39,8 +39,9 @@ async function computeEventBasedPoolTVLFromMostRecentStateSave(chainId, campaign
|
|
39
39
|
// Bucket service
|
40
40
|
let tvl = 0;
|
41
41
|
try {
|
42
|
-
|
43
|
-
|
42
|
+
if (bucketName === undefined)
|
43
|
+
console.log("EVENT_BASED:", states);
|
44
|
+
const bucket = new BucketService("merkl-production-states", "merkl-production");
|
44
45
|
const storedStates = JSON.parse(await bucket.pull(fileName));
|
45
46
|
for (const [_, { value, params: _params }] of Object.entries(storedStates)) {
|
46
47
|
tvl += BN2Number(value.allTimeValue, 18 - decimalsCurrency);
|
@@ -43,8 +43,9 @@ async function computeUniV4PoolTVLFromMostRecentStateSave(chainId, poolID, price
|
|
43
43
|
let amount0 = 0;
|
44
44
|
let amount1 = 0;
|
45
45
|
try {
|
46
|
-
|
47
|
-
|
46
|
+
if (bucketName === undefined)
|
47
|
+
console.log("UNIV4", states);
|
48
|
+
const bucket = new BucketService("merkl-production-states", "merkl-production");
|
48
49
|
const storedStates = JSON.parse(await bucket.pull(fileName));
|
49
50
|
for (const [_, { value, params: _params }] of Object.entries(storedStates)) {
|
50
51
|
amount0 += BN2Number(value.amount0, decimalsCurrency0);
|
@@ -33,7 +33,8 @@ export class MorphoMetadata {
|
|
33
33
|
}
|
34
34
|
case MorphoSubCampaignType.BORROWING_BLUE:
|
35
35
|
case MorphoSubCampaignType.COLLATERAL_BLUE: {
|
36
|
-
|
36
|
+
const typedParams = params;
|
37
|
+
return `https://www.compound.blue/borrow/${typedParams.marketId.toLowerCase()}`;
|
37
38
|
}
|
38
39
|
}
|
39
40
|
}
|
@@ -1,6 +1,13 @@
|
|
1
1
|
import { Redis } from "@/cache";
|
2
2
|
import { getEulerV2Vaults, updateEulerVaultsCollatInDatabase } from "@/engine/dynamicData/utils/getEulerV2Vaults";
|
3
3
|
(async () => {
|
4
|
-
|
5
|
-
|
4
|
+
try {
|
5
|
+
await Redis.safeSet("EulerV2Vaults", await getEulerV2Vaults());
|
6
|
+
await updateEulerVaultsCollatInDatabase();
|
7
|
+
process.exit(1);
|
8
|
+
}
|
9
|
+
catch (error) {
|
10
|
+
console.error(error);
|
11
|
+
process.exit(1);
|
12
|
+
}
|
6
13
|
})();
|
@@ -3,17 +3,18 @@ import { TTLPresets } from "@/modules/v4/cache/cache.model";
|
|
3
3
|
import { ChainService } from "@/modules/v4/chain/chain.service";
|
4
4
|
import { MerklRootRepository } from "@/modules/v4/merklRoot/merklRoot.repository";
|
5
5
|
import { OpportunityService } from "@/modules/v4/opportunity";
|
6
|
-
import { NETWORK_LABELS, log } from "@sdk";
|
6
|
+
import { NETWORK_LABELS, log, withTimeout } from "@sdk";
|
7
7
|
const main = async () => {
|
8
|
-
// ─── Refresh Cache For GET /opportunities ────
|
9
|
-
await CacheService.set(TTLPresets.MIN_5, OpportunityService.findMany, { items: 25, page: 0 });
|
10
|
-
await CacheService.set(TTLPresets.MIN_5, OpportunityService.findMany, { items: 50, page: 0 });
|
11
8
|
try {
|
12
9
|
const chains = await ChainService.getSupportedIds();
|
13
10
|
const promises = [];
|
14
11
|
for (const chain of chains)
|
15
|
-
promises.push(CacheService.set(TTLPresets.
|
12
|
+
promises.push(withTimeout(CacheService.set(TTLPresets.MIN_30, MerklRootRepository.fetch, chain).catch(_err => log.warn(`RPC calls cache update failed for ${NETWORK_LABELS[chain]}.`)), 60_000 // There is no reason for this call to take more than 60 sec
|
13
|
+
));
|
16
14
|
await Promise.allSettled(promises);
|
15
|
+
// ─── Refresh Cache For GET /opportunities ────
|
16
|
+
await CacheService.set(TTLPresets.MIN_5, OpportunityService.findMany, { items: 25, page: 0 });
|
17
|
+
await CacheService.set(TTLPresets.MIN_5, OpportunityService.findMany, { items: 50, page: 0 });
|
17
18
|
process.exit(0);
|
18
19
|
}
|
19
20
|
catch (err) {
|