@defisaver/positions-sdk 2.1.155 → 2.1.156

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.
@@ -69,7 +69,12 @@ function getPortfolioData(provider_1, network_1, defaultProvider_1, addresses_1)
69
69
  const liquityV2Markets = [common_1.NetworkNumber.Eth].includes(network) ? Object.values((0, markets_1.LiquityV2Markets)(network)) : [];
70
70
  const liquityV2MarketsStaking = [common_1.NetworkNumber.Eth].includes(network) ? Object.values((0, markets_1.LiquityV2Markets)(network)).filter(market => !market.isLegacy) : [];
71
71
  const aaveV4Spokes = Object.values((0, markets_1.AaveV4Spokes)(network)).filter((market) => market.chainIds.includes(network));
72
- const args = [network, { batch: { multicall: { batchSize: isSim ? 2000 : 2500000 } } }];
72
+ // batchSize is viem's cap on a batch's raw subcall calldata (bytes); the JSON-RPC body ends up
73
+ // ~4x larger (hex + aggregate3 ABI + JSON overhead) and RPC providers reject bodies over
74
+ // ~2.5MB with HTTP 413, so keep this small enough that no single body gets near that.
75
+ // 250k gives the largest body of around 1.26MB - if we bump, we can save maybe 2-3 rpc calls but scaling takes a hit
76
+ // (e.g. adding new markets may result in body size going over alchemy body size limit)
77
+ const args = [network, { batch: { multicall: { batchSize: isSim ? 2000 : 250000 } } }];
73
78
  const client = (0, viem_1.getViemProvider)(provider, ...args);
74
79
  const defaultClient = (0, viem_1.getViemProvider)(defaultProvider, ...args);
75
80
  const morphoMarketsData = {};
@@ -49,7 +49,12 @@ export function getPortfolioData(provider_1, network_1, defaultProvider_1, addre
49
49
  const liquityV2Markets = [NetworkNumber.Eth].includes(network) ? Object.values(LiquityV2Markets(network)) : [];
50
50
  const liquityV2MarketsStaking = [NetworkNumber.Eth].includes(network) ? Object.values(LiquityV2Markets(network)).filter(market => !market.isLegacy) : [];
51
51
  const aaveV4Spokes = Object.values(AaveV4Spokes(network)).filter((market) => market.chainIds.includes(network));
52
- const args = [network, { batch: { multicall: { batchSize: isSim ? 2000 : 2500000 } } }];
52
+ // batchSize is viem's cap on a batch's raw subcall calldata (bytes); the JSON-RPC body ends up
53
+ // ~4x larger (hex + aggregate3 ABI + JSON overhead) and RPC providers reject bodies over
54
+ // ~2.5MB with HTTP 413, so keep this small enough that no single body gets near that.
55
+ // 250k gives the largest body of around 1.26MB - if we bump, we can save maybe 2-3 rpc calls but scaling takes a hit
56
+ // (e.g. adding new markets may result in body size going over alchemy body size limit)
57
+ const args = [network, { batch: { multicall: { batchSize: isSim ? 2000 : 250000 } } }];
53
58
  const client = getViemProvider(provider, ...args);
54
59
  const defaultClient = getViemProvider(defaultProvider, ...args);
55
60
  const morphoMarketsData = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "2.1.155",
3
+ "version": "2.1.156",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -74,7 +74,12 @@ export async function getPortfolioData(provider: EthereumProvider, network: Netw
74
74
  const aaveV4Spokes = Object.values(AaveV4Spokes(network)).filter((market) => market.chainIds.includes(network));
75
75
 
76
76
 
77
- const args: [NetworkNumber, any?] = [network, { batch: { multicall: { batchSize: isSim ? 2_000 : 2_500_000 } } }];
77
+ // batchSize is viem's cap on a batch's raw subcall calldata (bytes); the JSON-RPC body ends up
78
+ // ~4x larger (hex + aggregate3 ABI + JSON overhead) and RPC providers reject bodies over
79
+ // ~2.5MB with HTTP 413, so keep this small enough that no single body gets near that.
80
+ // 250k gives the largest body of around 1.26MB - if we bump, we can save maybe 2-3 rpc calls but scaling takes a hit
81
+ // (e.g. adding new markets may result in body size going over alchemy body size limit)
82
+ const args: [NetworkNumber, any?] = [network, { batch: { multicall: { batchSize: isSim ? 2_000 : 250_000 } } }];
78
83
  const client = getViemProvider(provider, ...args);
79
84
  const defaultClient = getViemProvider(defaultProvider, ...args);
80
85