@reserve-protocol/dtf-rebalance-lib 2.0.2 → 2.0.3
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 +4 -1
- package/package.json +1 -1
package/dist/open-auction.js
CHANGED
|
@@ -158,8 +158,11 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
158
158
|
// calculate progressions
|
|
159
159
|
// {wholeBU/wholeShare} = {USD/wholeShare} / {USD/wholeBU}
|
|
160
160
|
const spotLimit = shareValue.div(buValue);
|
|
161
|
+
// {wholeBU/wholeShare} = D18{BU/share} / D18
|
|
162
|
+
const prevSpotLimit = new utils_1.Decimal(rebalance.limits.spot.toString()).div(numbers_1.D18d);
|
|
163
|
+
const maxSpotLimit = spotLimit.gt(prevSpotLimit) ? spotLimit : prevSpotLimit;
|
|
161
164
|
// {wholeTok/wholeShare} = {wholeTok/wholeBU} * {wholeBU/wholeShare}
|
|
162
|
-
const expectedBalances = weightRanges.map((weightRange) => weightRange.spot.mul(
|
|
165
|
+
const expectedBalances = weightRanges.map((weightRange) => weightRange.spot.mul(maxSpotLimit));
|
|
163
166
|
// absolute
|
|
164
167
|
// {1} = {USD/wholeShare} / {USD/wholeShare}
|
|
165
168
|
let progression = folio
|