COMBINATION TRADING WITH LIMIT ORDERS

We model the exchange of commodities that are contingent upon each other, when traders place mostly limit orders. Examples include: 1) a market of financial futures where future spreads are also traded, 2) a market of mutual funds and stocks, 3) a market of options and stocks, under the viewpoint that they are both combinations of Arrow-Debreu securities. We prove that consistent prices are optimal. We develop a fixed-point algorithm to compute an optimal price and allocation. The algorithm combines ideas from contraction mapping theory and from homotopy theory. It is much faster than a traditional linear programming approach.


Introduction
Due to the progress of automation, options and futures exchanges have recently expanded the possibility to trade various combinations of primitive nancial instruments.Among others, the Chicago Mercantile Exchange, the German and the Swiss options and futures exchanges all o er standardized future time spreads contracts, where a potential buyer buys one leg (the future with early expiration) and sells the other (the future with later expiration) at the same time and delivers or receives money for this trade.This is only one example of combination trading.More generally, a combination can be described in terms of the coe cients of primitive instruments it includes.For example, the coe cient of a future time spread as above or of a s w ap would be 1 ;1]: A m utual fund is a combination with only positive b u t m a ybe fractional coe cients.Options are themselves combinations, where the primitive instruments are Arrow-Debreu securities.
We focus on double auction markets, where buyers and sellers place limit orders, i.e., orders for a predetermined quantity at a predetermined price.As in markets without combinations, our model allows for a certain quantity of market orders.Currently, options and futures exchanges are primarily auction markets.We do not discuss the relative merits of dealer markets compared to continuous or batched auctions.This question is still an open issue in the literature.Among others, 7] reports that batched auctions are more robust mechanisms, and therefore may b e y Correspondence to: Henry Schellhorn, 525 N. Gardner Avenue, Los Angeles, CA 90036, USA.
preferable in very illiquid markets.A continuous auction mechanism involving combinations, also called synthetics is described in 8].
Combinations are especially useful in auction markets because of the liquidity risk inherent to auctions.For instance, a trader holding a Swiss Franc future contract expiring in June may suddenly want t o s w ap it against the same contract expiring in July.The reason why he would prefer to place a combination order than two independent orders is that he much prefers his current position to either a null position due to a successful sale and the absence of counterparty that would sell the July contract or a \doubled position" due to the absence of a counterparty t h a t w ould buy the June contract.
Combination trading can be seen as a practical compromise between the classical tatonnement process and the so-called "equilibrium process", introduced by Beja and Hakansson in 1], where "all traders ..] submit ..] a complete speci cation of tentative orders for all possible prices".An equilibrium process gives traders greater exibility.However, according to the same authors, "the (implicit) cost of placing orders makes these requirements prohibitively expensive".Wohl 11] criticizes most existing markets where "an order in one security cannot be conditioned on prices of other securities", and describes a mechanism that implements a simplied equilibrium process, where an order in one security is conditioned on the prices of the same security and of an index.
A simple strategy allows traders to implement W ohl's conditioned orders 1 in a combination trading exchange.The main advantages of the "combination trading" approach to implement the conditioned orders over the approach described in 11] are that traders can condition their orders on all other securities and that the equilibrium is realized in discrete prices.We h a ve also been able to verify 9] that, like in 11], our analysis applies to more general types of limit orders than described in section 2.
The main purpose of this paper is to examine how the traders' orders for combinations can be matched optimally with each other and with other traders' orders for primitive instruments.The role of the exchange institution is to provide a discrete price vector and an allocation that maximizes the utilitarian social welfare functional.We s h o w that this problem reduces to solving the so-called market balance problem, in which commodity prices are consistent.The proof of consistency relies on standard duality t e c hniques it has been a subject in literature before (e.g.10]) for a simple market without combinations.
We suggest two di erent algorithms to solve the market balance problem and compare them against the only possible method to solve t h e c o m bination trading problem, namely linear programming.Although special instances of combination trading can be formulated as a network ow problem of a manageable size, the general problem cannot.
When there is a large number of orders, the aggregate demand and supply look almost continuous, and it is easy to see that the market balance problem becomes almost a xed-point problem.Khilnani and Tse ( 5], 6]) reported that a contraction mapping algorithm can be used to solve a certain class of economic equilibrium problems.We show that combination trading belongs to this class of problems.We use the contraction mapping algorithm to obtain a nearly-optimal solution, where the price is not rounded.
We show how to obtain the optimal solution with a discrete price by solving a di erent xed-point problem, namely a Kakutani xed-point problem.Eaves ( 3], 4]) reports an algorithm to solve Kakutani xed-point problems which i s b a s e d on path-following (homotopy).We implemented this algorithm.
Depending on the size of the problem, we recommend to solve market balance problems by applying in a rst step the contraction mapping algorithm to obtain a nearly-optimal solution, and from there on by applying the path-following algorithm.This combined algorithm is much faster than the traditional linear programming approach, because the numberofvariables is much reduced: we aggregate all traders' limit quantities into demand and supply functions.
Exchange institutions compete against each other to attract trading volume, since some of them o er the same contracts.A critical feature of an exchange is to open the market very quickly at the beginning of the trading day, or after a trading halt.It is therefore important for an exchange to use a fast algorithm like o u r s .

