An optimization-based framework for automated market-making

We propose a general framework for the design of securities markets over combinatorial or infinite state or outcome spaces. The framework enables the design of computationally efficient markets tailored to an arbitrary, yet relatively small, space of securities with bounded payoff. We prove that any market satisfying a set of intuitive conditions must price securities via a convex cost function, which is constructed via conjugate duality. Rather than deal with an exponentially large or infinite outcome space directly, our framework only requires optimization over a convex hull. By reducing the problem of automated market making to convex optimization, where many efficient algorithms exist, we arrive at a range of new polynomial-time pricing mechanisms for various problems. We demonstrate the advantages of this framework with the design of some particular markets. We also show that by relaxing the convex hull we can gain computational tractability without compromising the market institution's bounded budget.


INTRODUCTION
Securities markets play a fundamental role in economics and finance. A securities market offers a set of contingent securities whose payoffs depend on the future state of the world. For example, an Arrow-Debreu security pays $1 if a particular state of the world is reached and $0 otherwise [3,4]. Consider an Arrow-Debreu security that will pay off in the event that a category 4 or higher hurricane passes through Florida in 2011. A Florida resident who worries about his home being damaged might buy this security as Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. a form of insurance to hedge his risk; if there is a hurricane powerful enough to damage his home, he will be compensated. Additionally, a risk-neutral trader who has reason to believe that the probability of a category 4 or higher hurricane landing in Florida in 2011 is p should be willing to buy this security at any price below p or (short) sell it at any price above p to capitalize his information. For this reason, the market price of the security can be viewed as the traders' collective estimate of how likely it is that a powerful hurricane will occur. Securities markets thus have dual functions: risk allocation and information aggregation Insurance contracts, options, futures, and many other financial derivatives are examples of contingent securities. A securities market primarily focused on information aggregation is often referred to as a prediction market. The forecasts of prediction markets have proved to be accurate in a variety of domains [5,24,32]. While our work builds on ideas from prediction market design [2,10,28], our framework can be applied to any contingent securities.
A securities market is said to be complete if it offers |O|−1 independent securities over a set O of mutually exclusive and exhaustive states of the world, which we refer to as outcomes [3,4,25]. For example, a prediction market with n Arrow-Debreu securities for n outcomes is complete. In a complete securities market without transaction fees, a trader may bet on any combination of the securities, allowing him to hedge any possible risk he may have. It is generally assumed that the trader may short sell a contract, betting against the given outcome; in a market with short selling, the nth security is not strictly necessary, as a trader can substitute the purchase of this contract by short selling all others. Furthermore, traders can change the market prices to reflect any valid probability distribution over the outcome space, allowing them to reveal any belief. Completeness therefore provides expressiveness for both risk allocation and information aggregation.
Unfortunately, completeness is not always achievable. In many real-world settings, the outcome space is exponentially large or even infinite. For instance, a competition among n candidates results in an outcome space of n! rank orders, while the future price of a stock has an infinite outcome space, namely R+. In such situations operating a complete securities market is not practical for two reasons: (a) humans are notoriously bad at estimating small probabilities and (b) it is computationally intractable to manage such a large set of contracts. Instead, it is natural to offer a smaller set of structured securities. For example, rather than offer a security corresponding to each rank ordering, in pair betting a market maker offers securities of the form "$1 if candidate A beats candidate B" [11]. There has been a surge of recent research examining the tractability of running standard prediction market mechanisms (such as the popular Logarithmic Market Scoring Rule (LMSR) market maker [20]) over combinatorial outcome spaces by limiting the space of available securities [29]. While this line of research has led to a few positive results [1,13,14,19], it has led more often to hardness results [12,14] or to markets with undesirable properties such as unbounded loss of the market institution [16].
In this paper, we propose a general framework to design automated market makers for securities markets. An automated market maker is a market institution that adaptively sets prices for each security and is always willing to accept trades at these prices. Unlike previous research aimed at finding a space of securities that can be efficiently priced using an existing market maker like LMSR, we start with an arbitrary space of securities and design a new market maker tailored to this space. Our framework is therefore extremely general and includes both the LMSR and Quad-SCPM [2] market makers.
We take an axiomatic approach. Given a relatively small space of securities with bounded payoff, we define a set of intuitive conditions that a reasonable market maker should satisfy. We prove that a market maker satisfying these conditions must price securities via a convex potential function (the cost function), and that the space of reachable security prices must be precisely the convex hull of the payoff vectors for each outcome (that is, the set of vectors, one per outcome, denoting the payoff for each security if that outcome occurs). We then incorporate ideas from online convex optimization [22,31] to define a convex cost function in terms of an optimization over this convex hull; the vector of prices is chosen as the optimizer of this convex objective. With this framework, instead of dealing with the exponentially large or infinite outcome space, we only need to deal with the lowerdimensional convex hull. The problem of automated market making is reduced to the problem of convex optimization, for which we have many efficient techniques to leverage.
To demonstrate the advantages of our framework, we provide two new computationally efficient markets. The first market can efficiently price subset bets on permutations, which are known to be #P-hard to price using LMSR [12]. The second market can be used to price bets on the landing location of an object on a sphere.
Finally, for situations where the convex hull cannot be efficiently represented, we show that we can relax the convex hull to gain computational tractability without compromising the market maker's bounded budget. This allows us to provide a computationally efficient market maker for the aforementioned pair betting, which is also known to be #Phard to price using LMSR [12]. In addition, this relaxation could potentially allow the market maker to charge transaction fees so that the depth of the market can be dynamically increased as the number of trades increases. This desirable property is discussed in Othman et al. [28] who proposed a corresponding market that extends the LMSR; utilizing our techniques for this purpose is left for future work. This paper builds upon intuitions from earlier work [10] exploring the striking mathematical connections between complete, cost function based prediction markets and noregret learning and online convex optimization. In this pa-per, we pursue a general convex optimization framework for pricing an arbitrary set of securities over a potentially very large outcome space. Agrawal et al. [2] and Peters et al. [30] also use convex optimization for automated market making. In addition to only considering complete markets, they formulate the convex optimization quite differently -their formulation is for limit orders and does not explicitly make the connection with conjugate duality as our framework does. To the best of our knowledge, this paper is the first work on designing markets that are tailored to the incomplete security spaces without explicitly reasoning over a large outcome space.

