Fix bug in porting from rust to ts
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
2cd8c048f3
commit
f781241f90
|
@ -553,7 +553,7 @@ export class HealthCache {
|
||||||
target: I80F48,
|
target: I80F48,
|
||||||
fun: (amount: I80F48) => I80F48,
|
fun: (amount: I80F48) => I80F48,
|
||||||
): I80F48 {
|
): I80F48 {
|
||||||
const maxIterations = 100;
|
const maxIterations = 20;
|
||||||
let current = start;
|
let current = start;
|
||||||
// console.log(`scanRightUntilLessThan, start ${start.toLocaleString()}`);
|
// console.log(`scanRightUntilLessThan, start ${start.toLocaleString()}`);
|
||||||
for (const key of Array(maxIterations).fill(0).keys()) {
|
for (const key of Array(maxIterations).fill(0).keys()) {
|
||||||
|
@ -745,7 +745,7 @@ export class HealthCache {
|
||||||
return ZERO_I80F48();
|
return ZERO_I80F48();
|
||||||
}
|
}
|
||||||
const zeroHealthEstimate = point1Amount.sub(
|
const zeroHealthEstimate = point1Amount.sub(
|
||||||
point1Health.sub(finalHealthSlope),
|
point1Health.div(finalHealthSlope),
|
||||||
);
|
);
|
||||||
const zeroHealthEstimateRatio = healthRatioAfterSwap(zeroHealthEstimate);
|
const zeroHealthEstimateRatio = healthRatioAfterSwap(zeroHealthEstimate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue