fixed liquidator bug
This commit is contained in:
parent
948da75f57
commit
09e4b9871b
3
crank.sh
3
crank.sh
|
@ -37,5 +37,4 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd ~/blockworks-foundation/serum-dex/dex/crank || exit
|
pushd ~/blockworks-foundation/serum-dex/dex/crank || exit
|
||||||
cargo run -- $CLUSTER consume-events --dex-program-id $DEX_PROGRAM_ID --payer $KEYPAIR --market $MARKET --coin-wallet $BASE_WALLET --pc-wallet $QUOTE_WALLET --num-workers 1 --events-per-worker 5 --log-directory .
|
cargo run -- $CLUSTER consume-events --dex-program-id $DEX_PROGRAM_ID --payer $KEYPAIR --market $MARKET --coin-wallet $BASE_WALLET --pc-wallet $QUOTE_WALLET --num-workers 1 --events-per-worker 5 --log-directory . || popd
|
||||||
popd
|
|
||||||
|
|
|
@ -186,7 +186,6 @@ async function runLiquidator() {
|
||||||
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
|
break
|
||||||
}
|
}
|
||||||
|
@ -194,7 +193,7 @@ async function runLiquidator() {
|
||||||
console.log(description)
|
console.log(description)
|
||||||
|
|
||||||
await client.liquidate(connection, programId, mangoGroup, ma, payer,
|
await client.liquidate(connection, programId, mangoGroup, ma, payer,
|
||||||
tokenWallets, [0, 0, deficit * 1.01])
|
tokenWallets, [0, 0, deficit * 1.01 + 5])
|
||||||
liquidated = true
|
liquidated = true
|
||||||
break
|
break
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue