fixed loop bug
This commit is contained in:
parent
e1b15ce01e
commit
884134f647
|
@ -172,7 +172,7 @@ async function runLiquidator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (liabsVal < 0.1) { // too small of an account; number precision may cause errors
|
if (liabsVal < 0.1) { // too small of an account; number precision may cause errors
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
let collRatio = (assetsVal / liabsVal)
|
let collRatio = (assetsVal / liabsVal)
|
||||||
|
|
||||||
|
@ -181,14 +181,14 @@ async function runLiquidator() {
|
||||||
collRatio += parseFloat(process.env.COLL_BIAS);
|
collRatio += parseFloat(process.env.COLL_BIAS);
|
||||||
}
|
}
|
||||||
if (collRatio >= mangoGroup.maintCollRatio) {
|
if (collRatio >= mangoGroup.maintCollRatio) {
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
const deficit = liabsVal * mangoGroup.initCollRatio - assetsVal
|
const deficit = liabsVal * mangoGroup.initCollRatio - assetsVal
|
||||||
description = ma.toPrettyString(mangoGroup, prices)
|
description = ma.toPrettyString(mangoGroup, prices)
|
||||||
|
|
||||||
if (deficit < 0.1) { // too small of an account; number precision may cause errors
|
if (deficit < 0.1) { // too small of an account; number precision may cause errors
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
console.log('liquidatable', deficit)
|
console.log('liquidatable', deficit)
|
||||||
console.log(description)
|
console.log(description)
|
||||||
|
|
|
@ -216,18 +216,18 @@ async function runPartialLiquidator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (liabsVal < 0.1) { // too small of an account; number precision may cause errors
|
if (liabsVal < 0.1) { // too small of an account; number precision may cause errors
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ma.beingLiquidated) {
|
if (!ma.beingLiquidated) {
|
||||||
let collRatio = (assetsVal / liabsVal)
|
let collRatio = (assetsVal / liabsVal)
|
||||||
if (collRatio + coll_bias >= mangoGroup.maintCollRatio) {
|
if (collRatio + coll_bias >= mangoGroup.maintCollRatio) {
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
const deficit = liabsVal * mangoGroup.initCollRatio - assetsVal
|
const deficit = liabsVal * mangoGroup.initCollRatio - assetsVal
|
||||||
if (deficit < 0.1) { // too small of an account; number precision may cause errors
|
if (deficit < 0.1) { // too small of an account; number precision may cause errors
|
||||||
break
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
description = ma.toPrettyString(mangoGroup, prices)
|
description = ma.toPrettyString(mangoGroup, prices)
|
||||||
|
|
Loading…
Reference in New Issue