We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6eb0431 + 25d79fa commit cd637d0Copy full SHA for cd637d0
contracts/sumtree-orderbook/src/order.rs
@@ -557,6 +557,14 @@ pub(crate) fn run_market_order_internal(
557
tick_price,
558
RoundingDirection::Up,
559
)?;
560
+
561
+ ensure!(
562
+ !input_filled.is_zero(),
563
+ ContractError::InvalidSwap {
564
+ error: "Input amount for a given swap step cannot be zero".to_string()
565
+ }
566
+ );
567
568
order.quantity = order
569
.quantity
570
// Safe conversions as amount filled should never be larger than order quantity which is upper bounded by Uint128::MAX
0 commit comments