@curvefi/api 2.50.0 → 2.50.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.
Files changed (2) hide show
  1. package/lib/router.js +6 -2
  2. package/package.json +1 -1
package/lib/router.js CHANGED
@@ -307,6 +307,8 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
307
307
  for (l = 0; l < coins.length; l++) {
308
308
  if (k > 0 && l > 0)
309
309
  continue;
310
+ if (k == 0 && l == 0)
311
+ continue;
310
312
  i = Math.max(k - 1, 0);
311
313
  j = Math.max(l - 1, 0);
312
314
  swapType = k == 0 ? 6 : 4;
@@ -331,12 +333,14 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
331
333
  }
332
334
  }
333
335
  // Underlying coin <-> LP "swaps" (actually add_liquidity/remove_liquidity_one_coin)
334
- if ((poolData.is_fake || isAaveLikeLending) && underlyingCoinAddresses.length < 6) {
336
+ if ((poolData.is_fake || isAaveLikeLending) && (poolId !== 'aave' || curve.chainId !== 1) && underlyingCoinAddresses.length < 6) {
335
337
  coins = __spreadArray([tokenAddress], underlyingCoinAddresses, true);
336
338
  for (k = 0; k < coins.length; k++) {
337
339
  for (l = 0; l < coins.length; l++) {
338
340
  if (k > 0 && l > 0)
339
341
  continue;
342
+ if (k == 0 && l == 0)
343
+ continue;
340
344
  i = Math.max(k - 1, 0);
341
345
  j = Math.max(l - 1, 0);
342
346
  swapType = isAaveLikeLending ? 7 : 6;
@@ -392,7 +396,7 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
392
396
  swapAddress = (poolData.is_crypto && poolData.is_meta) || ((basePool === null || basePool === void 0 ? void 0 : basePool.is_lending) && poolData.is_factory) ?
393
397
  poolData.deposit_address : poolData.swap_address;
394
398
  // Underlying swaps
395
- if (!poolData.is_plain) {
399
+ if (!poolData.is_plain && (poolId !== 'aave' || curve.chainId !== 1)) {
396
400
  for (i = 0; i < underlyingCoinAddresses.length; i++) {
397
401
  for (j = 0; j < underlyingCoinAddresses.length; j++) {
398
402
  if (i === j)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.50.0",
3
+ "version": "2.50.1",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",