Skip to content

Commit

Permalink
fix: only round if next swap is sell
Browse files Browse the repository at this point in the history
  • Loading branch information
gorgos committed Aug 21, 2023
1 parent b74a1da commit 1c6368d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contracts/swap/src/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,14 @@ pub fn handle_atomic_order_reply(
.query_spot_market(&next_market_id)?
.market
.expect("market should be available");
round_to_min_tick(new_quantity, next_market.min_quantity_tick_size)

let is_next_swap_sell = next_market.base_denom == current_step.step_target_denom;

if is_next_swap_sell {
round_to_min_tick(new_quantity, next_market.min_quantity_tick_size)
} else {
new_quantity
}
} else {
new_quantity
};
Expand Down

0 comments on commit 1c6368d

Please sign in to comment.