  In this article we consider combinatorial markets with valuations only for
singletons and pairs of buy/sell-orders for swapping two items in equal
quantity. We provide an algorithm that permits polynomial time market-clearing
and -pricing. The results are presented in the context of our main application:
the futures opening auction problem.
  Futures contracts are an important tool to mitigate market risk and
counterparty credit risk. In futures markets these contracts can be traded with
varying expiration dates and underlyings. A common hedging strategy is to roll
positions forward into the next expiration date, however this strategy comes
with significant operational risk. To address this risk, exchanges started to
offer so-called futures contract combinations, which allow the traders for
swapping two futures contracts with different expiration dates or for swapping
two futures contracts with different underlyings. In theory, the price is in
both cases the difference of the two involved futures contracts. However, in
particular in the opening auctions price inefficiencies often occur due to
suboptimal clearing, leading to potential arbitrage opportunities.
  We present a minimum cost flow formulation of the futures opening auction
problem that guarantees consistent prices. The core ideas are to model orders
as arcs in a network, to enforce the equilibrium conditions with the help of
two hierarchical objectives, and to combine these objectives into a single
weighted objective while preserving the price information of dual optimal
solutions. The resulting optimization problem can be solved in polynomial time
and computational tests establish an empirical performance suitable for
production environments.