Model
Notation: the sets N Z Q Rare respectively the sets of nonnegative i n tegers, integers, rational, and real numbers.The R n vector e is the vector of ones.In the special case when each i-th component of the value of a R m !R m function f depends on the i-th component x i of a variable x, w e use the notation f(x) for the vector value, and f i (x i ) for the component v alue.We write v i ] for the integral part of a real positive n umberv i .When v i is negative, v i ] is the largest integer smaller than or equal to v i .Finally, w e write v] f o r a v ector with integral components v i ].
In our model, traders place limit orders on an exchange, with a limit price, and a limit quantity.The exchange then sets a market price for each commodity, and allocates realized quantities to buyers and sellers against cash.Partial matching is allowed, meaning that buyers can receive a n y q u a n tity up to the limit quantity, provided that the market price is not higher than their bids, and similarly for the sellers.
There are two kinds of commodities: primitive commodities, and combinations.Combinations are de ned in terms of the quantity o f e a c h primitive commodity a combination buyer receives or delivers after his combination order is executed.We have m primitive commodities and n ; m combinations.Each commodity i = 1 ::n is therefore de ned by a Q m vector a i , which represents the coe cients of each primitive commodity.
We collect the coe cient vectors of the combinations in an Z m (n;m) matrix A N = ( a m+1 a m+2 :: a n ) 2 , and de ne the matrix A = ( I A N ).
All traders have a linear utility function.We assume without loss of generality that each trader places only one order.
We can analyze traded quantities at three levels of trade aggregation.At the lowest level, we k eep track o f e a c h deal between the traders.At the middle level, we aggregate each deal a trader took part in into his allocation.At the highest level, we group all traders with the same limit prices.We rst present the middle level of trade aggregation, and then the highest.The lowest level will be needed only to prove theorem 1.

Middle level of trade aggregation
On each commodity i, we have N b (i) buyers and N s (i) sellers.Each buyer b = 1::N b (i) of commodity i places a limit order with limit price (i b) 2 Z, and limit quantity q b (i b) 2 N. Similarly, each seller s = 1::N s (i) of commodity i places a limit order with limit price (s i) 2 Z, and limit quantity q s (i s) 2 N. The exchange institution then selects a price vector p 2 Z n and an allocation z b (i b) 0 for each b u y er and z s (i s) 0 for each seller.The value of the utility functions of the buyers and the sellers after trading will be: U s (i s) = ( (i s) ; p i )z s (i s) (2) The limit price constraints are, for all buyers and sellers: The limit quantity constraints are, for all buyers and sellers: The market clearing equations express the fact that combination orders can be matched against orders for primitive commodities: s=1 z s (1 s ) :: COMBINATION TRADING WITH LIMIT ORDERS 137

Highest level of trade aggregation
To determine the optimal price, we will see that the exchange institution needs only consider two Z n !N n functions: the aggregate demand F b and the aggregate supply F s .For each commodity i, a n d y i 2 Z, w e h a ve: , w h e r e 1(A) is the indicator function, i.e., it takes value 0 when A is false, and 1 w h e n A is true.We de ne y ; i y + i ] as the smallest interval that contains all buy and sell limit prices for commodity i, i.e., where the aggregate demand and supply vary.
In a similar fashion, we also aggregate the allocation into two Z n !N n functions: the aggregate buy quantity f b , and the aggregate sell quantity f s .For each commodity i, w e h a ve: In order to simplify the notation, we also de ne the allocated quantity for all traders that have the same limit price y i :

