diff --git a/contracts/orderbook/src/order.rs b/contracts/orderbook/src/order.rs index 4bf72af..afb2a10 100644 --- a/contracts/orderbook/src/order.rs +++ b/contracts/orderbook/src/order.rs @@ -44,12 +44,13 @@ pub fn place_limit( // Verify the funds sent with the message match the `quantity` for the correct denom // We reject any quantity that is not exactly equal to the amount in the limit order being placed let received = must_pay(&info, &expected_denom)?; + let expected_amount = amount_to_value(order_direction, quantity, tick_to_price(tick_id)?)?; ensure_eq!( received, - quantity, + expected_amount, ContractError::InsufficientFunds { sent: received, - required: quantity, + required: expected_amount, } );