@reserve-protocol/dtf-rebalance-lib 2.2.2 → 2.2.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.
@@ -237,11 +237,9 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
237
237
  if (target.lte(numbers_1.ZERO) || target.lt(initialProgression) || target.gt(numbers_1.ONE)) {
238
238
  throw new Error("something has gone very wrong");
239
239
  }
240
- const relativeTarget = target.sub(initialProgression).div(numbers_1.ONE.sub(initialProgression));
241
240
  if (debug) {
242
241
  console.log("round", round);
243
242
  console.log("target", target.toString());
244
- console.log("relativeTarget", relativeTarget.toString());
245
243
  }
246
244
  // {1}
247
245
  const delta = numbers_1.ONE.sub(target);
@@ -422,6 +420,10 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
422
420
  const surplusSize = surplusTokenSizes.reduce((a, b) => a + b, 0);
423
421
  const deficitSize = deficitTokenSizes.reduce((a, b) => a + b, 0);
424
422
  const auctionSize = surplusSize > deficitSize ? deficitSize : surplusSize;
423
+ // update targeting estimates
424
+ // {1} = {1} + {USD} * {share} / {USD/share}
425
+ target = progression.add(new utils_1.Decimal(auctionSize).div(shareValue.mul(supply)));
426
+ const relativeTarget = target.sub(initialProgression).div(numbers_1.ONE.sub(initialProgression));
425
427
  return [
426
428
  {
427
429
  rebalanceNonce: rebalance.nonce,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reserve-protocol/dtf-rebalance-lib",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Rebalancing library for DTFs in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",