PRELIMINARIES
A simple cost function based market maker [9,10,20,21] offers |O| Arrow-Debreu securities, each corresponding to a potential outcome. The market maker determines how much each security should cost using a differentiable cost function, C : R |O| → R, which is simply a potential function specifying the amount of money currently wagered in the market as a function of the number of shares of each security that have been purchased. If qo is the number of shares of security o currently held by traders, and a trader would like to purchase a bundle of ro shares for each security o ∈ O (where some ro could be zero or even negative, representing a sale), the trader must pay C(q + r) − C(q) to the market maker. The instantaneous price of security o (that is, the price per share of an infinitely small portion of a security) is then ∂C(q)/∂qo, and is denoted po(q).
The market designer is free to choose any differentiable cost function C that satisfies a few basic properties. First, it must be the case that for every o ∈ O and every q ∈ R |O| , po(q) ≥ 0. This ensures that the price of a security is never negative. Second, assuming short sells are allowed, if the market designer wishes to prevent arbitrage, it must be the case that for every q ∈ R |O| , P o∈O po(q) = 1. That is, the sum of the instantaneous prices of the securities must always be 1. If the prices summed to something less than (respectively, greater than) 1, then a trader could purchase (respectively, sell) small equal quantities of each security for a guaranteed profit. 1 These conditions ensure that the current prices can always be viewed as a probability distribution over the outcome space. One example of a cost function based market that has received considerable attention is Hanson's Logarithmic Market Scoring Rule (LMSR) [9,20,21]. The cost function of the LMSR is C(q) = b log P o∈O e qo/b , where b > 0 is a parameter of the market controlling the rate at which prices change. The corresponding price function for each security o is po(q) = ∂C(q)/∂qo = e qo/b / P o ∈O e q o /b . When |O| is large or infinite, calculating the cost of a purchase becomes intractable in general. Recent research has focused on restricting the allowable securities over a combinatorial outcome space and examining whether LMSR prices can be computed efficiently in the restricted space. If the outcome space contains n! rank orders of n competing candidates, it is #P-hard to price pair bets (e.g., "$1 if and only if candidate A beats candidate B") or subset bets (e.g., "$1 if one of the candidates in subset C finishes at position k") using LMSR on the full set of permutations [12]. If the outcome space contains 2 n Boolean values of n binary base events, it is #P-hard to price securities on conjunctions of any two base events (e.g., "$1 if and only if a Democrat wins Florida and Ohio") using LMSR [12]. This line of research has led to some positive results when the uncertain event enforces particular structure on the outcome space. In particular, for a single-elimination tournament of n teams, securities such as "$1 if and only if team A wins a kth round game" and "$1 if and only if team A beats team B given they face off" can be priced efficiently using LMSR [13]. For a taxonomy tree on some statistic where the value of the statistic of a parent node is the sum of those of its children, securities such as "$1 if and only if the value of the statistic at node A belongs to [x, y]" can be priced efficiently using LMSR [19].
The framework we will introduce next takes a drastically different approach. Instead of searching for supportable spaces of securities for existing market makers, we design new market makers tailored to any security space of interest. Additionally, rather than requiring that securities have a fixed $1 payoff when the underlying event happens, we allow more general contingent securities with arbitrary, efficiently computable and bounded payoffs.

A FRAMEWORK FOR MARKET-MAKING FOR COMPLEX SECURITIES
In the complete cost function based markets described above, the market maker offers an Arrow-Debreu security corresponding to each potential outcome. We consider a market-design scenario where the outcome space O could potentially be quite large, or even infinite, making it infeasible to run such a market. Instead, we allow the market maker to offer a menu of K securities for some reasonablysized K, with the (nonnegative) payoff of each security described by an arbitrary but efficiently-computable function ρ : O → R K + . Specifically, if a trader purchases a share of security i and the outcome is o, then the trader is paid ρi(o). We call such security spaces complex. A complex security space reduces to the complete security space if K = |O| and for each i ∈ {1, · · · , K}, ρi(o) = 1 if o is the ith outcome and 0 otherwise. We consider traders that purchase security bundles r ∈ R K . Negative elements of r encode sales. The payoff for r upon outcome o is exactly ρ(o) · r, where ρ(o) denotes the vector of payoffs for each security for outcome While it is easy to put intuitive constraints on market prices to ensure that a complete market is "well-behaved", determining the comparable constraints on market prices for an arbitrary set of complex securities is challenging. In particular, while the no-arbitrage condition easily leads to the restriction that the security prices in a complete market need to sum to 1, it is much less clear what space of security prices should be allowed in order to prevent arbitrage in markets over complex securities. This is because the events under which complex securities will pay out are no longer mutually exclusive. This challenge leads us to take an axiomatic approach to understand what constraints a "well-behaved" market maker for complex securities must satisfy.
We do not presuppose a cost function based market. However, in Section 3.1, we show that the use of a convex cost function is necessary given the assumption of path indepen-dence on the contract purchases. We then derive additional constraints on the form of this cost function. In Sections 3.2-3.4, we go on to show how to design an appropriate cost function by employing techniques from online convex optimization.

