@curvefi/api 2.19.0 → 2.19.2

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.
@@ -1559,8 +1559,8 @@ exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
1559
1559
  token_address: "0xf43211935C781D5ca1a41d2041F397B8A7366C7A",
1560
1560
  gauge_address: "0x2932a86df44Fe8D2A706d8e9c5d51c24883423F5",
1561
1561
  is_plain: true,
1562
- underlying_coins: ['ETH', 'frxrETH'],
1563
- wrapped_coins: ['ETH', 'frxrETH'],
1562
+ underlying_coins: ['ETH', 'frxETH'],
1563
+ wrapped_coins: ['ETH', 'frxETH'],
1564
1564
  underlying_coin_addresses: [
1565
1565
  '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
1566
1566
  '0x5E8422345238F34275888049021821E8E08CAa1f',
package/lib/router.js CHANGED
@@ -68,7 +68,6 @@ var utils_1 = require("./utils");
68
68
  var pools_1 = require("./pools");
69
69
  var utils_2 = require("./pools/utils");
70
70
  var MAX_ROUTES_FOR_ONE_COIN = 3;
71
- var MIN_TVL_THRESHOLD = 5000000;
72
71
  // Inspired by Dijkstra's algorithm
73
72
  var _findAllRoutesTheShorterTheBetter = function (inputCoinAddress, outputCoinAddress) { return __awaiter(void 0, void 0, void 0, function () {
74
73
  var ALL_POOLS, basePoolsSet, _i, ALL_POOLS_1, pool, basePoolIds, markedCoins, curCoins, nextCoins, routes, step, _a, curCoins_1, inCoin, _b, ALL_POOLS_2, _c, poolId, poolData, wrapped_coin_addresses, underlying_coin_addresses, base_pool, meta_coin_addresses, token_address, is_lending, inCoinIndexes, j, swapType, _d, _e, inCoinRoute, swapType, _f, _h, inCoinRoute, j, tvl, _j, swapType, _k, _l, inCoinRoute, poolAddress, j, tvl, _m, hasEth, swapType, _o, _p, inCoinRoute;
@@ -389,7 +388,7 @@ var _findAllRoutesTvl = function (inputCoinAddress, outputCoinAddress) { return
389
388
  .filter(function (r) { return r.steps.length > 0; })
390
389
  .filter(function (r) { return r.steps[0].inputCoinAddress === inputCoinAddress; }) // Truncated routes
391
390
  .filter(function (r, i) { return routesByPoolIds.indexOf(r.steps.map(function (s) { return s.poolId; }).toString()) === i; }) // Route duplications
392
- .sort(function (a, b) { return Math.min(b.minTvl, MIN_TVL_THRESHOLD) - Math.min(a.minTvl, MIN_TVL_THRESHOLD) || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
391
+ .sort(function (a, b) { return b.minTvl - a.minTvl || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
393
392
  nextCoins.add(underlying_coin_addresses[j]);
394
393
  return [2 /*return*/];
395
394
  }
@@ -446,7 +445,7 @@ var _findAllRoutesTvl = function (inputCoinAddress, outputCoinAddress) { return
446
445
  .filter(function (r) { return r.steps.length > 0; })
447
446
  .filter(function (r) { return r.steps[0].inputCoinAddress === inputCoinAddress; }) // Truncated routes
448
447
  .filter(function (r, i) { return routesByPoolIds_1.indexOf(r.steps.map(function (s) { return s.poolId; }).toString()) === i; }) // Route duplications
449
- .sort(function (a, b) { return Math.min(b.minTvl, MIN_TVL_THRESHOLD) - Math.min(a.minTvl, MIN_TVL_THRESHOLD) || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
448
+ .sort(function (a, b) { return b.minTvl - a.minTvl || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
450
449
  nextCoins.add(token_address);
451
450
  _q.label = 6;
452
451
  case 6:
@@ -505,7 +504,7 @@ var _findAllRoutesTvl = function (inputCoinAddress, outputCoinAddress) { return
505
504
  .filter(function (r) { return r.steps.length > 0; })
506
505
  .filter(function (r) { return r.steps[0].inputCoinAddress === inputCoinAddress; }) // Truncated routes
507
506
  .filter(function (r, i) { return routesByPoolIds.indexOf(r.steps.map(function (s) { return s.poolId; }).toString()) === i; }) // Route duplications
508
- .sort(function (a, b) { return Math.min(b.minTvl, MIN_TVL_THRESHOLD) - Math.min(a.minTvl, MIN_TVL_THRESHOLD) || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
507
+ .sort(function (a, b) { return b.minTvl - a.minTvl || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
509
508
  nextCoins.add(wrapped_coin_addresses[j]);
510
509
  return [2 /*return*/];
511
510
  }
@@ -584,7 +583,7 @@ var _findAllRoutesTvl = function (inputCoinAddress, outputCoinAddress) { return
584
583
  .filter(function (r) { return r.steps.length > 0; })
585
584
  .filter(function (r) { return r.steps[0].inputCoinAddress === inputCoinAddress; }) // Truncated routes
586
585
  .filter(function (r, i) { return routesByPoolIds.indexOf(r.steps.map(function (s) { return s.poolId; }).toString()) === i; }) // Route duplications
587
- .sort(function (a, b) { return Math.min(b.minTvl, MIN_TVL_THRESHOLD) - Math.min(a.minTvl, MIN_TVL_THRESHOLD) || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
586
+ .sort(function (a, b) { return b.minTvl - a.minTvl || a.steps.length - b.steps.length; }).slice(0, MAX_ROUTES_FOR_ONE_COIN);
588
587
  nextCoins.add(underlying_coin_addresses[j]);
589
588
  return [2 /*return*/];
590
589
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.19.0",
3
+ "version": "2.19.2",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",