Skip to content

Commit

Permalink
Merge branch 'main' into alpo/fix-price
Browse files Browse the repository at this point in the history
  • Loading branch information
crnbarr93 committed Jul 3, 2024
2 parents 2a1178f + cd637d0 commit 74337a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/sumtree-orderbook/src/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,14 @@ pub(crate) fn run_market_order_internal(
tick_price,
RoundingDirection::Up,
)?;

ensure!(
!input_filled.is_zero(),
ContractError::InvalidSwap {
error: "Input amount for a given swap step cannot be zero".to_string()
}
);

order.quantity = order
.quantity
// Safe conversions as amount filled should never be larger than order quantity which is upper bounded by Uint128::MAX
Expand Down

0 comments on commit 74337a7

Please sign in to comment.