Imposing Some Natural Restrictions on the Market Maker
In this section we introduce a sequence of conditions or axioms that one might expect a market to satisfy, and show that these conditions lead to some natural mathematical restrictions on the costs of security bundles. (We consider relaxations of these conditions in Section 5.) Similar conditions were suggested for complete markets by Chen and Vaughan [10], who defined the notion of a valid cost function, and by Othman et al. [28], who discussed properties similar to our notions of path independence and expressiveness, among others. However, no similar conditions have been described for complex markets.
Imagine a sequence of traders entering the marketplace and purchasing security bundles. Let r1, r2, r3, . . . be the sequence of security bundles purchased. After t − 1 such purchases, the tth trader should be able to enter the marketplace and query the market maker for the cost of arbitrary bundles. The market maker must be able to furnish a cost Cost(r|r1, . . . , rt−1) for any bundle r given a previous trade sequence r1, . . . , rt−1. If the trader chooses to purchase rt at a cost of Cost(rt|r1, . . . , rt−1), the market maker may update the costs of each bundle accordingly. Our first condition requires that the cost of acquiring a bundle r must be the same regardless of how the trader splits up the purchase.
Path independence helps to reduce both arbitrage opportunities and the strategic play of traders, as they no longer need to reason about the optimal path leading to some target position. However, it is worth pointing out that there are interesting markets not satisfying this condition, for example, the continuous double auction (CDA) and the market maker for CDA considered by Das [15], which in our opinion deserve separate treatment.
It turns out that the path independence alone implies that prices can be represented by a cost function C, as illustrated in the following theorem. The proof is by induction on t. 2 Theorem 1. Under Condition 1, there exists a cost function C : R K → R such that we may always write With this in mind, we drop the cumbersome Cost(r|r1, . . . , rt) notation from now on, and write the cost of a bundle r as C(q + r) − C(q), where q = r1 + . . . + rt is the vector of previous purchases. Now, recall that one of the functions of a securities market is to aggregate traders' beliefs into an accurate prediction. Each trader may have his own (potentially secret) information about the future, which we represent as a distribution p ∈ ∆ |O| over the outcome space, where ∆n = {x ∈ R n ≥0 : P n i=1 xi = 1}, the n-simplex. The pricing mechanism should therefore incentivize the traders to reveal p, but simultaneously avoid providing arbitrage opportunities. Towards this goal, we introduce four additional conditions on our pricing mechanism.
The first condition ensures that the gradient of C is always well-defined. If we imagine that a trader can buy or sell an arbitrarily small bundle, we would like the cost of buying and selling an infinitesimally small quantity of any particular bundle to be the same. If ∇C(q) is well-defined, it can be interpreted as a vector of instantaneous prices for each security, with ∂C(q)/∂qi representing the price per share of an infinitesimally small amount of security i. Additionally, we can interpret ∇C(q) as the traders' current estimates of the expected payoff of each security, in the same way that ∂C(q)/∂qo was interpreted as the probability of outcome o when considering the complete security space.

Condition 2 (Existence of Instantaneous Prices).
C is continuous and differentiable everywhere.
The next condition encompasses the idea that the market should react to trades in a sensible way in order to incorporate the private information of the traders. In particular, it says that the purchase of a security bundle r should never cause the market to lower the price of r. It turns out that this condition is closely related to incentive compatibility for a myopic trader. It is equivalent to requiring that a trader with a distribution p ∈ ∆ |O| can never find it simultaneously profitable (in expectation) to buy a bundle r or to buy the bundle −r. In other words, there can not be more than one way to express one's information.
The no arbitrage condition states that it is never possible for a trader to purchase a security bundle r and receive a positive profit regardless of the outcome.
Finally, the expressiveness condition specifies that any trader can set the market prices to reflect his beliefs about the expected payoffs of each security if arbitrarily small portions of shares may be purchased. HereR denotes the extended real numbers, [−∞, ∞].

