@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reserve-protocol/dtf-rebalance-lib",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Rebalancing library for DTFs in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -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}