@reserve-protocol/dtf-rebalance-lib 2.6.4 → 3.0.0
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/numbers.d.ts +1 -0
- package/dist/numbers.js +2 -1
- package/dist/open-auction.js +51 -43
- package/dist/start-rebalance.d.ts +4 -4
- package/dist/start-rebalance.js +23 -4
- package/dist/types.d.ts +14 -7
- package/package.json +1 -1
package/dist/numbers.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Decimal as DecimalType } from "decimal.js-light";
|
|
|
3
3
|
export declare const D27n: bigint;
|
|
4
4
|
export declare const D18n: bigint;
|
|
5
5
|
export declare const D9n: bigint;
|
|
6
|
+
export declare const D256_MAXn: bigint;
|
|
6
7
|
export declare const D27d: DecimalType;
|
|
7
8
|
export declare const D18d: DecimalType;
|
|
8
9
|
export declare const D9d: DecimalType;
|
package/dist/numbers.js
CHANGED
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bn = exports.TWO = exports.ONE = exports.EPSILON = exports.ZERO = exports.D9d = exports.D18d = exports.D27d = exports.D9n = exports.D18n = exports.D27n = void 0;
|
|
6
|
+
exports.bn = exports.TWO = exports.ONE = exports.EPSILON = exports.ZERO = exports.D9d = exports.D18d = exports.D27d = exports.D256_MAXn = exports.D9n = exports.D18n = exports.D27n = void 0;
|
|
7
7
|
const decimal_js_light_1 = __importDefault(require("decimal.js-light"));
|
|
8
8
|
// Create a local Decimal constructor with custom precision
|
|
9
9
|
const Decimal = decimal_js_light_1.default.clone({ precision: 100 });
|
|
10
10
|
exports.D27n = 10n ** 27n;
|
|
11
11
|
exports.D18n = 10n ** 18n;
|
|
12
12
|
exports.D9n = 10n ** 9n;
|
|
13
|
+
exports.D256_MAXn = 10n ** 256n - 1n;
|
|
13
14
|
exports.D27d = new Decimal("1e27");
|
|
14
15
|
exports.D18d = new Decimal("1e18");
|
|
15
16
|
exports.D9d = new Decimal("1e9");
|
package/dist/open-auction.js
CHANGED
|
@@ -99,20 +99,22 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
99
99
|
// {wholeTok/wholeShare} = {tok} / {tok/wholeTok} / {wholeShare}
|
|
100
100
|
const folio = _assets.map((bal, i) => new utils_1.Decimal(bal.toString()).div(decimalScale[i]).div(supply));
|
|
101
101
|
// {wholeTok/wholeBU} = D27{tok/BU} * {BU/wholeBU} / {tok/wholeTok} / D27
|
|
102
|
-
let weightRanges = rebalance.
|
|
102
|
+
let weightRanges = rebalance.tokens.map((params, i) => {
|
|
103
103
|
return {
|
|
104
|
-
low: new utils_1.Decimal(
|
|
105
|
-
spot: new utils_1.Decimal(
|
|
106
|
-
high: new utils_1.Decimal(
|
|
104
|
+
low: new utils_1.Decimal(params.weight.low.toString()).div(decimalScale[i]).div(numbers_1.D9d),
|
|
105
|
+
spot: new utils_1.Decimal(params.weight.spot.toString()).div(decimalScale[i]).div(numbers_1.D9d),
|
|
106
|
+
high: new utils_1.Decimal(params.weight.high.toString()).div(decimalScale[i]).div(numbers_1.D9d),
|
|
107
107
|
};
|
|
108
108
|
});
|
|
109
|
+
// {wholeTok} = {tok} / {tok/wholeTok}
|
|
110
|
+
const maxAuctionSizes = rebalance.tokens.map((params, i) => new utils_1.Decimal(params.maxAuctionSize.toString()).div(decimalScale[i]));
|
|
109
111
|
const finalStageAt = new utils_1.Decimal(_finalStageAt.toString());
|
|
110
112
|
// ================================================================
|
|
111
113
|
// calculate ideal spot limit, the actual BU<->share ratio
|
|
112
114
|
// {USD/wholeShare} = {wholeTok/wholeShare} * {USD/wholeTok}
|
|
113
115
|
const shareValue = folio
|
|
114
116
|
.map((f, i) => {
|
|
115
|
-
if (!rebalance.
|
|
117
|
+
if (!rebalance.tokens[i].inRebalance) {
|
|
116
118
|
return numbers_1.ZERO;
|
|
117
119
|
}
|
|
118
120
|
return f.mul(prices[i]);
|
|
@@ -121,7 +123,7 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
121
123
|
// {USD/wholeBU} = {wholeTok/wholeBU} * {USD/wholeTok}
|
|
122
124
|
const buValue = weightRanges
|
|
123
125
|
.map((weightRange, i) => {
|
|
124
|
-
if (!rebalance.
|
|
126
|
+
if (!rebalance.tokens[i].inRebalance) {
|
|
125
127
|
return numbers_1.ZERO;
|
|
126
128
|
}
|
|
127
129
|
return weightRange.spot.mul(prices[i]);
|
|
@@ -139,8 +141,8 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
139
141
|
// ================================================================
|
|
140
142
|
// calculate portionBeingEjected
|
|
141
143
|
const ejectionIndices = [];
|
|
142
|
-
for (let i = 0; i < rebalance.
|
|
143
|
-
if (rebalance.
|
|
144
|
+
for (let i = 0; i < rebalance.tokens.length; i++) {
|
|
145
|
+
if (rebalance.tokens[i].inRebalance && rebalance.tokens[i].weight.spot == 0n) {
|
|
144
146
|
ejectionIndices.push(i);
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -161,7 +163,7 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
161
163
|
// {1} = {USD/wholeShare} / {USD/wholeShare}
|
|
162
164
|
const progression = folio
|
|
163
165
|
.map((actualBalance, i) => {
|
|
164
|
-
if (!rebalance.
|
|
166
|
+
if (!rebalance.tokens[i].inRebalance) {
|
|
165
167
|
return numbers_1.ZERO;
|
|
166
168
|
}
|
|
167
169
|
// {wholeTok/wholeShare}
|
|
@@ -175,7 +177,7 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
175
177
|
// {1} = {USD/wholeShare} / {USD/wholeShare}
|
|
176
178
|
let initialProgression = initialFolio
|
|
177
179
|
.map((initialBalance, i) => {
|
|
178
|
-
if (!rebalance.
|
|
180
|
+
if (!rebalance.tokens[i].inRebalance) {
|
|
179
181
|
return numbers_1.ZERO;
|
|
180
182
|
}
|
|
181
183
|
// {wholeTok/wholeShare}
|
|
@@ -270,7 +272,7 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
270
272
|
high: new utils_1.Decimal(newLimits.high.toString()).div(numbers_1.D18d),
|
|
271
273
|
};
|
|
272
274
|
// D27{tok/BU}
|
|
273
|
-
const newWeights = rebalance.
|
|
275
|
+
const newWeights = rebalance.tokens.map((params, i) => {
|
|
274
276
|
// {wholeTok/wholeBU} = {USD/wholeShare} * {1} / {wholeBU/wholeShare} / {USD/wholeTok}
|
|
275
277
|
const idealWeight = shareValue.mul(targetBasket[i]).div(actualLimits.spot).div(prices[i]);
|
|
276
278
|
// D27{tok/BU} = {wholeTok/wholeBU} * D27 * {tok/wholeTok} / {BU/wholeBU}
|
|
@@ -283,7 +285,7 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
283
285
|
high:
|
|
284
286
|
// hold surpluses aside if ejecting
|
|
285
287
|
round == AuctionRound.EJECT
|
|
286
|
-
?
|
|
288
|
+
? params.weight.high
|
|
287
289
|
: (0, numbers_1.bn)(idealWeight
|
|
288
290
|
.mul(idealHighLimit.div(actualLimits.high)) // add the portion of `delta` we failed to propagate through to the high limit
|
|
289
291
|
.mul(numbers_1.D9d)
|
|
@@ -297,23 +299,23 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
297
299
|
newWeightsD27.high = newWeightsD27.spot;
|
|
298
300
|
}
|
|
299
301
|
// enforce in range
|
|
300
|
-
if (newWeightsD27.low <
|
|
301
|
-
newWeightsD27.low =
|
|
302
|
+
if (newWeightsD27.low < params.weight.low) {
|
|
303
|
+
newWeightsD27.low = params.weight.low;
|
|
302
304
|
}
|
|
303
|
-
else if (newWeightsD27.low >
|
|
304
|
-
newWeightsD27.low =
|
|
305
|
+
else if (newWeightsD27.low > params.weight.high) {
|
|
306
|
+
newWeightsD27.low = params.weight.high;
|
|
305
307
|
}
|
|
306
|
-
if (newWeightsD27.spot <
|
|
307
|
-
newWeightsD27.spot =
|
|
308
|
+
if (newWeightsD27.spot < params.weight.low) {
|
|
309
|
+
newWeightsD27.spot = params.weight.low;
|
|
308
310
|
}
|
|
309
|
-
else if (newWeightsD27.spot >
|
|
310
|
-
newWeightsD27.spot =
|
|
311
|
+
else if (newWeightsD27.spot > params.weight.high) {
|
|
312
|
+
newWeightsD27.spot = params.weight.high;
|
|
311
313
|
}
|
|
312
|
-
if (newWeightsD27.high <
|
|
313
|
-
newWeightsD27.high =
|
|
314
|
+
if (newWeightsD27.high < params.weight.low) {
|
|
315
|
+
newWeightsD27.high = params.weight.low;
|
|
314
316
|
}
|
|
315
|
-
else if (newWeightsD27.high >
|
|
316
|
-
newWeightsD27.high =
|
|
317
|
+
else if (newWeightsD27.high > params.weight.high) {
|
|
318
|
+
newWeightsD27.high = params.weight.high;
|
|
317
319
|
}
|
|
318
320
|
return newWeightsD27;
|
|
319
321
|
});
|
|
@@ -323,14 +325,14 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
323
325
|
// ================================================================
|
|
324
326
|
// get new prices, constrained by extremes
|
|
325
327
|
// D27{nanoUSD/tok}
|
|
326
|
-
const newPrices = rebalance.
|
|
328
|
+
const newPrices = rebalance.tokens.map((params, i) => {
|
|
327
329
|
// D27{nanoUSD/tok} = {USD/wholeTok} * {nanoUSD/USD} * D27 / {tok/wholeTok}
|
|
328
330
|
const spotPrice = (0, numbers_1.bn)(prices[i].mul(numbers_1.D9d).mul(numbers_1.D27d).div(decimalScale[i]));
|
|
329
|
-
if (spotPrice <
|
|
330
|
-
throw new Error(`Token ${rebalance.tokens[i]}: spot price ${spotPrice.toString()} out of bounds relative to initial range [${
|
|
331
|
+
if (spotPrice < params.price.low || spotPrice > params.price.high) {
|
|
332
|
+
throw new Error(`Token ${rebalance.tokens[i]}: spot price ${spotPrice.toString()} out of bounds relative to initial range [${params.price.low.toString()}, ${params.price.high.toString()}]! auction launcher MUST closeRebalance to prevent loss!`);
|
|
331
333
|
}
|
|
332
334
|
if (rebalance.priceControl == types_1.PriceControl.NONE) {
|
|
333
|
-
return
|
|
335
|
+
return params.price;
|
|
334
336
|
}
|
|
335
337
|
// D27{nanoUSD/tok} = {USD/wholeTok} * {nanoUSD/USD} * D27 / {tok/wholeTok}
|
|
336
338
|
const pricesD27 = {
|
|
@@ -338,18 +340,18 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
338
340
|
high: (0, numbers_1.bn)(prices[i].div(numbers_1.ONE.sub(priceError[i])).mul(numbers_1.D9d).mul(numbers_1.D27d).div(decimalScale[i])),
|
|
339
341
|
};
|
|
340
342
|
// low
|
|
341
|
-
if (pricesD27.low <
|
|
342
|
-
pricesD27.low =
|
|
343
|
+
if (pricesD27.low < params.price.low) {
|
|
344
|
+
pricesD27.low = params.price.low;
|
|
343
345
|
}
|
|
344
|
-
if (pricesD27.low >
|
|
345
|
-
pricesD27.low =
|
|
346
|
+
if (pricesD27.low > params.price.high) {
|
|
347
|
+
pricesD27.low = params.price.high;
|
|
346
348
|
}
|
|
347
349
|
// high
|
|
348
|
-
if (pricesD27.high <
|
|
349
|
-
pricesD27.high =
|
|
350
|
+
if (pricesD27.high < params.price.low) {
|
|
351
|
+
pricesD27.high = params.price.low;
|
|
350
352
|
}
|
|
351
|
-
if (pricesD27.high >
|
|
352
|
-
pricesD27.high =
|
|
353
|
+
if (pricesD27.high > params.price.high) {
|
|
354
|
+
pricesD27.high = params.price.high;
|
|
353
355
|
}
|
|
354
356
|
if (pricesD27.low == pricesD27.high && priceError[i].gt(numbers_1.ZERO)) {
|
|
355
357
|
throw new Error("no price range");
|
|
@@ -370,11 +372,11 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
370
372
|
const surplusTokenSizes = []; // {USD}
|
|
371
373
|
const deficitTokens = [];
|
|
372
374
|
const deficitTokenSizes = []; // {USD}
|
|
373
|
-
rebalance.tokens.forEach((
|
|
374
|
-
if (!rebalance.
|
|
375
|
+
rebalance.tokens.forEach((params, i) => {
|
|
376
|
+
if (!rebalance.tokens[i].inRebalance) {
|
|
375
377
|
return;
|
|
376
378
|
}
|
|
377
|
-
auctionTokens.push(token);
|
|
379
|
+
auctionTokens.push(params.token);
|
|
378
380
|
auctionWeights.push(newWeights[i]);
|
|
379
381
|
auctionPrices.push(newPrices[i]);
|
|
380
382
|
// {tok} = D27{tok/BU} * D18{BU/share} * {share} / D18 / D27
|
|
@@ -382,21 +384,27 @@ const getOpenAuction = (rebalance, _supply, _initialSupply, _initialAssets = [],
|
|
|
382
384
|
const sellDownTo = (newWeights[i].high * newLimits.high * _supply + (numbers_1.D18n * numbers_1.D27n - 1n)) / numbers_1.D18n / numbers_1.D27n;
|
|
383
385
|
if (_assets[i] < buyUpTo) {
|
|
384
386
|
// {wholeTok} = {tok} / {tok/wholeTok}
|
|
385
|
-
|
|
387
|
+
let deficitAmount = new utils_1.Decimal((buyUpTo - _assets[i]).toString()).div(decimalScale[i]);
|
|
388
|
+
if (deficitAmount.gt(maxAuctionSizes[i])) {
|
|
389
|
+
deficitAmount = maxAuctionSizes[i];
|
|
390
|
+
}
|
|
386
391
|
// {USD} = {wholeTok} * {USD/wholeTok}
|
|
387
392
|
const tokenDeficitValue = deficitAmount.mul(prices[i]);
|
|
388
393
|
if (tokenDeficitValue.gt(numbers_1.EPSILON)) {
|
|
389
|
-
deficitTokens.push(token);
|
|
394
|
+
deficitTokens.push(params.token);
|
|
390
395
|
deficitTokenSizes.push(tokenDeficitValue.toNumber());
|
|
391
396
|
}
|
|
392
397
|
}
|
|
393
398
|
else if (_assets[i] > sellDownTo) {
|
|
394
399
|
// {wholeTok} = {tok} / {tok/wholeTok}
|
|
395
|
-
|
|
400
|
+
let surplusAmount = new utils_1.Decimal((_assets[i] - sellDownTo).toString()).div(decimalScale[i]);
|
|
401
|
+
if (surplusAmount.gt(maxAuctionSizes[i])) {
|
|
402
|
+
surplusAmount = maxAuctionSizes[i];
|
|
403
|
+
}
|
|
396
404
|
// {USD} = {wholeTok} * {USD/wholeTok}
|
|
397
405
|
const tokenSurplusValue = surplusAmount.mul(prices[i]);
|
|
398
406
|
if (tokenSurplusValue.gt(numbers_1.EPSILON)) {
|
|
399
|
-
surplusTokens.push(token);
|
|
407
|
+
surplusTokens.push(params.token);
|
|
400
408
|
surplusTokenSizes.push(tokenSurplusValue.toNumber());
|
|
401
409
|
}
|
|
402
410
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RebalanceLimits, TokenRebalanceParams } from "./types";
|
|
2
2
|
export interface StartRebalanceArgsPartial {
|
|
3
|
-
|
|
4
|
-
prices: PriceRange[];
|
|
3
|
+
tokens: TokenRebalanceParams[];
|
|
5
4
|
limits: RebalanceLimits;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
@@ -17,7 +16,8 @@ export interface StartRebalanceArgsPartial {
|
|
|
17
16
|
* @param _prices {USD/wholeTok} USD prices for each *whole* token
|
|
18
17
|
* @param _priceError {1} Price error per token to use in the rebalance; should be larger than price error during openAuction
|
|
19
18
|
* @param _dtfPrice {USD/wholeShare} DTF price
|
|
19
|
+
* @param _maxAuctionSize {USD} The maximum auction size for each token
|
|
20
20
|
* @param weightControl TRACKING=false, NATIVE=true
|
|
21
21
|
* @param deferWeights Whether to use the full range for weights, only possible for NATIVE DTFs
|
|
22
22
|
*/
|
|
23
|
-
export declare const getStartRebalance: (_supply: bigint, tokens: string[], _assets: bigint[], decimals: bigint[], _targetBasket: bigint[], _prices: number[], _priceError: number[], weightControl: boolean, deferWeights: boolean, debug?: boolean) => StartRebalanceArgsPartial;
|
|
23
|
+
export declare const getStartRebalance: (_supply: bigint, tokens: string[], _assets: bigint[], decimals: bigint[], _targetBasket: bigint[], _prices: number[], _priceError: number[], _maxAuctionSizes: number[], weightControl: boolean, deferWeights: boolean, debug?: boolean) => StartRebalanceArgsPartial;
|
package/dist/start-rebalance.js
CHANGED
|
@@ -16,12 +16,13 @@ const numbers_1 = require("./numbers");
|
|
|
16
16
|
* @param _prices {USD/wholeTok} USD prices for each *whole* token
|
|
17
17
|
* @param _priceError {1} Price error per token to use in the rebalance; should be larger than price error during openAuction
|
|
18
18
|
* @param _dtfPrice {USD/wholeShare} DTF price
|
|
19
|
+
* @param _maxAuctionSize {USD} The maximum auction size for each token
|
|
19
20
|
* @param weightControl TRACKING=false, NATIVE=true
|
|
20
21
|
* @param deferWeights Whether to use the full range for weights, only possible for NATIVE DTFs
|
|
21
22
|
*/
|
|
22
|
-
const getStartRebalance = (_supply, tokens, _assets, decimals, _targetBasket, _prices, _priceError, weightControl, deferWeights, debug) => {
|
|
23
|
+
const getStartRebalance = (_supply, tokens, _assets, decimals, _targetBasket, _prices, _priceError, _maxAuctionSizes, weightControl, deferWeights, debug) => {
|
|
23
24
|
if (debug) {
|
|
24
|
-
console.log("getStartRebalance", _supply, tokens, _assets, decimals, _targetBasket, _prices, _priceError, weightControl, deferWeights);
|
|
25
|
+
console.log("getStartRebalance", _supply, tokens, _assets, decimals, _targetBasket, _prices, _priceError, _maxAuctionSizes, weightControl, deferWeights);
|
|
25
26
|
}
|
|
26
27
|
if (deferWeights && !weightControl) {
|
|
27
28
|
throw new Error("deferWeights is not supported for tracking DTFs");
|
|
@@ -45,6 +46,7 @@ const getStartRebalance = (_supply, tokens, _assets, decimals, _targetBasket, _p
|
|
|
45
46
|
// ================================================================
|
|
46
47
|
const newWeights = [];
|
|
47
48
|
const newPrices = [];
|
|
49
|
+
const maxAuctionSizes = [];
|
|
48
50
|
const maxPriceError = new utils_1.Decimal("0.9");
|
|
49
51
|
for (let i = 0; i < tokens.length; i++) {
|
|
50
52
|
if (priceError[i].gt(maxPriceError)) {
|
|
@@ -110,6 +112,18 @@ const getStartRebalance = (_supply, tokens, _assets, decimals, _targetBasket, _p
|
|
|
110
112
|
low: low,
|
|
111
113
|
high: high,
|
|
112
114
|
});
|
|
115
|
+
// === maxAuctionSizes ===
|
|
116
|
+
// {USD}
|
|
117
|
+
const maxAuctionSize = new utils_1.Decimal(_maxAuctionSizes[i].toString());
|
|
118
|
+
// {tok} = {USD} * {tok/wholeTok} / {USD/wholeTok}
|
|
119
|
+
let maxAuctionSizeTok = (0, numbers_1.bn)(maxAuctionSize.mul(new utils_1.Decimal(`1e${decimals[i]}`)).div(prices[i]));
|
|
120
|
+
if (maxAuctionSizeTok == 0n) {
|
|
121
|
+
throw new Error(`maxAuctionSize for token ${tokens[i]} is 0`);
|
|
122
|
+
}
|
|
123
|
+
if (maxAuctionSizeTok > numbers_1.D256_MAXn) {
|
|
124
|
+
maxAuctionSizeTok = numbers_1.D256_MAXn;
|
|
125
|
+
}
|
|
126
|
+
maxAuctionSizes.push(maxAuctionSizeTok);
|
|
113
127
|
}
|
|
114
128
|
// ================================================================
|
|
115
129
|
// newLimits
|
|
@@ -132,8 +146,13 @@ const getStartRebalance = (_supply, tokens, _assets, decimals, _targetBasket, _p
|
|
|
132
146
|
console.log("newLimits", newLimits);
|
|
133
147
|
}
|
|
134
148
|
return {
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
tokens: tokens.map((token, i) => ({
|
|
150
|
+
token: token,
|
|
151
|
+
weight: newWeights[i],
|
|
152
|
+
price: newPrices[i],
|
|
153
|
+
maxAuctionSize: maxAuctionSizes[i],
|
|
154
|
+
inRebalance: true,
|
|
155
|
+
})),
|
|
137
156
|
limits: newLimits,
|
|
138
157
|
};
|
|
139
158
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -17,17 +17,24 @@ export interface PriceRange {
|
|
|
17
17
|
low: bigint;
|
|
18
18
|
high: bigint;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
inRebalance: boolean
|
|
26
|
-
|
|
20
|
+
export interface TokenRebalanceParams {
|
|
21
|
+
token: string;
|
|
22
|
+
weight: WeightRange;
|
|
23
|
+
price: PriceRange;
|
|
24
|
+
maxAuctionSize: bigint;
|
|
25
|
+
inRebalance: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface RebalanceTimestamps {
|
|
27
28
|
startedAt: bigint;
|
|
28
29
|
restrictedUntil: bigint;
|
|
29
30
|
availableUntil: bigint;
|
|
31
|
+
}
|
|
32
|
+
export interface Rebalance {
|
|
33
|
+
nonce: bigint;
|
|
30
34
|
priceControl: PriceControl;
|
|
35
|
+
tokens: TokenRebalanceParams[];
|
|
36
|
+
limits: RebalanceLimits;
|
|
37
|
+
timestamps: RebalanceTimestamps;
|
|
31
38
|
}
|
|
32
39
|
export interface Folio {
|
|
33
40
|
name: string;
|