Condition 5 (Expressiveness). For any
For any subset S of R d , let H(S) denote the convex hull of S. Recall that ρ(O) := {ρ(o)|o ∈ O}. We characterize the form of the cost function under these conditions. 3 The closure assumption is not strictly necessary, but is perfectly natural in typical settings. We include it for convenience. Without it, the conclusion can be modified to {∇C(q) : q ∈ R K } = closure(H(ρ(O))).
Proof. We first prove convexity. Assume C is nonconvex somewhere. Then there must exist some q and r such that C(q) > (1/2)C(q + r) + (1/2)C(q − r). This means C(q + r) − C(q) < C(q) − C(q − r), which contradicts Condition 3, so C must be convex. Now, Condition 2 trivially guarantees that ∇C(q) is welldefined for any q. To see that {∇C(q) : q ∈ R K } ⊆ H(ρ(O)), let us assume there exists some q for which ∇C(q ) / ∈ H(ρ(O)). This can be reformulated in the following way: There must exists some halfspace, defined by a normal vector r, that separates ∇C(q ) from every member of ρ(O). More precisely where the strict inequality is because H(ρ(O)) is closed. On the other hand, letting q := q − r, we see by convexity of C that C(q+r)−C(q) ≤ ∇C(q )·r. Combining these last two inequalities, we see that the price of bundle r purchased with history q is always smaller than the payoff for any outcome. This implies that there exists some arbitrage opportunity, contradicting Condition 4.
What we have arrived at from the set of proposed conditions is that (a) the pricing mechanism is always described precisely in terms of a convex cost function C and (b) the set of reachable prices, that is the set {∇C(q) : q ∈ R K }, must be identically the convex hull of the payoff vectors for each outcome H(ρ(O)). For complete markets, those with a single security corresponding to each of the n distinct outcomes, this would imply that the set of reachable prices should be the convex hull of the n standard basis vectors. Indeed, this comports exactly with the natural assumption that the vector of security prices in complete markets should represent a probability distribution, or equivalently that it should lie in the n-simplex.

Designing the Cost Function via Conjugate Duality
The natural conditions we introduced above imply that to design a market for a set of K securities with payoffs specified by an arbitrary payoff function ρ : O → R K + , we should use a cost function based market with a convex, differentiable cost function such that {∇C(q) : q ∈ R K } = H(ρ(O)). We now provide a general technique that can be used to design and compare properties of cost functions that satisfy these criteria. In order to accomplish this, we make use of tools from convex analysis.
It is well known 4 that any closed, convex, differentiable function C : R K → R can be written in the form C(q) = sup x∈dom(R) x · q − R(x) for a strictly convex function R called the conjugate of C, where dom(R) denotes the domain of R. (The strict convexity of R follows from the differentiability of C.) Furthermore, any function that can be written in this form is convex. As we will show in Section 3.3, the gradient of C can be expressed in terms of this conjugate: ∇C(q) = argmax x∈dom(R) x·q−R(x). To generate a convex cost function C such that ∇C(q) ∈ Π for all q for some set Π, it is therefore sufficient to choose an appropriate conjugate function R, restrict the domain of R to Π, and define C as We call such a market a complex cost function based market. To generate a cost function C satisfying our five conditions, we need only to set Π = H(ρ(O)) and select a strictly convex function R to serve as the conjugate.
This method of defining C is convenient for several reasons. First, it leads to markets that are efficient to implement whenever Π can be described by a polynomial number of simple constraints. The difficulty with combinatorial outcome spaces is that actually enumerating the set of outcomes can be challenging or impossible. In our proposed framework we need only work with the convex hull of the payoff vectors for each outcome when represented by a low-dimensional payoff function ρ(·). This has significant benefits, as one often encounters convex sets which contain exponentially many vertices yet can be described by polynomially many constraints. Moreover, as the construction of C is based entirely on convex programming, we reduce the problem of automated market making to the problem of optimization for which we have a wealth of efficient algorithms. Similar techniques have been applied to design learning algorithms in the online convex optimization framework [22,31], where R plays the role of a regularizer, and have been shown to be efficient in a variety of combinatorial applications, including online shortest paths, online learning of perfect matchings, and online cut set [8].
Second, this method yields simple formulas for properties of markets that help us choose the best market to run. Two of these properties, worst-case monetary loss and worst-case information loss, are analyzed below.
Note that both the LMSR and Quad-SCPM [2] are examples of complex cost function based markets, though they are designed for the complete market setting only.

Bounding Market Maker Loss and Loss of Information
Before discussing market properties, it is useful to review some helpful properties of conjugates. The first is a convenient duality: For any convex, closed function C, the conjugate of the conjugate of C is C itself. This implies that if C is defined as in Equation 1, we may write Since this maximization is unconstrained, and we are assuming that our cost function C is differentiable, the maximum occurs when ∇C(q) = x. (Note that this may hold for many different values of q.) Suppose for a particular pair (x * , q * ) we have ∇C(q * ) = x * . We can then rewrite this equation as R(x * ) = q * · x * − C(q * ), which gives us that C(q * ) = q * · x * − R(x * ). From Equation 1, this tells us that x * must be a maximizer of x · q − R(x). In fact, it is the unique maximizer due to strict convexity. This implies, as mentioned above, that ∇C(q) = argmax x∈Π x · q − R(x).
By a similar argument we have that for any q, if ∇R(x) = q then x maximizes x · q − R(x) and therefore, as we have just shown, x = ∇C(q). However, the fact that x = ∇C(q) does not imply that ∇R(x) = q; in the markets we consider, it is generally the case that x = ∇C(q) for multiple q.
We will make use of the notion of Bregman divergence. The Bregman divergence with respect to a convex function f is given by It is clear by convexity that D f (x, y) ≥ 0 for all x and y.
Additionally, we will require notions like the interior and boundary of a convex set, yet we must introduce more careful terminology in order to consider the case that our price space is not of full rank. Given a convex set S ⊂ R d that occupies d -dimensional linear subspace, where potentially d < d, we define the relative interior of S, relint(S), which is the interior of S when restricted to the d -dimensional space (typically known as the affine hull of S). In addition, we define the relative boundary of S, relbnd(S), as the set closure(S) \ relint(S).
With these tools in hand, we are ready to examine some market properties, and see how they depend on R.

