fixed liquidator bug

This commit is contained in:
dd 2021-04-05 14:11:23 -04:00
parent 948da75f57
commit 09e4b9871b
2 changed files with 2 additions and 4 deletions

View File

@ -37,5 +37,4 @@ else
fi
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 .
popd
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

View File

@ -186,7 +186,6 @@ async function runLiquidator() {
const deficit = liabsVal * mangoGroup.initCollRatio - assetsVal
description = ma.toPrettyString(mangoGroup, prices)
if (deficit < 0.1) { // too small of an account; number precision may cause errors
break
}
@ -194,7 +193,7 @@ async function runLiquidator() {
console.log(description)
await client.liquidate(connection, programId, mangoGroup, ma, payer,
tokenWallets, [0, 0, deficit * 1.01])
tokenWallets, [0, 0, deficit * 1.01 + 5])
liquidated = true
break
} catch (e) {