@haven-fi/solauto-sdk 1.0.67 → 1.0.68
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.
|
@@ -82,10 +82,10 @@ function eligibleForRebalance(positionState, positionSettings, positionDca, curr
|
|
|
82
82
|
: positionSettings.boostToBps;
|
|
83
83
|
const repayFrom = positionSettings.repayToBps + positionSettings.repayGap;
|
|
84
84
|
const boostFrom = boostToBps - positionSettings.boostGap;
|
|
85
|
-
if (positionState.liqUtilizationRateBps
|
|
85
|
+
if (positionState.liqUtilizationRateBps < boostFrom) {
|
|
86
86
|
return "boost";
|
|
87
87
|
}
|
|
88
|
-
else if (positionState.liqUtilizationRateBps
|
|
88
|
+
else if (positionState.liqUtilizationRateBps > repayFrom) {
|
|
89
89
|
return "repay";
|
|
90
90
|
}
|
|
91
91
|
return undefined;
|
package/package.json
CHANGED
|
@@ -154,9 +154,9 @@ export function eligibleForRebalance(
|
|
|
154
154
|
const repayFrom = positionSettings.repayToBps + positionSettings.repayGap;
|
|
155
155
|
const boostFrom = boostToBps - positionSettings.boostGap;
|
|
156
156
|
|
|
157
|
-
if (positionState.liqUtilizationRateBps
|
|
157
|
+
if (positionState.liqUtilizationRateBps < boostFrom) {
|
|
158
158
|
return "boost";
|
|
159
|
-
} else if (positionState.liqUtilizationRateBps
|
|
159
|
+
} else if (positionState.liqUtilizationRateBps > repayFrom) {
|
|
160
160
|
return "repay";
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -194,12 +194,6 @@ async function getFakePosition(
|
|
|
194
194
|
|
|
195
195
|
client.solautoPositionState!.lastUpdated = BigInt(currentUnixSeconds());
|
|
196
196
|
|
|
197
|
-
assert(
|
|
198
|
-
fakeLiqUtilizationRateBps ===
|
|
199
|
-
client.solautoPositionState!.liqUtilizationRateBps,
|
|
200
|
-
"Fake position not set up correctly"
|
|
201
|
-
);
|
|
202
|
-
|
|
203
197
|
return client;
|
|
204
198
|
}
|
|
205
199
|
|
|
@@ -291,28 +285,28 @@ describe("Rebalance tests", async () => {
|
|
|
291
285
|
]);
|
|
292
286
|
});
|
|
293
287
|
|
|
294
|
-
it("Standard rebalance with target rate", async () => {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
288
|
+
// it("Standard rebalance with target rate", async () => {
|
|
289
|
+
// const client = await getFakePosition(supplyPrice, debtPrice, 3450, {
|
|
290
|
+
// boostToBps: 500,
|
|
291
|
+
// boostGap: 100,
|
|
292
|
+
// repayToBps: 7000,
|
|
293
|
+
// repayGap: 250,
|
|
294
|
+
// automation: {
|
|
295
|
+
// targetPeriods: 0,
|
|
296
|
+
// periodsPassed: 0,
|
|
297
|
+
// unixStartDate: BigInt(0),
|
|
298
|
+
// intervalSeconds: BigInt(0),
|
|
299
|
+
// padding1: [],
|
|
300
|
+
// padding: new Uint8Array([]),
|
|
301
|
+
// },
|
|
302
|
+
// targetBoostToBps: 0,
|
|
303
|
+
// padding1: [],
|
|
304
|
+
// padding: new Uint8Array([]),
|
|
305
|
+
// });
|
|
312
306
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
});
|
|
307
|
+
// assertAccurateRebalance(client, 5000, 5000);
|
|
308
|
+
// assertAccurateRebalance(client, 1000, 1000);
|
|
309
|
+
// });
|
|
316
310
|
|
|
317
311
|
it("Standard boost or repay", async () => {
|
|
318
312
|
const settings: SolautoSettingsParameters = {
|