Bounding the Market Maker's Monetary Loss
When comparing market mechanisms, it is useful to consider the market maker's worst-case monetary loss, This quantity is simply the worst-case difference between the maximum amount that the market maker might have to pay the traders (sup o∈O ρ(o) · q) and the amount of money collected by the market maker (C(q) − C(0)). The following theorem provides a bound on this loss in terms of the conjugate function.

R(x),
and when o is such that ρ(o) = arg max x∈H(ρ(o)) R(x) then this loss is realized in the limit for q as ∇C(q) → ρ(o).
This theorem tells us that as long as the conjugate function is bounded on H(ρ(O)), the market maker's worst-case loss is also bounded 5 . It says further that this loss is actually realized, for a particular outcome o, at least when the price vector approaches o. This suggests that loss to the market maker is worst when the traders are the most certain about the outcome.

Bounding Information Loss
Information loss can occur when securities are sold in discrete quantities (for example, single units), as they are in most real-world markets. Without the ability to purchase arbitrarily small bundles, traders may not be able to change the market prices to reflect their true beliefs about the expected payoff of each security, even if expressiveness is satisfied. We will argue that the amount of information loss is captured by the market's bid-ask spread for the smallest trading unit. Given some q, the current bid-ask spread of security bundle r is defined to be (C(q + r) − C(q)) − (C(q) − C(q − r)). This is simply the difference between the current cost of buying the bundle r and the current price at which r could be sold.
To see how the bid-ask spread relates to information loss, suppose that the current vector of quantities sold is q. If securities must be sold in unit chunks, a rational, risk-neutral trader will not buy security i unless she believes the expected payoff of this security is at least C(q + ei) − C(q), where ei is the vector that has value 1 at its ith element and 0 everywhere else. Similarly, she will not sell security i unless she believes the expected payoff is at most C(q) − C(q − ei). If her estimate of the expected payoff of the security is between these two values, she has no incentive to buy or sell the security. In this case, it is only possible to infer that the trader believes the true expected payoff lies somewhere in the range [C(q) − C(q − ei), C(q + ei) − C(q)]. The bid-ask spread is precisely the size of this range.
The bid-ask spread depends on how fast instantaneous prices change as securities are bought or sold. Intuitively, the bid-ask spread relates to the depth of the market. When the bid-ask spread is large, new purchases or sales can change the prices of the securities dramatically; essentially, the market is shallow. When the bid-ask spread is small, purchases or sales may only move the prices slightly; the market is deep. Based on this intuition, for complete markets, Chen and Pennock [9] use the inverse of ∂ 2 C(q)/∂q 2 ß to capture the notion of market depth for each security i independently. In a similar spirit, we define a market depth parameter, β, for our complex securities markets with twicedifferentiable C. Larger values of β correspond to deeper markets. We will bound the bid-ask spread in terms of this parameter, and use this parameter to show that there exists a clear tradeoff between worst-case monetary loss and information loss; this will be formalized in Theorem 4 below.
Definition 1. For any complex cost function based market, if C is twice-differentiable, the market depth parameter β(q) for a quantity vector q is defined as β(q) = 1/Vc(q), where Vc(q) is the largest eigenvalue of ∇ 2 C(q), the Hessian of C at q. The worst-case market depth is β = inf q∈R K β(q).
Let relint(Π) be the relative interior of Π. If C is twicedifferentiable, then for any q such that ∇C(q) ∈ relint(Π), we have a correspondence between the Hessian of C at q and the Hessian of R at ∇C(q). More precisely, we have that u ∇ 2 C(q)u = u ∇ −2 R(∇C(q))u for any u = x − x with x, x ∈ Π. (See, for example, Gorni [17] for more.) This means that β(q) is equivalently defined as the smallest eigenvalue of ∇ 2 R(∇C(q))|Π; that is, where we consider the second derivative only within the price region Π.
The definition of worst-case market depth implies that 1/β is an upper bound on the curvature of C, which implies that C is locally bounded by a quadratic with Hessian I/β. We can derive the following. Lemma 1. Consider a complex cost function based market with worst-case market depth β. For any q and r we have It is easy to verify that the bid-ask spread can be written in terms of Bregman divergences. In particular, C(q + r) − C(q) − (C(q) − C(q − r)) = DC (q + r, q) + DC (q − r, q). This implies that the worst-case bid-ask spread of a market with market depth β can be upperbounded by a constant times 1/β. That is, as the market depth parameter increases, the bid-ask spread must decrease. The following theorem shows that this leads to an inherent tension between worst-case monetary loss and information loss. Here diam (H(ρ(O))) denotes the diameter of the hull of the payoff vectors for each outcome.
Theorem 4. For any complex cost function based market with worst-case market depth β, for any r, q meeting the conditions in Lemma 1, the bid-ask spread for bundle r with previous purchases q is no more than r 2 /β. The worst-case monetary loss of the market maker is at least β · diam 2 (H(ρ(O)))/8.
We can see that there is a direct tradeoff between the upper bound 6 of the bid-ask spread, which shrinks as β grows, and the lower bound of the worst-case loss of the market maker, which grows linearly in β. This tradeoff is very intuitive. When the market is shallow (small β), small trades have a large impact on market prices, and traders cannot purchase too many shares of the same security without paying a lot. When the market is deep (large β), prices change slowly, allowing the market maker to gain more precise information, but simultaneously forcing the market maker to take on more risk since many shares of a security can be purchased at prices that are potentially too low. This tradeoff can be adjusted by scaling R, which scales β. This is analogous to adjusting the "liquidity parameter" b of the LMSR.