The combination trading problem
The objective of the exchange institution is to maximize the utilitarian social welfare functional z, i.e., the sum of the pro ts of all traders.Obviously the results of this paper would still apply if the exchange institution chose a di erent s o c i a l w elfare functional.The decision variables of the exchange institution are the allocation f b (y) f s (y), and the (integer) price p.The combination trading problem is: where Y is a bounded set of all integer prices where the solution lies.
Relations (15) to (18) are implied by the limit quantity constraints ( 5) and ( 6).We will verify later that actually the solution to this model respects the limit quantity constraints, therefore it is not necessary to include these constraints in the formulation of the combination trading problem.
Relation ( 22) is a no-arbitrage relation.It states that the prices should be consistent 4 , i.e., that the prices of the combinations should be a combination of the price of the primitive commodities p B .For instance, if the price of a future S&P500 expiration July is $25, and the price of a future S&P500 expiration June is $20, then the optimal price of the spread should be $5.Relation ( 23) is a simple consequence of price-consistency.
Inequalities ( 24) and (25) tell us that, for any commodity, all buyers (sellers) with a limit price strictly greater than (smaller than) the optimal price set by the exchange are allocated their entire limit quantity.The same property is a very well-known fact in simple markets without combinations.

Algorithm
Notation: for simplicity, w e n o w write p for the price of the primitive commodities instead of p B .We p r o vide an algorithm to solve the market balance problem de ned in the last section.From now, we call the latter discrete (MB) problem, because the aggregate demand/supply is discrete.If there is a very large number of traders, and if we relax the integrality constraint o n the limit prices, the aggregate demand/supply functions look almost continuous, and the discrete market balance problem is almost similar to the following continuous (MB) problem: An idea is therefore to approximate the discrete aggregate demand/ supply functions by a continuous function, solve the continuous (MB) problem to obtain an approximate real-valued solution p r , and then search the exact solution p in a neighborhood of p r .We need therefore two algorithms, the continuous algorithm, and the discrete algorithm.

Continuous algorithm
For notational convenience we de ne the net demand function G(y) = F b (y) ; F s (y).
Let G(y) be replaced by a piecewise linear function G r (y), such that G r i (y i ) is strictly decreasing on y ; i y + i ].We de ne G r i (y i ) recursively in the interval (y ; i y + i ), starting from y ; i , w i t h G r i (y ; i ) = F b i (y ; i ) ; F s i (y ; i ).If F b i ( y i ] + 1 ) ; F s i ( y i ] + 1 ) < F b i ( y i ]) ; F s i ( y i ]): G r i (y i ) = (1 ; y i + y i ])G r i ( y i ]) + (y i ; y i ])(F b i ( y i ] + 1 ) ; F s i ( y i ] + 1)) y i ] y i y i ] + 1 Otherwise let z] be the maximal value of t > y i ] + 1 so that F b i (t) ; Outside (y ; i y + i ), we de ne G r i di erently if i is a primitive commodity or a combination.We i n troduce the superscripts B as a mnemonic for primitive commodities (\basis"), and N as a mnemonic for combinations (\nonbasis").We rede ne the inverse of G B r and G N r as: G ;B r i (q i ) = y ; The continuous (MB) model is tantamount to nding the xed point of (p), de ned as: (p) = G ;B r (;A N G N r (pA N )) (28) By de nition, a function (p) is antitonic if, for any p 1 p 2 we have ( (p 1 ) ; (p 2 ))(p 1 ; p 2 ) 0. Khilnani and Tse 5] report an algorithm that nds the xed point of , provided that is antitonic and Lipschitz continuous, with Lipschitz constant .THEOREM 2 If < 2 1+ 2 , the xed point o f can be found by iterating p k+1 = (p k ), where (p) = ( 1 ; )p + (p).The initial value p 0 is arbitrary.PROOF (p) i s a n titonic because G ;B r and G N r are decreasing.The rest of the proof goes along the lines of 5].
Note that this theorem guarantees the unicity of the solution of the continuous (MB) problem, which in turns shows that the domain of the prices that solve the discrete (MB) problem is bounded and connected.

Discrete algorithm
In this section we show that the xed point of a set-valued function F (to be de ned later) is the solution of the discrete (MB) balance problem.We u s e t h e E a ves-Saigal algorithm to compute the xed point o f F. Our discrete algorithm consists therefore of carefully de ning F and then applying the Eaves-Saigal algorithm.

