@reserve-protocol/dtf-rebalance-lib 0.1.5 → 0.1.6

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.
@@ -103,7 +103,7 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
103
103
  // {USD/wholeShare} = {wholeTok/wholeShare} * {USD/wholeTok}
104
104
  const shareValue = folio
105
105
  .map((f, i) => {
106
- return rebalance.inRebalance[i] ? f.mul(prices[i]) : numbers_1.ZERO;
106
+ return f.mul(prices[i]);
107
107
  })
108
108
  .reduce((a, b) => a.add(b));
109
109
  // {USD/wholeBU} = {wholeTok/wholeBU} * {USD/wholeTok}
@@ -128,7 +128,7 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
128
128
  // {1} = {wholeTok/wholeShare} * {USD/wholeTok} / {USD/wholeShare}
129
129
  const portionBeingEjected = ejectionIndices
130
130
  .map((i) => {
131
- return rebalance.inRebalance[i] ? folio[i].mul(prices[i]) : numbers_1.ZERO;
131
+ return folio[i].mul(prices[i]);
132
132
  })
133
133
  .reduce((a, b) => a.add(b), numbers_1.ZERO)
134
134
  .div(shareValue);
@@ -366,10 +366,10 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
366
366
  // {wholeTok/wholeShare} = {wholeTok/wholeBU} * {wholeBU/wholeShare}
367
367
  const buyUpTo = weightRanges[i].low.mul(actualLimits.low);
368
368
  const sellDownTo = weightRanges[i].high.mul(actualLimits.high);
369
- if (rebalance.inRebalance[i] && folio[i].lt(buyUpTo)) {
369
+ if (folio[i].lt(buyUpTo)) {
370
370
  deficitTokens.push(token);
371
371
  }
372
- else if (rebalance.inRebalance[i] && folio[i].gt(sellDownTo)) {
372
+ else if (folio[i].gt(sellDownTo)) {
373
373
  surplusTokens.push(token);
374
374
  }
375
375
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reserve-protocol/dtf-rebalance-lib",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Rebalancing library for DTFs in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",