From 725561c1121bfd575bcd961b74ecd9dfffcff983 Mon Sep 17 00:00:00 2001 From: "Ricardo J. Mendez" Date: Tue, 5 Sep 2023 08:56:47 +0200 Subject: [PATCH] Consistent behavior on floatingMaker order canceling The bot was canceling existing orders when one side had been fully filled, *except* for SOL-PERP, in which case it always canceled them even if they were partially filled. This had the effect that a SOL_PERP position grew rapidly unbalanced, regardless of how much the market was moving. See issue #66. --- src/bots/floatingMaker.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bots/floatingMaker.ts b/src/bots/floatingMaker.ts index 67bbb9df..e68ee4dc 100644 --- a/src/bots/floatingMaker.ts +++ b/src/bots/floatingMaker.ts @@ -326,10 +326,7 @@ export class FloatingPerpMakerBot implements Bot { // cancel orders if not quoting both sides of the market let placeNewOrders = openOrders.length === 0; - if ( - (openOrders.length > 0 && openOrders.length != 2) || - marketIndex === 0 - ) { + if (openOrders.length > 0 && openOrders.length != 2) { // cancel orders try { await Promise.all(