@reserve-protocol/dtf-rebalance-lib 1.1.1 → 1.2.0

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.
@@ -394,6 +394,9 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
394
394
  if (!rebalance.inRebalance[i]) {
395
395
  return;
396
396
  }
397
+ auctionTokens.push(token);
398
+ auctionWeights.push(newWeights[i]);
399
+ auctionPrices.push(newPrices[i]);
397
400
  // {wholeTok/wholeShare} = {wholeTok/wholeBU} * {wholeBU/wholeShare}
398
401
  const buyUpTo = weightRanges[i].low.mul(actualLimits.low);
399
402
  const sellDownTo = weightRanges[i].high.mul(actualLimits.high);
@@ -402,9 +405,6 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
402
405
  const tokenDeficitValue = buyUpTo.sub(folio[i]).mul(prices[i]).mul(supply);
403
406
  // $1 minimum
404
407
  if (tokenDeficitValue.gte(numbers_1.ONE)) {
405
- auctionTokens.push(token);
406
- auctionWeights.push(newWeights[i]);
407
- auctionPrices.push(newPrices[i]);
408
408
  deficitTokens.push(token);
409
409
  deficitTokenSizes.push(tokenDeficitValue.toNumber());
410
410
  }
@@ -414,9 +414,6 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
414
414
  const tokenSurplusValue = folio[i].sub(sellDownTo).mul(prices[i]).mul(supply);
415
415
  // $1 minimum
416
416
  if (tokenSurplusValue.gte(numbers_1.ONE)) {
417
- auctionTokens.push(token);
418
- auctionWeights.push(newWeights[i]);
419
- auctionPrices.push(newPrices[i]);
420
417
  surplusTokens.push(token);
421
418
  surplusTokenSizes.push(tokenSurplusValue.toNumber());
422
419
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reserve-protocol/dtf-rebalance-lib",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Rebalancing library for DTFs in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",