Selecting a Conjugate Function
We have seen that the choice of the conjugate function R impacts market properties such as worst-case loss and information loss. We now explore this choice in more detail.
In many situations, the ideal choice of the conjugate is a function of the form Here R(x) is simply the squared Euclidean distance between x and an initial price vector x0 ∈ Π, scaled by λ/2. By utilizing this quadratic conjugate function, we achieve a market depth that is uniformly λ over the entire security space. Furthermore, if x0 is chosen as the "center" of Π, namely x0 = arg minx∈Π maxy∈Π x−y , then the worst-case loss of the market maker is maxx∈Π R(x) = (λ/8)diam 2 (Π). While the market maker can tune λ appropriately according to the desired tradeoff between worst-case market depth and worstcase loss, the tradeoff is tightest when R has a Hessian that is uniformly a scaled identity matrix, or more precisely where R takes the form in Equation 2. Unfortunately, by selecting a conjugate of this form, or any R with bounded derivative, the market maker does inherit one potentially undesirable property: security prices 6 Strictly speaking, as we are emphasizing the necessary tradeoff between bid-ask spread and worst-case loss, we should have a lower bound on the bid-ask spread. On the other hand, if the worst-case market depth parameter is β then there is some q and r such that DC (q + r, q)/ r 2 ≈ 1/(2β) and this approximation can be made arbitrarily tight for small enough r when C is twice differentiable. may become constant when ∇C(q) reaches a point at relbnd(Π), the relative boundary of Π (see Section 3.3). That is, if we arrive at a total demand q where ∇C(q) = ρ(o) for some outcome o, our mechanism begins offering securities at a price equal to the best-case payoff, akin to asking someone to bet a dollar for the chance to possibly win a dollar. The Quad-SCPM for complete markets is known to exhibit this behavior [2].
To avoid these undesirable pricing scenarios, it is sufficient to require that our conjugate function satisfy one condition. We say that a convex function R defined on Π is a pseudobarrier 7 for Π if ∇R(xt) → ∞ for any sequence of points x1, x2, . . . ∈ Π which tends towards relbnd(Π). If we require our conjugate function R to be a pseudo-barrier, we are guaranteed that the instantaneous price vector ∇C(q) always lies in relint(Π), and does not become constant near the boundary.
It is important to note that, while it is desirable that ∇R(xt) → ∞ as xt approaches relbnd(Π), it is generally not desirable that R(xt) → ∞. Recall that the market maker's worst-case loss grows with the maximum value of R on Π and thus we should hope for a conjugate function that is bounded on the domain. A perfect example of convex function that is simultaneously bounded and a pseudobarrier is the negative entropy function H(x) = P i xi log xi, defined on the n-simplex ∆n. It is perhaps no surprise that LMSR, the most common market mechanism for complete security spaces, can be described by the choice R(x) := λH(x) where the price space Π = ∆n [2,10].

EXAMPLES OF COMPUTATIONALLY EFFICIENT MARKETS
In the previous section, we provided a general framework for designing markets on combinatorial or infinite outcome spaces. We now provide some examples of markets that can be operated efficiently using this framework.

Subset Betting
Consider the scenario in which the outcome is some ranking of a set of n competitors, such as n horses in a race. The outcome of such a race is a permutation π : [n] → [n], where π(i) is the final position of i, with π(i) = 1 being best, and [n] denotes the set {1, · · · , n}. A typical market for this setting might offer n Arrow-Debreu securities, with the ith security paying off if and only if π(i) = 1. Additionally, there might be separate, independent markets allowing bets on horses to place (come in first or second) or show (come in first, second, or third). However, running independent markets for sets of outcomes with clear correlations is wasteful in that information revealed in one market does not automatically propagate to the others.
Chen et al. [11] proposed a betting language, subset betting in which traders can place bets (i, j), for any candidate i and any slot j, that pay out $1 in the event that π(i) = j and $0 otherwise. 8 Chen et al. [12] showed that pricing bets of this 7 We use the term pseudo-barrier to distinguish this from the typical definition of a barrier function on a set Π, which is a function that grows without bound towards the boundary of Π. The term Legendre was introduced by Cesa-Bianchi and Lugosi [7] for a similar notion, yet their definition requires the stronger condition that Π contain a nonempty interior. 8 The original definition of subset betting allowed bets of the form "any candidate in set S will end up in slot j" or form using LMSR is #P-hard and provided an algorithm for approximating the prices by exploiting the structure of the market. Using our framework, it is simple to design a computationally efficient market for securities of this form.
In order to set up such a combinatorial market within our framework, we must be able to efficiently work with the convex hull of the payoff vectors for each outcome. Notice that, for an outcome π, the associated payoff can be described by a matrix Mπ, with Mπ(i, j) = I[π(i) = j], where I[·] is the indicator function. Taking this one step further, it is easy to verify that the convex hull of the set of permutation matrices is precisely the set of doubly stochastic matrices, that is the set where X(i, j) represents the element at the ith row and jth column of the matrix X. Notice, importantly, that this set is described by only n 2 variables and O(n) constraints.
To fully specify the market maker, we must also select a conjugate function R for our price space. While the quadratic conjugate function is an option, there is a natural extension of the entropy function, whose desirable properties were discussed in the previous section, for the space of stochastic matrices. For any X ∈ Π, let us set The worst-case market depth is computed as the minimum of the smallest eigenvalue of the Hessian of R within the relint(Π). This occurs at the matrix with all values 1/n, hence the worst-case depth is nλ. The worst-case loss, on the other hand, is easily computed as λn log n.

