Skip to content

Commit

Permalink
Consistent behavior on floatingMaker order canceling
Browse files Browse the repository at this point in the history
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 drift-labs#66.
  • Loading branch information
ricardojmendez committed Sep 5, 2023
1 parent 6d08ea5 commit 725561c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/bots/floatingMaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 725561c

Please sign in to comment.