naive implementation of orderbook resolving code