Sphere Betting
We now consider an example in which the outcome space is infinite. An object orbiting the planet, perhaps a satellite, is predicted to fall to earth in the near future and will land at an unknown location, which we would like to predict. We represent locations on the earth as unit vectors u ∈ R 3 . The difficulty of this example arises from the fact that the outcome must be a unit vector, imposing constraints on the three coordinates. We will design a market with three securities, each corresponding to one coordinate of the final location of the object. In particular, security i will pay off ui + 1 dollars if the object lands in location u. (The addition of 1, while not strictly necessary, ensures that the payoffs, and therefore prices, remain positive, though it will be necessary for traders to sell securities to express certain beliefs.) This means that traders can purchase security bundles r ∈ R 3 and, when the object lands at a location u, receive a payoff (u + 1) · r. Note that in this example, the outcome space is infinite, but the security space is small.
The price space H(ρ(O)) for this market will be the 2norm unit ball centered at 1. To construct a market for this scenario, let us make the simple choice of R(x) = λ x − 1 2 for some parameter λ > 0. When q ≤ 2λ, there exists an x such that ∇R(x) = q. In particular, this is true for x = (1/2)q/λ + 1, and q · x − R(x) is minimized at this "candidate i will end up in one of the slots in set S." A bet of this form can be constructed easily using our betting language by bundling multiple securities. point. When q > 2λ, q · x − R(x) is minimized at an x on the boundary of H(ρ(O)). Specifically, it is minimized at x = q/||q|| + 1. From this, we can compute when q ≤ 2λ, q + q · 1 − λ, when q > 2λ.
The market depth parameter β is 2λ; in fact, β(x) = 2λ for any price vector x in the interior of H(ρ(O)). By Theorem 3, the worst-case loss of the market maker is no more than λ, which is precisely the lower bound implied by Theorem 4. Finally, the divergence DC (q + r, q) ≤ r 2 /(4λ) for all q, r, with equality when q , q + r ≤ 2λ, implying that the bid-ask spread scales linearly with r 2 /λ.

COMPUTATIONAL COMPLEXITY AND RELAXATIONS
In Section 3, we argued that the space of feasible price vectors should be precisely H(ρ(O)), the convex hull of the payoff vectors for each outcome. In each of our examples, we have discussed market scenarios for which this hull has a polynomial number of constraints, allowing us to efficiently set prices via convex optimization 9 . Unfortunately, one should not necessarily expect that a given payoff function and outcome space will lead to an efficiently describable convex hull. In this section, we explore a couple of approaches to overcome such complexity challenges. First, we discuss the case in which H(ρ(O)) has exponentially (or infinitely) many constraints yet gives rise to a separation oracle. Second, we show that the price space Π can indeed be relaxed beyond H(ρ(O)) without increasing the risk to the market maker. Finally, we show how this relaxation applies in practice.

Separation Oracles
If we encounter a convex hull H(ρ(O)) with exponentiallymany constraints, all may not be lost. Recall that, in order to set prices, we need to solve the optimization problem max x∈H(ρ(O)) q · x − R(x). Under certain circumstances this can still be solved efficiently.
Consider a convex optimization problem with a concave objective function f (x) and constraints gi(x) ≤ 0 for all i in some index set I. That is, we want to solve: This can be converted to a problem with a linear objective in the standard way: Of course, if I is an exponentially or infinitely large set we will have trouble solving this problem directly. On the other hand, the constraint set may admit an efficient separation oracle, defined as a function that takes as input a point (x, c) and returns true if all the necessary constraints are satisfied or, otherwise, returns false and specifies a violated constraint 10 . Given an efficient separation oracle one has access to alternative methods for optimization, the most famous being Khachiyan's ellipsoid method, that run in polynomial time. For more details see, for example, Grötschel et al [18]. This suggests that a fruitful direction for designing computationally efficient market makers is to examine the pricing problem on an instance-by-instance basis, and for a particular instance of interest, leverage the structure of the instance to develop an efficient algorithm for solving the specific separation problem. We leave this for future research.

