From 771522f997f6dfc8476997f3c6981856e91f2d22 Mon Sep 17 00:00:00 2001 From: Serge Farny Date: Sat, 4 May 2024 20:26:13 +0200 Subject: [PATCH] Liquidator: do not try to settle/close open orders when not using limit orders for rebalancing --- bin/liquidator/src/rebalance.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/liquidator/src/rebalance.rs b/bin/liquidator/src/rebalance.rs index 64ddf4a12..928c97f14 100644 --- a/bin/liquidator/src/rebalance.rs +++ b/bin/liquidator/src/rebalance.rs @@ -449,7 +449,9 @@ impl Rebalancer { } async fn rebalance_tokens(&self) -> anyhow::Result<()> { - self.close_and_settle_all_openbook_orders().await?; + if self.config.use_limit_order { + self.close_and_settle_all_openbook_orders().await?; + } let account = self.mango_account()?; // TODO: configurable?