@reserve-protocol/dtf-rebalance-lib 2.2.3 → 2.2.5
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 -5
- package/package.json +1 -1
package/dist/open-auction.js
CHANGED
|
@@ -155,11 +155,8 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
155
155
|
// calculate progressions
|
|
156
156
|
// {wholeBU/wholeShare} = {USD/wholeShare} / {USD/wholeBU}
|
|
157
157
|
const spotLimit = shareValue.div(buValue);
|
|
158
|
-
// {wholeBU/wholeShare} = D18{BU/share} / D18
|
|
159
|
-
const prevSpotLimit = new utils_1.Decimal(rebalance.limits.spot.toString()).div(numbers_1.D18d);
|
|
160
|
-
const maxSpotLimit = spotLimit.gt(prevSpotLimit) ? spotLimit : prevSpotLimit;
|
|
161
158
|
// {wholeTok/wholeShare} = {wholeTok/wholeBU} * {wholeBU/wholeShare}
|
|
162
|
-
const expectedBalances = weightRanges.map((weightRange) => weightRange.spot.mul(
|
|
159
|
+
const expectedBalances = weightRanges.map((weightRange) => weightRange.spot.mul(spotLimit));
|
|
163
160
|
// absoluteProgression
|
|
164
161
|
// {1} = {USD/wholeShare} / {USD/wholeShare}
|
|
165
162
|
let progression = folio
|
|
@@ -422,7 +419,10 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
422
419
|
const auctionSize = surplusSize > deficitSize ? deficitSize : surplusSize;
|
|
423
420
|
// update targeting estimates
|
|
424
421
|
// {1} = {1} + {USD} * {share} / {USD/share}
|
|
425
|
-
|
|
422
|
+
const adjustedTarget = progression.add(new utils_1.Decimal(auctionSize).div(shareValue.mul(supply)));
|
|
423
|
+
if (adjustedTarget.lt(numbers_1.ONE)) {
|
|
424
|
+
target = adjustedTarget;
|
|
425
|
+
}
|
|
426
426
|
const relativeTarget = target.sub(initialProgression).div(numbers_1.ONE.sub(initialProgression));
|
|
427
427
|
return [
|
|
428
428
|
{
|