The set-valued function F
Let C be the smallest parallelepiped that contains Y B .We call its maximal and minimal elements p + and p ; .The value of our set-valued function F : C ) C is the set fp 2 R m j(p : : : :) s o l v es P 1 (p)g, where P 1 (p) is a linear program that we de ne hereafter.It can be easily seen that F is convex-valued, and closed (by Berge's maximum theorem).Before de ning the linear program P 1 (p), we f o r m ulate the market balance problem slightly di erently, using piecewise-linear demand and supply functions instead of discrete ones.We need the following de nitions: y i ] + 2 3 y i y i ] + 1 F s 0 i (y i ) = F s i ( y i ]) y i ] + 1 3 y i y i ] + 1 F s 0 i (y i ) = F s i ( y i ] ; 1) + 3(y i ; y i ] + 13 )(F s i ( y i ]) ; F s i ( y i ] ; 1)) y i ] y i y i ] + 1

D b
ii (y i ) = 3(y i ; y i ]) ii (y i ) = 3( y i ] + 1 ; y i ) (F s 0 i ( y i ] ; 1) ; F s 0 i (y i )) y i ] + 2 3 y i y i ] + 1 The non-diagonal elements of D s and D b are set to zero.
LEMMA Let (f b f s p 2 R m ) be a solution of the following modi ed market balance problem: f s = F s 0 (A T p) + D s (A T p) s We n o w de ne the linear program P 1 (p): The R n vectors f b and f s are any strictly positive v ectors such that A(f b ;f s ) = 0. Obviously, f b = f s = e would respect these conditions.The R n !R n n (matrix) functions B b and B s have strictly positive and diagonal values.They can be carefully chosen so as to obtain better algorithmic performance.The Eaves-Saigal algorithm is much quicker if the initial simplex is small and contains the solution, which imposes constraints on the choice of v k (the n + 1 v ertices of the initial simplex), B b and B s .
The vertices v k of the initial simplex are chosen so that: ,where again p r is the solution of the continuous market balance problem.For all vertices v k of the initial simplex we s e t Eaves-Saigal is a \multidimensional bisection algorithm".It starts from the full feasible domain as the initial simplex, subdivides it into subsimplices, chooses a subsimplex as the incumbent simplex (in such a way that the incumbent always contains the solution), and goes on subdividing until the incumbent simplex is small enough.
In the non-degenenerate case, a simplex contains the solution if its vertex set is completely labeled, i.e., for all vertices v k and any y k 2 F (v k ): It is a remarkable fact that, if the algorithm takes care of degeneracy appropriately and starts from a completely labeled simplex of which no facet is completely labeled, then there always is a completely labeled subsimplex regardless of the subdivision.
The discrete market balance problem is particularly well suited to the Eaves-Saigal algorithm: by construction of F, more precisely of B, the initial simplex can be chosen much smaller than the smallest simplex containing C. the incumbent simplex does not need to be very small for the algorithm to terminate: it only needs to t within the m-dimensional grid of integral prices to contain the solution of the market balance problem.
Therefore, the number of iterations between the initial and the terminal simplex will be small.1.6 p r = p r k c hoose f b f s > 0 s o t h a t f b ; f s = G r (A T p r ) 2 Homotopy 2.1 select an initial simplex with vertices v k such t h a t F b 0 i (a i v k ) ; f b a i v k ; a i p r > 0 and F s 0 i (a i v k ) ; f s a i v k ; a i p r < 0 2.2 apply Eaves-Saigal algorithm on F until the incumbent simplex ts in a unit simplex 2.3 the solution p] is the highest price so that p] y 8y 2 .

