fixed liquidator bug
This commit is contained in:
parent
948da75f57
commit
09e4b9871b
3
crank.sh
3
crank.sh
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue