@reserve-protocol/dtf-rebalance-lib 0.2.10 → 0.2.11
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.
- package/dist/open-auction.js +5 -2
- package/package.json +1 -1
package/dist/open-auction.js
CHANGED
@@ -176,6 +176,9 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
|
|
176
176
|
.reduce((a, b) => a.add(b))
|
177
177
|
.div(shareValue);
|
178
178
|
if (progression < initialProgression) {
|
179
|
+
if (debug) {
|
180
|
+
console.log("progression < initialProgression", progression.toString(), initialProgression.toString());
|
181
|
+
}
|
179
182
|
progression = initialProgression; // don't go backwards
|
180
183
|
}
|
181
184
|
// {1} = {1} / {1}
|
@@ -381,10 +384,10 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
|
|
381
384
|
const sellDownTo = weightRanges[i].high.mul(actualLimits.high);
|
382
385
|
if (folio[i].lt(buyUpTo)) {
|
383
386
|
// {USD} = {wholeTok/wholeShare} * {USD/wholeTok} * {wholeShare}
|
384
|
-
const tokenDeficitValue =
|
387
|
+
const tokenDeficitValue = buyUpTo.sub(folio[i]).mul(prices[i]).mul(supply);
|
385
388
|
// $1 minimum
|
386
389
|
if (tokenDeficitValue.gte(numbers_1.ONE)) {
|
387
|
-
deficitValue = tokenDeficitValue;
|
390
|
+
deficitValue = deficitValue.add(tokenDeficitValue);
|
388
391
|
deficitTokens.push(token);
|
389
392
|
}
|
390
393
|
}
|