We have investigated the use of objective functions in the complex-commodity exchange, which allow a trader to specify price constraints and preferences among potential trades. We explain the representation of orders with price and preference constraints, and describe a technique for fast identification of most preferable trades, which maximize the satisfaction of market participants. We give an empirical evaluation of the implemented system, which shows that the system scales to markets with 300,000 orders and usually processes 100 to 1,000 new orders per second.