Complexity
The only method that our (MB) model and algorithm can be compared to is the plain linear (PL) program de ned in the appendix, which s o l v es the combination trading problem at the lowest level of trade aggregation.Except in some very special cases, combination trading cannot be transformed into a small network ow problem.
Both methods are nonpolynomial, because they both rely on the simplex algorithm.However, the (MB) algorithm can be solved on average much quicker.To see that, we use the common approximation that the average number of iterations of the primal simplex method is proportional to the number ofrows (see e.g.2]), and each p i v oting requires a number of operations equal to the number of elements of the simplex matrix.
The parameters involved in the complexity of the algorithm are m, t h e n umberof primitive commodities, n > > m , the total numb e r o f c o m binations, p, t h e a verage number of orders per combination, q, the length of a cube that contains all limit prices for all primitive commodities, and r, the ratio of the maximal slope of net demand (of all net demand functions for combinations) over the minimal slope of net demand (of all net demand functions for primitive commodities).
Solving combination trading as a plain linear (PL) program would mean solving a linear program with n rows and np m columns (in the worst case where no coe cient A ij is equal to zero).Therefore, the (PL) method requires an average number of operations T P L equivalent t o : To evaluate our method, we suppose that the average of the coe cients A ij is equal to one.Therefore the radius is mnr (m(n ; m)r to be accurate).Since is large, the parameter is approximately equal to 1; is the maximum number of iterations of loop (1.5).Each loop requires 2mn operations, so the contraction mapping has a total numberofO(m 3 n 3 r 2 log q) operations.
For the discrete algorithm the volume of the initial simplex is at most equal to m m .What is the optimal number x of subsimplices per simplex?The number of subdivisions to go from a simplex of size S = m m to a subsimplex of size 1 i s log x S. The number of operations per subdivision being proportional to the number of subsimplices, the optimal x minimizes x log x S, therefore x = m is a good choice, and log m S = log m m m = m is the number of subdivisions.For each subdivision: the linear program P 1 (p) has to be solved once our subdivisions are made in such a way that each new vertex will be integral most of the time, so that D b (A T p) = D s (A T p) = 0, and therefore the dimension of P 1 (p) is reduced this step needs O(n 3 ) operations we then have to solve between 1 and m systems of m equations with m unknowns, which c a n b e a c hieved in at worst O(m 4 ) operations.
Therefore the homotopy requires a total time of O(m 5 +mn 3 ) operations and the average number of operations T M B of the (MB) algorithm is: T M B = O(m 3 n 3 r 2 log q + m 5 + mn 3 ) (

Numerical results
In order to validate the claim that our xed-point algorithm is superior to plain linear programming (LP) we implemented both algorithms on the same computer (PC Pentium) and the same language (Visual Basic).Table 1 shows that the xed point algorithm is indeed faster than plain (LP) when implemented on a standard class of combination trading problems: 2 primitive commodities, and 1 combination.We tried 10 di erent problems, each one with a di erent n umber of distinct limit prices.As expected, computation time for plain (LP) grows very fast with the number of distinct limit prices.It does not for our xed point algorithm.The experiments reported in table 1 corresponded to test cases where the xed point algorithm would start far away f r o m the solution, i.e., at the highest price lower than the solution where the aggregate demand and supply curves for each primitive commodity are at.In table 2, we repeat the last experiment of table 1 (with 36 distinct limit prices) and vary the initial point a distance of 100% in the table means that the initial price is the highest price lower than the solution where the curves are at.As expected, the closer the initial point to the solution, the faster the algorithm.

Conclusion
The two main results of this paper are the proof that consistent prices are optimal, and the existence of an algorithm to compute the optimal price and allocation

2. 2 . 2 .
The market balance p r oblem One of the main results of the paper is to simplify the combination trading problem into another problem, the market balance problem.The market balance problem consists of determining p B 2 Y B f b f s so that: p = ( p B p B A N ) (22) Y B = i=1::n f fp B 2 Z m jy ; i a i p B y + i g \ j=1::n fp B 2 Z m jy ; j a j p B y + j g g (23) F b (p + e) f b F b (p) (24) F s (p ; e) f s F s (p) a n b e s e e n t h a t Y B is bounded and connected.THEOREM 1 Let p b f b f s solve the market balance problem.Then p f b (y) f s (y) solves the combination trading problem, where: b f s p]) is a solution of the discrete market balance problem.

THEOREM 3
42) so that the solution of P 1 (v k ) i s ( p r f b f s ).For all other arguments, B b ii and B s ii should be linearly interpolated.COMBINATION TRADING WITH LIMIT ORDERS 143 All xed points p of F(p) are solutions of the modi ed market balance problem.PROOF The matrix of the system of all linear equations that are part of the optimality conditions at a xed point has full rank, by construction of F. Solving this system we see that the multipliers b and s of inequalities (34) and (35) are equal to: f s > 0, then b s > 0. Therefore, at a solution (p f b f s b s ) with p xed point, constraints (34) and (35) are tight, i.e.: f b = F b 0 (A T p) + D b (A T p) b (45) f s = F s 0 (A T p) + D s (A T p) s (46) 3.2.2.The Eaves-Saigal algorithm We will not explain the Eaves-Saigal algorithm rigorously.The interested reader can consult 3] 4].It is a path-following (also called homotopy) method to determine the Kakutani xed point o f a n y closed and convex-valued set-valued function (also called multifunction in the literature).
Bringing together the contraction mapping algorithm to solve the continuous (MB) model and the homotopy t o s o l v e the discrete (MB) model, we summarize hereafter our algorithm.= ( 1 ; )p r k;1 + G ;B r (;A N G N r (p r k;1 A N )) until jjp r k ; p r k;1 jj < m 1;

Table 1 .
Speed comparison xed point algorithm versus plain PL

Table 2 .
Speed of xed point algorithm with di erent initial prices Distance initial price to solution Speed s]