Relaxation of the Price Space
When dealing with a convex hull H(ρ(O)) that has a prohibitively large constraint set and does not admit an efficient separation oracle we still have one tool at our disposal: we can modify H(ρ(O)) to get an alternate price space Π which we can work with efficiently. Recall that in Section 3, we arrived at the requirement that Π = H(ρ(O)) as a necessary conclusion of the proposed conditions on our market maker. If we wish to violate this requirement, we need to consider which conditions must be weakened and revise the resulting guarantees from Section 3.
We will continue to construct our markets in the usual way, via the tuple (O, ρ, Π, R) where O is the outcome space, ρ is the payoff function, Π ⊆ R d is a convex compact set of feasible prices, and R : R d → R is a strictly convex function with domain Π. The market's cost function C will be the conjugate of R with respect to the set Π, as in Equation 1. The only difference is that we now allow Π to be distinct from H(ρ(O)). Not surprisingly, the choice of Π will affect the interest of the traders and the market maker. We prove several claims which will aid us in our market design. Theorem 5 tells us that the expressiveness condition should not be relaxed, while Theorem 6 tells us that the no-arbitrage condition can be. Together, these imply that we may safely choose Π to be a superset of H(ρ(O)).
Theorem 5. For any complex cost function based market, the worst-case loss of the market maker is unbounded if This (perhaps surprising) theorem tells us that expressiveness is not only useful for information aggregation, it is actually necessary for the market maker to avoid unbounded loss. The proof involves showing that if o is the final outcome and ρ(o) ∈ Π, then it is possible to make an infinite sequence of trades such that each trade causes a constant amount of loss to the market maker.
In the following theorem, which is a simple extension of Theorem 3, we see that including additional price vectors in Π does not adversely impact the market maker's worstcase loss, despite the fact that the no-arbitrage condition is violated.
Theorem 6. Consider any complex cost function based market with R and Π satisfying sup x∈H(ρ(O)) R(x) < ∞ and H(ρ(O)) ⊆ Π. Assume that the initial price vector satisfies ∇C(0) ∈ H(ρ(O)). Let q denote the vector of quantities sold and o denote the true outcome. The monetary loss of the market maker is no more than This tells us that expanding Π can only help the market maker; increasing the range of ∇C(q) can only increase the divergence term. This may seem somewhat counterintuitive. We originally required that Π ⊆ H(ρ(O)) as a consequence of the no-arbitrage condition, and by relaxing this condition, we are providing traders with potential arbitrage opportunities. However, these arbitrage opportunities do not hurt the market maker. As long as the initial price vector lies in H(ρ(O)), any such situations where a trader can earn a guaranteed profit are effectively created (and paid for) by other traders! In fact, if the final price vector ∇C(q) falls outside the convex hull, the divergence term will be strictly positive, improving the bound.
To elaborate on this point, let's consider an example where Π is strictly larger than H(ρ(O)). Let q be the current vector of purchases, and assume the associated price vector x = ∇C(q) lies in the interior of H(ρ(O)). Consider a trader who purchases a bundle r such that the new price vector leaves this set, i.e., y := ∇C(q + r) / ∈ H(ρ(O)). We claim that this choice can be strictly improved in the sense that there is an alternative bundle r whose associated profit, for any outcome o, is strictly greater than the profit for r.
For simplicity, assume y is an interior point of Π \ H(ρ(O)) so that q + r = ∇R(y).
Combining this last expression with the inequality above and (3) tells us that the profit increase is strictly greater than (ρ(o) − π(y)) · (r − r) ≥ 0. Simply put, the trader receives a guaranteed positive increase in profit for any outcome o. The next theorem shows that any time the price vector lies outside of ρ(o), traders could profit by moving it back inside. The proof uses a nice application of minimax duality for convex-concave functions.
Theorem 7. For any complex cost function based market, given a current quantity vector q0 with current price vector ∇C(q0) = x0, a trader has the opportunity to earn a guaranteed profit of at least min x∈H(ρ(O)) DR(x, x0).
When x0 ∈ H(ρ(O)), DR(x, x0) is minimized when x = x0 and the bound is vacuous, as we would expect. The more interesting case occurs when the prices have fallen outside of H(ρ(O)), in which case a trader is guaranteed a riskless profit by moving ∇C(q) to the closest point in H(ρ(O)).

Pair Betting via Relaxation
We return our attention to the scenario where the outcome is a ranking of n competitors, as described in Section 4.1. Consider a complex market in which traders make arbitrary pair bets: for every i, j, a trader can purchase a security which pays out $1 whenever π(i) > π(j). Like subset bets, pricing pair bets using LMSR is known to be #P-hard [12].
We can represent the payoff structure of any such outcome π by a matrix Mπ defined by if π(i) > π(j) 1 2 , if i = j 0, if π(i) < π(j).
We would like to choose our feasible price region as the set H({Mπ : π ∈ Sn}), where Sn is the set of permutations on [n]. Unfortunately, the computation of this convex hull is necessarily hard: if given only a separation oracle for the set H({Mπ : π ∈ Sn}), we could construct a linear program to solve the "minimum feedback arc set" problem, which is known to be NP-hard.
On the positive side, we see from the previous section that the market maker can work in a larger feasible price space without risking a larger loss. We thus relax our feasible price region Π to the set of matrices X ∈ R n 2 satisfying X(i, j) + X(j, k) + X(k, i) ≥ 1 ∀i, j, k ∈ [n] This relaxation was first discussed by Meggido [26], who referred to such matrices as generalized order matrices. He proved that, for n ≤ 4, we do have Π = H({Mπ : π ∈ Sn}), but gave a counterexample showing strict containment for n = 13. By using this relaxed price space, the market maker allows traders to bring the price vector outside of the convex hull, yet includes a set of basic (and natural) constraints on the prices. Such a market could be implemented with any strongly convex conjugate function (e.g., quadratic).

CONCLUSION
We conclude by mentioning one nice direction of work. As we discussed, there is an inherent tradeoff between the bid-ask spread and the worst-case loss of the market maker. But if the market maker chooses to sell securities with an additional transaction cost for each security sold, then this money can not only help to cover the worst-case loss, but can also lead to a profit. Furthermore, if a market becomes popular, the market-maker may wish to increase the market depth. This idea has been explored by Othman et al. [28] for the case of complete markets, introducing a liquidity sensitive market maker, and they provide a new model with profit guarantees. Othman and Sandholm [27] recently extend the work and characterize a family of market makers that are liquidity sensitive. Via our framework, we can define an alternative method for simultaneously including transaction costs and guaranteeing profit. In particular, this is achieved through relaxing the price space, as discussed in Section 5.2. We leave the details to future work.