@reserve-protocol/dtf-rebalance-lib 2.3.1 → 2.3.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 +1 -14
- package/package.json +1 -1
package/dist/open-auction.js
CHANGED
|
@@ -208,8 +208,7 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
208
208
|
if (relativeProgression.lt(finalStageAt.sub(0.01))) {
|
|
209
209
|
round = AuctionRound.PROGRESS;
|
|
210
210
|
target = initialProgression.add(numbers_1.ONE.sub(initialProgression).mul(finalStageAt));
|
|
211
|
-
|
|
212
|
-
if (target.gt(numbers_1.ONE.sub(1e-4))) {
|
|
211
|
+
if (target.gt(numbers_1.ONE.sub(1e-5))) {
|
|
213
212
|
target = numbers_1.ONE;
|
|
214
213
|
}
|
|
215
214
|
if (target.eq(numbers_1.ONE)) {
|
|
@@ -219,18 +218,6 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
219
218
|
// EJECT -- used later to adjust weights.high and limits.high
|
|
220
219
|
if (portionBeingEjected.gt(1e-5)) {
|
|
221
220
|
round = AuctionRound.EJECT;
|
|
222
|
-
// if the ejections are mostly what's left, target JUST the ejection if that puts us at <100%
|
|
223
|
-
let ejectionTarget = progression.add(portionBeingEjected.mul(1.1)); // buy up to 10% extra
|
|
224
|
-
if (ejectionTarget.gt(target) && ejectionTarget.lt(numbers_1.ONE)) {
|
|
225
|
-
target = ejectionTarget;
|
|
226
|
-
}
|
|
227
|
-
if (debug) {
|
|
228
|
-
console.log(" EJECT round detected:");
|
|
229
|
-
console.log(" portionBeingEjected:", portionBeingEjected.toString());
|
|
230
|
-
console.log(" progression:", progression.toString());
|
|
231
|
-
console.log(" ejectionTarget:", ejectionTarget.toString());
|
|
232
|
-
console.log(" target:", target.toString());
|
|
233
|
-
}
|
|
234
221
|
}
|
|
235
222
|
if (target.lte(numbers_1.ZERO) || target.lt(initialProgression) || target.gt(numbers_1.ONE)) {
|
|
236
223
|
throw new Error("something has gone very wrong");
|