@reserve-protocol/dtf-rebalance-lib 0.0.7 → 0.0.8
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/src/open-auction.ts +4 -1
package/dist/open-auction.js
CHANGED
@@ -179,7 +179,10 @@ const getOpenAuction = (rebalance, _supply, _initialFolio = [], _targetBasket =
|
|
179
179
|
else if (relativeProgression.lt(finalStageAt.sub(0.02))) {
|
180
180
|
// wiggle room to prevent having to re-run an auction at the same stage after price movement
|
181
181
|
round = AuctionRound.PROGRESS;
|
182
|
-
rebalanceTarget = finalStageAt;
|
182
|
+
rebalanceTarget = initialProgression.add(numbers_1.ONE.sub(initialProgression).mul(finalStageAt));
|
183
|
+
if (rebalanceTarget.gte(numbers_1.ONE)) {
|
184
|
+
round = AuctionRound.FINAL;
|
185
|
+
}
|
183
186
|
}
|
184
187
|
// {1}
|
185
188
|
const delta = numbers_1.ONE.sub(rebalanceTarget);
|
package/package.json
CHANGED
package/src/open-auction.ts
CHANGED
@@ -274,7 +274,10 @@ export const getOpenAuction = (
|
|
274
274
|
// wiggle room to prevent having to re-run an auction at the same stage after price movement
|
275
275
|
round = AuctionRound.PROGRESS
|
276
276
|
|
277
|
-
rebalanceTarget = finalStageAt
|
277
|
+
rebalanceTarget = initialProgression.add(ONE.sub(initialProgression).mul(finalStageAt))
|
278
|
+
if (rebalanceTarget.gte(ONE)) {
|
279
|
+
round = AuctionRound.FINAL
|
280
|
+
}
|
278
281
|
}
|
279
282
|
|
280
283
|
// {1}
|