Skip to content

Commit

Permalink
fix: dont place negative orders
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Sep 27, 2024
1 parent 7b3176b commit ed5a955
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chainflip-lp/Model/OrderManager/PlaceBuyOrders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ private async Task PlaceBuyOrders(
if (remainingBalance <= 0)
continue;

if (pool.Difference <= 0)
continue;

if (pool.Difference < remainingBalance)
{
// Fill up the pool, subtract from remainingBalance and carry on
Expand Down Expand Up @@ -129,6 +132,8 @@ await NotifyTelegram(
$"Placed {pool.Pool.Asset}/{pool.Pool.Chain} buy order for {remainingBalance.ToString(Constants.DollarString)} USDC",
true,
cancellationToken);

remainingBalance = 0;
}
}
}
Expand Down

0 comments on commit ed5a955

Please sign in to comment.