@jup-ag/lend 0.0.107-beta.0 → 0.0.107-beta.1

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.
@@ -45,14 +45,21 @@ const getAllLiquidations = async (params) => {
45
45
  const { nextVaultId: totalVaults } = await program.account.vaultAdmin.fetch(
46
46
  getVaultAdmin()
47
47
  );
48
- return await Promise.all(
49
- Array.from({ length: totalVaults - 1 }, async (_, i) => ({
50
- vaultId: i + 1,
51
- liquidations: await getLiquidations({ ...params, vaultId: i + 1 }).catch(
52
- () => []
53
- )
54
- }))
55
- );
48
+ const vaultIds = Array.from({ length: totalVaults - 1 }, (_, i) => i + 1);
49
+ const results = [];
50
+ for (let i = 0; i < vaultIds.length; i += 20) {
51
+ const chunk = vaultIds.slice(i, i + 20);
52
+ const chunkResults = await Promise.all(
53
+ chunk.map(async (vaultId) => ({
54
+ vaultId,
55
+ liquidations: await getLiquidations({ ...params, vaultId }).catch(
56
+ () => []
57
+ )
58
+ }))
59
+ );
60
+ results.push(...chunkResults);
61
+ }
62
+ return results;
56
63
  };
57
64
  function parseVaultLiquidations(logs) {
58
65
  const results = [];
package/dist/index.mjs CHANGED
@@ -8,6 +8,6 @@ import './shared/lend.CioR9-te.mjs';
8
8
  import '@solana/spl-token';
9
9
  import 'bn.js';
10
10
 
11
- const version = "0.0.107-beta.0";
11
+ const version = "0.0.107-beta.1";
12
12
 
13
13
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.107-beta.0",
3
+ "version": "0.0.107-beta.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",