{'fraction_non_alphanumeric': 0.037953268041430906, 'fraction_numerical': 0.00898546910540068, 'mean_word_length': 4.129495709189085, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
High Frequency Market Making

Since they were authorized by the U.S. Security and Exchange Commission in 1998, electronic exchanges have boomed, and by 2010 high frequency trading accounted for over 70% of equity trades in the US. Such markets are thought to increase liquidity because of the presence of market makers, who are willing to trade as counterparties at any time, in exchange for a fee, the bid-ask spread. In this paper, we propose an equilibrium model showing how such market makers provide liquidity. The model relies on a codebook for client trades, the implied alpha. After solving the individual clients optimization problems and identifying their implied alphas, we frame the market maker stochastic optimization problem as a stochastic control problem with an infinite dimensional control variable. Assuming either identical time horizons for all the clients, or a stochastic partial differential equation model for their beliefs, we solve the market maker problem and derive tractable formulas for the optimal strategy and the resulting limit-order book dynamics.


Introduction
Electronic exchanges play an increasingly important role in financial markets and market microstructure became the key to understanding them. Here market microstructure is understood as the study of the trading mechanisms used for financial securities [11]. High frequency trading strategies depend very strongly on these mechanisms which in turn, vary from market to market. Three main themes were proposed to unite the common features of most of these markets [11].
(1) The first theme is the limit-order book, where agents can post trading intentions at prices above (ask) or below (bid) the mid-price, which is regarded as the current fair price for the security. These posts, called limit-orders, can then lead to executions if they are paired with a matching order. In this case, the initial agent, commonly known as the liquidity provider, gains a small amount of money, having sold at the ask or bought at the bid. It is said in that case that the liquidity taker has paid a liquidity fee for the right to trade immediately. (2) The second theme is adverse selection due to asymmetric sources of information. It is based on the principle that liquidity takers choose which limit-orders are actually executed, and when. Moreover, since liquidity providers publicly announce their intentions by posting their limit-orders, and these two market rules create an information bias in favor of liquidity takers that compensates for the liquidity fee. (3) The last theme is statistical predictions. All agents on electronic markets attempt to predict prices on a short time scale. Such predictions are possible both because of the existence of private information and the actual market mechanisms that create short-range price correlations. While statistical predictions are used by all traders on electronic markets, the objectives of these agents vary widely. Some make their profits from these predictions, while others just reduce their transaction costs by trading smartly.
After the liquidity crisis of 2008, liquidity became the central object of interest for market microstructure. Liquidity is rarely defined precisely, although intuitively, it should quantify how difficult it is to engage in a trade. Commonly accepted measures of liquidity are the bid-ask spread 1 and the volume present in a limit-order book. We tie these two quantities together by modeling what we will call the liquidity cost curve, or simply cost curve. We define this to be the total fee paid by the liquidity taker as a function of the volume asked for. If the liquidity taker only executes limit-orders at the best ask or bid, the fee will be equal to the bid-ask spread times the volume. Some clients, however, might wish to go beyond the best bid or ask and take more volume from the market. The marginal fee then becomes a function of the volume.
Trade volumes are difficult to model, in part because they are so dependent on liquidity takers' decisions and their execution strategies. Empirically, trade volumes present very heavy tails and are strongly autocorrelated ( [6]): there are frequent outliers, buys tend to follow buys, and sells tend to follow sells, which is what makes them hard to evaluate statistically. Limit-orders, on the other hand, are mean-reverting and have been widely studied in the literature (see, for instance, [6,7,19]). The interplay between trend-following liquidity takers and mean-reverting liquidity providers is what makes the market reach the critical state of diffusion, as seen in [5]. From a modeling stand point, all these attributes are what makes a direct statistical description of trade volumes so difficult, which is why the introduction of a codebook is desirable.
1.1. Market making. Market makers are a special class of liquidity providers. They essentially act as a scaled down version of the market itself, always providing limit-orders on both sides of the mid-price. How these limit-orders are placed in terms of volume, distribution, and distance from the mid-price, determines the pricing strategy. We can therefore define the liquidity curve associated with a market maker's pricing strategy. The agents trading with a market maker are considered as his clients. Market making is a purely passive strategy that essentially corresponds to the service of providing liquidity to the market against a fee. This strategy makes money as long as the pricing accurately anticipates future price variations. The first step towards that objective is to find a model for client volumes that is consistent with price dynamics.
There are two schools of thoughts on market making models. The first focuses on inventory risk. There, the market maker has a preferred inventory position and prices according to his risk aversion to diverging inventory levels. Some of the first models of this type are [10,4], which can be found in [11]. The second, initiated by [14], focuses on adverse selection, usually distinguishing between informed and noise trades. This paper belongs to the second line of thought.
According to our stylized definition of a market maker, the latter does not possess a view on the market. Clients, on the other hand, have views on the market and this leads to trading needs. When this view is short term, then the client has a statistical edge on the rest of the market and tries to push that edge to make a short term profit. But even when the view is long term, the client will still attempt to minimize transaction costs by predicting prices on a short time scale. Long-term strategies and liquidity constraints can therefore be modeled as noise around optimal short term execution strategies. The intuition behind this is that long term constraints, while the main motives behind most trades, will not necessarily dictate their execution. This is the case because there are increasingly more layers between the entity that formulates the long term strategy (for example investment banks or hedge funds) and the one that actually executes it (for example brokers or execution engines). But only the latter actually has a short term view on the market, which is what the market maker is interested in. Optimal executions based on short term beliefs and associated trade volumes form therefore the cornerstone of the upcoming analysis and will link prices to trades.

1.2.
Alpha. Alpha is the term often used to signify that a client has a directional view on the market. In an adverse selection model the aim of any market maker is to discover this view and hedge against it. Most papers (see for example [2,5,18,11]) introduce a notion of market impact or response function, to study the relationship between trades and prices. Trade size is oftenthough not always -included, and a lot of work has been done to fit various curves to the response function. A large number of papers on execution strategies ( [1,2,3,16]) rely heavily on this notion of market impact. So do most practitioners. Essentially, alpha and market impact are the same quantity, even though the stories told to justify these concepts are quite different. In the market impact literature, the premise is that a trade causes a price movement, while alpha is viewed as an attempt at predicting the movement. Response function is a more neutral term that allows for both interpretations.
In this paper, we present a simple model for client decisions that proves, under very general assumptions, a systematic relationship between trade sizes and short term expected price variations. It states that marginal costs should equal expected price variations. This is an intuitive result given that price variations are the marginal gains of a risk-neutral client. In this model, each client has a short term view on the market and trades optimally according to this view: his optimal execution strategy depends upon his belief. The theoretical notion of implied alpha appears quite naturally from the stochastic optimal control problem that defines the client's model.
On the market maker side, our model tries to capture the fact that market makers do not act on a personal view of the market. The market maker uses the notion of client implied alpha to infer an approximate price process from his clients' behaviors, essentially aggregating the views of his clients to form a probability distribution on the price. The optimal order book strategy then replicates this distribution, with a corrective term that takes into account the profitability of trades, that is, the trade-off between spread and volume.

1.3.
Results. The thrust of this paper is to propose a framework in which a market making strategy appears endogenously. This framework is based on (1) a result to imply a market view from client trades under a simple yet robust model of client behavior; (2) a procedure for the market maker to infer his own view on the market from that of his clients; (3) a profitability function that measures how profitable a posted volume on the order book is likely to be; (4) a penalizing term taking into account possible feedback effects of the market maker's decision. The last part will be motivated by the idea that, just as the market maker implies information from his clients' trades, clients can infer information from his order book. Our hypotheses are chosen, and our results are derived, in order to make the market making problem tractable. Once the theoretical framework is put in place, the market maker optimal control problem is formulated and solved, leading to an explicit market making strategy.
The story told by the model is closest to that of the informed trade literature [14], although one major difference is that there is no clear cut distinction between informed and noise traders. Our conservative market maker assumes that all of his clients' implied alphas carry information. Moreover, the existence of at least one informed trader underpins the estimation formula used by the market maker. The paper also relates strongly to both the market impact [2,5,18,11] and optimal execution [1,3,2,16] literatures. A cost function c t and an order book γ t are derived endogenously from the premises of the model. We hope that the proposed implied alpha codebook will find applications in other limit-order book models. Finally, while we ignore inventory risk to make our market maker risk-neutral, our approach still relates to utility function and inventory models such as [4,10].
The results of the paper are organized in four sections. First, the setup for the model is given, which includes a methodology for modeling heterogeneous beliefs and transaction costs. Second, a simple client model is presented and solved, leading to a relationship between trades and alphas which motivates the market maker's choice for a codebook. Third, the market maker model is built step by step, starting from the client model and working through a series of results and approximations to lead to a reasonable control problem. Last, the market maker's problem is solved and the dynamics of the order book are determined analytically, For the sake of definiteness, we focus on a tractable example for which we compute the two-humped limit order book shape. An appendix is added at the end of the paper to provide the proofs of two technical results which, had they been included in the text, could have distracted from the main objective of the modeling challenge.

Setup of the model
In this section, all the elements of the model are presented.

2.1.
Heterogeneous beliefs on the price. Consider n clients and one market maker who interact on an electronic exchange, with n very large. We will denote by i ∈ {1...n} a client index, and k ∈ {0...n} a generic index, with k = 0 corresponding to the market maker. We first introduce the following setting for the model: (1) a filtered probability space (Ω, F, (F t ) t≥0 , P) representing the "real life" filtration and probability measure. The filtration is generated by a d-dimensional P Wiener process W t . (2) a different filtration and measure ((F k t ) t≥0 , P k ) for each of the agents. Assume furthermore that F k t ⊂ F t , that P k | F k t and P| F k t are equivalent and that P 0 | F 0 t = P| F 0 t . (3) a d k -dimensional P Wiener process W k t that generates the filtration (F k t ) t≥0 . (4) a price process p t which is an Itô process adapted to all the filtrations F k t t≥0 k=0...n . (5) the drift and volatility of p t grow at most polynomially in t under all probability measures. where the last hypothesis must be understood in the a.s. and L 2 sense.
Let dp t = a t dt + σ t dW t (2.1) be the Itô decomposition of p t under (F t ) t≥0 , P . Hypotheses 2 and 3 imply that there exists an F k t t≥0 adapted process r k t such that for some P k | F k t Wiener process B k t and with r 0 t = 0. Because W k is d k dimensional, so are r k t and B k t . Furthermore, by the martingale representation theorem, given that W k t is a P martingale, there exists an Finally, agent k has the following view on the market under F k t t≥0 , P k : with σ t = σ k t Σ k t and a k t = a t + σ k t r k t . In particular, σ t needs to live in the intersection of the images of all the Σ k t T for p t to be adapted to all the filtrations. Note that the d k is allowed to differ from one agent to another, in which case the σ k t must be of different dimensions and hence differ. In conclusion, all the agents have views on the price process that potentially conflict with each other's probability measure and even filtration, but can be compared coherently within the larger probability space (Ω, F, (F t ) t≥0 , P).
Example 2.1. Consider the case where you have three Wiener processes W 1 , W 2 and W 3 . Let . You then have that: where the two last decompositions are not adapted with respect to the other filtration, but the price process is nevertheless adapted to both filtrations.

Transaction costs.
We now allow trades among agents. All clients have a cumulative position L i in the asset, which starts off at 0 at the beginning of the trading period. For the market maker, we rescale all the quantities according to the number of clients, hence L 0 t is his average cumulative position per client. Clients control their position through its first derivative, l i t but incur transaction costs. The market maker, on the other hand, has no direct control over his position, but receives the liquidity fee c t . To be precise, the market maker announces to his clients a cost function l −→ c t (l), which denotes the price of trading at speed l at moment t. A client then chooses her preferred trading volume l i t , and pays c t (l i t ) in total transaction fees. We make the following hypotheses on these two processes: (1) The trade volume process l i t for each client is adapted to F i t t≥0 and F 0 t t≥0 . (2) The cost function process c t is adapted to all filtrations. Hypotheses 1 and 2 describe the information the different agents have access to. 3-5 are intuitive properties that the cost function must verify to make sense in terms of transaction costs. Finally, the hypothesis 6 is left purposefully vague, because it is best expressed with notation we introduce now.

2.2.1.
Duality and link to the order book. This section introduces a change of variable that is both mathematically convenient and will carry deeper financial meaning when the model is solved. The new variable γ is defined as follows: Under the assumptions c t ∈ C 1 , convex and c t (0) = 0, this is equivalent to defining γ t = (c t ) −1 and γ t (0) = 0. In that case, γ t is simply the Legendre transform of c t . The following properties can be derived: (1) The Legendre transform maps the space of convex functions onto itself. It is its own inverse. In particular, γ t , where the second derivative has to be understood in the sense of distributions, is a positive, finite measure. This means we can actually replace c t by the second derivative of its dual γ t as the control variable of the market maker. Similarly, α i t is the dual to the client's control variable l i t . Call γ t the market maker's liquidity offer and α i t the client's implied alpha. The second terminology will be explained later. We therefore recast all the hypotheses with these new dual variables: (1) The implied alpha process α i t for each client is adapted only to F i t t≥0 and F 0 t t≥0 . (2) The liquidity process γ t for each market maker is adapted to all filtrations.
. (4) Clients may choose not to trade and the order book is centered around the mid-price: γ t (0) = 0 and γ t (0) = 0. (5) Only positive, finite volumes are posted on a market maker's liquidity offer: γ t is a positive, finite measure. (6) The total mass of γ t is fixed. For convenience sake we will renormalize it to one, making γ t a probability measure.
As a consequence of 3-5, l i t is bounded. Furthermore, γ t therefore lives on the space of finite measures, which is a complete, separable metric space under the Lévy-Prokhorov metric and a convex set.

2.3.
Putting it all together. We summarize the model. First a public price process p t is given. Assume it is exogenously given to every one, that is, all the agents consider that they have no impact on the price under their probability measure, and only try to estimate its future movements. Then, a public liquidity offer, which can both be followed either by the cost function c t or its dual, γ t is announced. Clients pick their trade volumes l i t , or equivalently, their implied alphas α i t . We furthermore have the following state variable equations: since γ t is bounded, L k t has at most linear growth in t. Finally, we write an infinite-horizon objective function for each agent, using distinct time scales β k for each of them. Cumulative positions appreciate or depreciate at every moment by dp t and client i pays the liquidity fee c t (l i t ) to the market maker when readjusting her portfolio. We also rescale his objective function according to the number of clients he has.
The first term of each objective function is bounded by the linear growth of L k t and the polynomial growth of the drift and volatility of p t under P k .

The Client Control Problem
We first solve the problem from the clients' perspective, in order to know what drives trades. The results of this simple model will be used in the next section as a codebook for a more powerful market making model. The section concludes with a small robustness analysis on the underlying hypothesis of the model.

3.1.
Solving the control problem. In this section, we solve the control problem for one generic client. Because her decisions have no impact on either p t or c t , it will not affect any of the other clients' decisions. Her control variable is not even adapted to their filtration. Similarly, her own control problem is not affected by the other clients' decision. This allows us to drop the index i in this subsection. Let P , F t t≥0 denote that client's probability measure and filtration andW her Wiener process. Remember that the client tries to solve the following control problem: • An admissible control l t is a stochastic process adapted to F t t≥0 that lives in the support of c t . Because of the hypothesis γ t , 1 = 1, we have that the support of c t is included in [−1, 1], which means that the control set A is bounded.
• The state variable L t verifies the dynamics: We assume β large enough for the problem to be well defined. Using the notation introduced in the previous section, we have the central result: A client who trades optimally will follow the relationship where α t is defined by the codebook c t (l t ) = α t .
Proof. The aim now is to apply the Pontryagin maximum principle to the above control problem. The gain function is not in standard form, but a simple integration by parts solves this issue.
The first term is equal to 0 because we assume L 0 = 0 and lim t→∞ e −βt L t p t = 0 by the linear growth of L t and the polynomial growth of p t . The client therefore maximizes: We write out the generalized Hamiltonian of the system: The generalized Hamiltonian is linear in L and concave in l by convexity of c, and therefore overall concave in (L, l). p t and c t are exogenously defined Itô process. Then, the backward equation has a unique solution By polynomial growth of the volatility of p t , the Z term of the Backward Stochastic Differential Equation (BSDE from now on) satisfies the growth condition (A.6). Therefore, the candidate optimal control is l * t verifying e βt Y t − p t = c t (l * t ). This determines l t = γ t e βt Y t − p t . Therefore the forward equation of L t has a unique solution. Finally, the quantity can be seen as the "implied alpha" of the deal, that is, the difference between the projected value into the future and the current value of p.
While it makes intuitive sense 2 , this a non-trivial result. Indeed, c t and hence l t depend on the market maker's decision, and yet α t = c t (l t ) becomes a quantity that is "intrinsic" to the client. It is independent of the market maker's pricing and only depends on the client's view on the market. It intuitively represents the client's price estimator and summarizes her beliefs on the price dynamics. Note that the discount factor now becomes the time-scale of her prediction. We define the quantity the client tries to predict as the realized alpha over the time scale 1 β : This coincides with what practitioners refer to as the 'alpha' of a client.

3.2.
Dynamics of the implied alpha. (3.3) can be rewritten in terms of Itô dynamics: with θ t = e βt Z t therefore being the volatility of the estimation. All these equations summarize the link between optimal client volumes and price dynamics under the client's probability measure and filtration. Three things can be noted.
(1) The drift of the implied alpha is the result of two opposing forces. On the one hand, the self-correlation term guarantees a certain coherence in the client's decisions over the timescale β −1 . On the other hand, the implied alpha, through the −dp t term, automatically takes into account the last price variation to recenter the estimation.
(2) θ t is a measure of intelligence of a client over the price process p t , given that in the limit where θ t = 0, a client has a perfect view on the market. Conversely, clients with a big θ t will have a higher variance on their price estimator, and can at the limit be considered as "noise" traders. (3) We can write the dynamics of α t under P to obtain: which provides the link between trade and price dynamics. Note that, while underP, α t is intrinsic to the client, under P, α t may depend on the market maker's decisions. In words, this means that while the market maker cannot influence the client's decision under her own view of the market, he can affect that view itself.
3.2.1. The cost of information. Given the above result, it is clear that a market maker has a privileged position on the market: he catches a glimpse of everyone's belief on the price. We can now give an interpretation of γ beyond the fact that γ represents the order book: Under a martingale measure of p t , c t (l t ) represents the cost the client pays to the market maker for the liquidity l t , and this is the conservative interpretation of transaction costs. However, γ t (α t ) represents the cost the market maker pays under the client's view of the market. UnderP, it is as if the market maker pays the client for information on the price process.
This gives us a good intuition about the market maker's strategy: he collects information from each client, pricing them according to the current beliefs and how much the new information brings to him: γ(α) is essentially how much the market maker is willing to pay for a prediction of strength α, assuming that the client is correct.

Robustness analysis.
In this section we define the notion of a 'cash-insensitive' agent and generalize the implied alpha relationship to the utility function case. This illustrates the robustness and limits of the proposed codebook.
Define the state variables dL t = l t dt dK t = − (p t l t + c t (l t )) dt (3.15) The second variable represents the client's cash position at time t. If we define her wealth process as X t = p t L t + K t then it verifies the standard dynamics dX t = L t dp t (3.16) The proposed decomposition has a clear economic meaning: the agent calculates her wealth by adding her cash K t and the marked-to-the-mid value of her asset position L t . This means that a 'cash-insensitive' objective function would be of the standard form with τ a stopping time adapted to the client's filtration and U her utility function. The special form guarantees that the client does not differentiate between wealth in cash and wealth in the asset. An agent concerned with the liquidity of the asset would not be 'cash-insensitive'. One could generalize the utility framework to 'cash-sensitive' agents by considering a utility function of the form U (L τ , K τ , p τ ). In this case, the below result would not hold. The new Hamiltonian becomes: where the dual variables satisfy in the 'cash-insensitive' case the BSDEs The optimal execution strategy therefore verifies: which can be rewritten in a manner very similar to (3.3): is a legitimate change of measure if ∂ X U (X τ , p τ ) is positive and integrable. In the case where τ is exponential and independent of the price process, we simply recover (3.3) under a different probability measure. Given that we assume all the clients to have differing probability measures anyway, we can without loss of generality stick to (3.3).
The above computation is somewhat formal, but can be made rigorous by giving explicit integrability assumptions on τ such that the growth condition (A.2) is verified. This is in particular the case when τ is independent of p and has exponential moments, or if τ is bounded.

Reworking the Market Maker's <odel
In this section, we work under the measure P and often drop the superscrip 0 referring to the market maker. Our goal is to provide an optimal market making strategy. Because of its complexity, the problem cannot be solved in full generality, and we propose a set of approximations which we justify on financial grounds.
The next four subsections identify a succession of simplifications guided by intuition based on the behavior of a typical market maker: (1) First, he should 'not hold a view on the market'. Mathematically speaking, this means that in his model for the price, the main explanatory variables are his client's beliefs. The error associated to this first simplification is proved to be small, though a function of the market maker's control. (2) Second, he should model how his clients' views might evolve into the future. A straightforward system of correlated Ornstein-Uhlenbeck processes is proposed to serve this purpose. This will be used to define an approximate objective function for the market maker. (3) The third approximation is made for mathematical convenience: we assume that the market maker has an infinite number of clients. This leads to the previous models becoming SPDEs. (4) Finally, a placeholder function is proposed to model the source of error identified in the first subsection.
4.1. Approximate Price Process. As the market maker should not hold a view on the market, we refrain from directly modeling p t under the market maker's measure and filtration. Instead, the market maker constructs his model from the client's implied alphas. This is done in the following fashion: Equation (3.14) can be turned around to describe price dynamics using the implied alpha of client i under P: and this equation holds true for all i. Notice that there is no contradiction with the uniqueness of the Itô decomposition: these representations correspond to the same Itô process rewritten in terms of the variable α i t . Using a sequence of positive and constant weights λ i averaging to 1 (i.e. such that (1/n) n i=1 λ i = 1), we obtain: Again, this equation is just a reformulation of the Itô decomposition of p t . The advantage of that rparticular epresentation is that the first term is adapted to F 0 t t≥0 . Hence, if he also knows (or rather, chooses) the weights λ i i=1...n , then the market maker can follow the first term of this decomposition in real time. We introduce the special notation p λ t for this term and we refer to it as his price estimator: So: The remainder which we denote λ t includes quantities that are unknown to him since If we replace p by p λ in the market maker's problem, the only difference appears in the objective function, which now contains an extra term. We refer to is as the error term: on the market maker's objective function. Next we define This quantity is a measure of how 'noisy' client i is, and can be estimated by fitting the expression for the implied alpha to historical data. To be more specific, recall that under the client measure and filtration, and that θ i t is the error on this estimation. Hence, the smaller θ i t , the closer the implied alpha is to the realized one, which means that he client is particularly well informed. Note that in the finance literature, clients are often called informed if their market impact function (their average alpha) is unusually large. Our notion of intelligence of the price process does not coincide with this practice, as one can have at the same time a systematically small though correct alpha. In this paper, an informed trader is a trader for whom the implied and realized alphas nearly coincide, whereas for a noise trader, relationship (3.3) has much higher variance (due, for example, to liquidity concerns, a strongly non-linear utility function, or a poor filtration). The β i and σ i can be estimated from historical data by regressing the implied alpha against the realized one, that is for example by solving the least squares regression problem where the t k are the times in the past at which client i traded.
A skilled market maker can therefore construct his approximate price process by choosing a λ which puts most of its weight on such intelligent clients and little weight on noise traders with large σ i 's.
Using Cauchy-Schwartz's inequality and the particular choice of weights and assuming L t is uniformly bounded by a constant L, we obtain: (4.10) I can therefore be seen as a measure of the aggregate intelligence the clients have over the price process. Note that it suffices for one σ i to be of order for I to be of order −1 . By Girsanov's theorem, we then have that and finally, Two important remarks are in order at this point. First, as long as at least one agent is well informed, I −1 is small. Second, the dependence of p and α i upon the market maker's control γ is hidden in the Radon Nykodym derivative To understand why it is (unfortunately) reasonable to assume that this term may be strongly dependent upon γ is because a client can use the information on the order book γ publicly available as one of the sources of information he uses to form his probability measure on the price. This problem will be addressed in the last subsection.

Approximate Objective Function.
In this subsection, we take a crucial methodological step. Instead of maximizing we assume that the market maker maximizes the approximate objective function subject to a constraint of the form |err| 2 ≤ C for some constant C > 0. The new objective function was obtained by replacing dp t by dp λ t and integrating by parts. Because of our choice of the form of the approximate price (4.3), the market maker's objective function does not depend upon p t anymore, and he only needs to model the client belief distribution. This is consistent with the intuition that a market maker should not hold a view on the market. Rather, he should model the behavior of his clients with respect to each other, and price according to the information they provide. This is exactly the approach used in what follows.
However, we still need to propose a model for the α i t . For reasons of tractability we choose them as correlated Ornstein-Uhlenbeck processes: with ρ > 0 and the M i Wiener processes which are independent of each other and of W . √ σ 2 + ν 2 is the overall volatility level of a client, and ν the volatility that is due to some common information amongst client s(for example, the movement of the midprice). The next step of our strategy is to introduce a penalization term to account for the possible feedback effects hidden inside the error term introduced when replacing the objective function by its approximation. But first, we take the limit n → ∞ to identify effective equations providing informative approximation to the properties of the original system comprising finitely many clients.

Infinitely Many Clients.
Assume that the number of clients of the market maker is large enough to justify an approximation in the asymptotic regime n large. This will greatly improve the tractability of the model by allowing us to work in function spaces and rely on stochastic calculus tools to solve the model. The mainstay of this subsection is the Stochastic Partial Differential Equation (SPDE for short): describing the dynamics of an infinite dimensional measure valued Ornstein-Uhlenbeck process. The following lemma links this macroscopic SPDE to our microscopic Orstein-Uhlenbeck model for the implied alphas.
Proposition 4.1. If ( i ) i≥1 is a sequence of random variables such that (α i 0 , i ) i≥1 is an iid sequence independent of W and the sequence (M i ) i≥1 , and such that the joint distribution, say m, of all the couples (α i 0 , i ) satisfies: for all p > 0, then for each t ≥ 0, the limit exists almost surely in the sense of weak convergence of measures, almost surely for every t ≥ 0 it holds: for every p > 0, and the measure valued process (ν t ) t≥0 is a weak solution of the SPDE (4.16) in the sense that for any twice continuously differentiable function f (i.e. f ∈ C 2 ) such as f and its two derivatives have at most polynomial growth, we have that Furthermore, for each t > 0, the measure v t possesses an L 2 density almost surely.
Proof. See appendix.
The papers [13,12] provide similar results for a more general class of microscopic models, including existence and uniqueness of the solution of the SPDE (4.16). However, given the simple form of the dynamics chosen in our particular model, we can provide an explicit form for the solution and detailed properties on the nature of its tails. Note that the correlation between client beliefs is crucial in having a fully stochastic model, given that for ν = 0, ν t only satisfies a deterministic partial differential equation.
We shall use four measure valued solutions of the above SPDE. In each case, the weights i are explicit functions of the parameters σ i and β i introduced earlier. Because the values of these parameters appear as outcomes of statistical estimation procedures in practice, assuming that they are random and satisfy some form of ergodicity is not restrictive 3 . To construct these measures we assume that (α i 0 ) i≥1 is an iid sequence of random variables whose common distribution has finite moments of all orders. The first of our four measures is obtained by choosing i ≡ 1 for all i ≥ 1. Then: Next we assume that {(σ i ) −2 } i≥1 is a sequence of positive random variables of order 1 such that is an iid sequence independent of W and the sequence (M i ) i≥1 , so by choosing i = (σ i ) −2 for all i ≥ 1 we can define: We shall also assume that the number I = E[(σ i ) −2 ] is finite and strictly positive, and for each t ≥ 0 we define the non-negative measure λ t by: Finally, we assume that (β i ) i≥1 is a sequence of bounded random variables such that {(α i 0 , (σ i ) −2 , β i )} i≥1 is an iid sequence independent of W and the sequence (M i ) i≥1 , so by choosing i = β i (σ i ) −2 for all i ≥ 1 we can define: We now make a few remarks on the properties shared by essentially all the solutions (v t ) t≥0 of the SPDE (4.16). For the sake of definiteness, we shall assume that (v t ) t≥0 is a non-negative measure valued process solving this SPDE.
(1) The total mass 1, v t of the measure v t is constant over time. Indeed, using the constant test function f ≡ 1 in (4.16) we see that d 1, v t = 0 (4.25) In particular, the intelligence assumption I = 1, I 0 ≥ −1 is conserved over time.
(2) If we use the test function f = id in (4.16) where the identity function id is defined by id(α) = α, then we see that the first moment of v t is itself an Ornstein-Uhlenbeck process mean reverting around 0 since: (3) Using f = id 2 we see that the second moment mean reverts around σ 2 + ν 2 1, v 0 since: These Stochastic Differential Equations (SDEs for short) guarantee the existence of a constant C 1 such that: . We shall use these estimates for the measures µ t , λ t and β t . In fact similar estimates hold for moments of all order as can be proved by induction from (4.16). We do not give the details as they will not be used in what follows.
Coming back to the optimal control problem of the market maker, since γ t belongs to a space of probability measures whenever the control (γ t ) t≥0 is admissible, the following estimates hold: As an immediate consequence of the above remarks we have: For any progressively measurable process (γ t ) t≥0 such that γ t is a probability measure, the state dynamic equation of the market maker: makes sense, and for sufficiently large β, the approximate objective function whereᾱ t = id, λ t , is well defined.

4.4.
Modeling the Error Term. As argued in the first subsection, the approximation technique hinges on one hypothesis: the existence of at least one ' -intelligent' client. Furthermore, the clients probability measure (by which we mean the distribution of the clients implied alphas) is potentially a function of the market maker's control. This causes an undesirable nonlinear feedback effect which needs to be reined in to avoid explosion of the approximation error. In this subsection we propose a direct description of the error term, leaving open the question of how to derive it from a specific model of the clients probability measures. Intuitively, the feedback effect corresponds to how much new information the order book shape reveals to the clients. The clients' beliefs at time t can be summarized by the probability measure µ t and the order book by γ t . A reasonable model for the error term is given by the expression where H(ν|µ) denotes the Kullback-Leibler distance (also known as relative entropy) defined by with f (x) = x log x . Note that H(ν|µ) is minimal for γ t = µ t by convexity of f . As explained in the introduction, we choose this particular distance for its intuitive interpretation and the fact that it leads to an explicit expression for the two hump order book shape endogenous to the model. However, the results hold for general strictly convex functions f , in which case the pseudo-distance H defined in (4.31) is known as the f-divergence between the measures µ and ν. See [8].

The Market Maker's Control Problem
With all the pieces of our model in place, we now solve the market maker's control problem. 5.1. Model Summary. We consider a sequence β i , (σ i ) −2 i≥1 of random variables such that the assumptions of Proposition 4.1 are satisfied with i ≡ 1, i = (σ i ) −2 and 1 = β i (σ i ) −2 respectively, so that the measure-valued processes (µ t ) t≥0 , (λ t ) t≥0 and (β t ) t≥0 constructed in (4.21), (4.23) and (4.24) are well defined.
As explained earlier, the market maker's control at time t is the convex function γ t , and given our choice of penalizing terms, we expect its second derivative γ t to be a probability measure absolutely continuous with respect to µ t in order to avoid infinite penalties. So we refine the definition of the set A of admissible controls for the market maker as the set of random fields (g t (x)) t≥0,x∈R such that (g t (x)) t≥0 is progressively measurable for each x ∈ R fixed, and g, µ t = 1 for each t ≥ 0. Given an admissible control g ∈ A, we define the function γ t as the anti-derivative of the function γ (α) = g t 1 [0,α] , µ t satisfying γ t (0) = 0. The objective of the market maker is to choose an admissible control in order to maximize his modified objective function defined as: where the controlled dynamics of the state L t of the system are given by: We used the functions γ t and γ t for consistency with earlier discussions. See below for forms of the state dynamics and market maker objective function written exclusively in terms of the density g t ).
The above quantities are well-defined because of the estimates proven for the measures µ t , λ t and β t solving the SPDE.

5.2.
Solving the Market Maker Control Problem. We denote by Y the adjoint variable of L so that the generalized (random) Hamiltonian of the problem can be defined as for any deterministic function g as long as we define γ and γ by γ (α) = g t 1 [0,α] , µ t and γ(α) = α 0 γ (α)dα. Note that in the above expression of the Hamiltonian, g is determinist and does not depend upon t, but γ t which is the cumulative distribution function of the probability measure γ t with density g with respect to µ t is random and depends upon t. Clearly, so is γ t . This Hamiltonian can be rewritten as H(t, L, g, Y ) = e −βt L id, β t − βµ t + e −βtH (g) (5.4) where the modified HamiltonianH is defined bỹ and the other terms do not depend upon the control. Since the stochastic maximum principle proven in appendix says that we can look for the optimal control by maximizing the Hamiltonian, we shall maximize the modified Hamiltonian. For each choice of the admissible control (g t ) t≥0 , we consider the corresponding state process (L t ) t≥0 given by (5.2) and the adjoint equation: Since the derivative of the Hamiltonian with respect to the state variable L does not depend upon the control or the state L, the adjoint process can be determined independently of the choice of the admissible control (g t ) t≥0 and the associated state (L t ) t≥0 solving (5.2). Given the explicit formulas we have derived for µ t , we obtain: Lemma 5.1. The solution to the adjoint Backward Stochastic Differential Equation (5.5) is given by: 6) and it verifies the growth condition (A.6).
Proof. The exact form (5.6) of the solution can be guessed by going back to the explicit system of finitely many Ornstein-Uhlenbeck processes and taking the limit. However, for the proof, we show that the process (Y t ) t≥0 given by (5.6) is the solution by direct inspection, computing the Itô differential of Y t defined by (5.6) and using the fact that the random measures β t and βµ t also solve the SPDE (4.16). Using (4.26), we get: and by the growth properties of the first moment, lim t→∞ Y t = 0. Moreover, Z t = e −βt ν/(β + ρ) clearly verifies the growth condition (A.6).
The form of the modified Hamiltonian justifies the introduction of the quantity: so that, if we compute the modified Hamiltonian along the path of the adjoint process we get: t can be viewed as the shadow alpha of the market maker. 4 The first term in the definition of α * t is the average belief for alpha under the weighted client measure λ t , while the second term takes into account mismatches in the time-horizons of the clients. For each t ≥ 0, we define the profitability function m t by: (5.8) For each α ∈ R, (m t (α)) t≥0 is a progressively measurable stochastic process and for each fixed t ≥ 0, the function α → m t (α) is almost surely continuous in α, except for a possible jump m t (0 + )−m t (0 − ) at α = 0. m t is bounded and vanishes at the infinitives because of the integrability property (4.19) of the solutions of the SPDE. The profitability function quantifies the expected profit for an order placed at time t at the price level α. Indeed, the absolute value |α − α * t | is equal to the spread the market maker expects to gain per filled order, and up to a possible change of sign, the term µ t ([α, ∞)) − 1 (−∞,0] (α) is equal to the proportion of clients that will fill the order. If the arrivals of the agents of our model occurred according to a Poisson process instead of simultaneously, this would be the filling probability of the order. The respective contributions of these two terms are commonly parsed by practitioners. Notice also that, in the degenerate case = 0, the profitability function is the derivative of the Hamiltonian in the direction of the control.
We now identify the modified Hamiltonian in terms of the control g without involving the antiderivatives γ t an γ t .
Lemma 5.2. For each t ≥ 0, we have the identity Proof. Successive integrations by parts and simplifications yield: We can now state and prove the main result of this section: Theorem 5.3. The solution to the market maker's control problem is given by The quantity in the right hand side of can be seen as the change of measure from the distribution of the clients alphas to the order book of the market maker.
Proof. Using Lemma 5.1 and equation (5.9) enables us to rewrite the modified Hamiltonian as: which we need to maximize for each fixed t ≥ 0, over g ∈ L 1 (µ t ) with g, µ t = 1 and g ≥ 0. Again, for each fixed t and almost surely, by convexity of f ,H is concave in g and bounded from above, so thatM = sup AtH (g) exists and is finite. Let (g n ) n≥1 be a maximizing sequence in A t , i.e. a sequence of admissible g n such that H(g n ) → M . By Komlos's lemma (see for example [9]), there exists a subsequence g φ(n) and an element g ∞ ∈ L 1 (µ t ) such that 1 n n i=1 g φ(ψ(i)) → g ∞ µ t -a.e. as n → ∞ for any subsequence of the original subsequence. Clearly, g ∞ ≥ 0 µ t almost everywhere. To prove g ∞ , µ t = 1 we show uniform integrability of {g n } n using De la Vallée-Poussin's theorem (see [15]). Indeed, by definition of the maximizing sequence, H(g n ) ≥M − 1 for large enough n. Hence f • g n , µ t ≤ −M + 1 + ||m t || ∞ . f is non-negative, convex, increasing on [1, ∞) and verifies lim x→∞ 1 x f (x) = ∞. This concludes the proof of the admissibility of g ∞ as a control. Finally, by concavity of the modified Hamiltonian, the supremum is attained at g ∞ .
We now characterize the maximal element we just constructed. We introduce a Lagrange multiplier η ∈ R to relax the problem to the set of g ∈ L 1 (µ t ) such that g ≥ 0, so that the Lagrangian reads:L (g) = (m t − η)g − f • g, µ t (5.12) Classical variational calculus yields the optimality condition for some η. The existence and uniqueness of a Lagrange multiplier renormalizing g is obvious given the explicit formula for (f ) −1 . We conclude that g is the desired optimum. Figure 1. Graph of a simulated profitability curve m with α * ≈ −0.33. The maximum profitability is only 5% of the volatility used to simulate prices. The average spread being comparable to the volatility (see [18]), this means that the market maker's margins are very thin in this simulation.

5.3.
Interpretation. Figure 1 and Figure 2 illustrate what the market maker does: (1) He tries to stick to a shape not too far away from µ t , his client alpha distribution. This is to avoid feedback effects and associated errors on the price estimation. (2) He also takes into account the profitability function m t , which leads him "to make a big hole" in the center of the distribution µ t .
The combined effects lead to the familiar "double hump" shape of the order book, as seen in [18]. Other consequences of the liquidity formula are (1) In the limit where one client is perfectly intelligent of the price ( → 0), the market maker places a Dirac mass on the order book. In particular, he only trades on profitable sections of the book. (2) In the noise trade limit ( → ∞), the market maker simply reproduces the client alpha distribution. (3) If the return distribution of the asset is mean-reverting (which is not the case for options with maturities, for example), then so will µ t and hence γ t and c t . In the case of a European option, γ t converges to a Dirac at the payoff at maturity.

Conclusion
In this paper, we propose an equilibrium model for high frequency market making. We show that each client chooses his level of trade by an expected discount of future prices according to his beliefs. We call this the implied alpha of the client. This relationship can be used as a codebook to link trade and price dynamics. The different clients can be differentiated according to the time scales of their implied alphas and the variances of the errors they make estimating the price. This leads to an expression for the latter that the market maker can use to avoid having his own view on the market. He can then construct a profitability curve which dictates which sections of the order book are the most profitable. In solving the market maker optimization problem, we use a penalizing term to smooth the objective function and capture possible feedback effects. All these result in a tractable framework in which we can solve the market maker's control problem and identify the equilibrium order book dynamics.

Appendix A. A convenient form of the stochastic maximum principle
We present a form of the Pontryagin stochastic maximum principle tailored to the needs of the analysis of Section 5. The set-up is quite general, following loosely [17] Chapter 3. We assume that (Ω, F, (F t ) t≥0 , P) is a filtered probability space, (F t ) t≥0 is generated by a Wiener process (W t ) t≥0 , and we let A t (ω) be such that for all (t, ω), A t is a Borel convex subset of a Polish topological vector space E, adapted to (F t ) t≥0 . The admissible control processes (α t ) t≥0 are the progressively measurable processes in E such that α t ∈ A t for all t ≥ 0. We also assume that the dynamics of the controlled state X are governed by an Ordinary Differential Equation(ODE) with random coefficients valued in R n : where the coefficient f : (ω, t, X, a) → f t (X, a) is Lipschitz in X uniformly in all the other variables. Assume an estimate of the form where C is a constant. We also assume that f is continuously differentiable (i.e. C 1 ) in X. The controller's objective function is given by where τ is a stopping time adapted to (F t ) t≥0 and j and g are random real-valued concave functions which are C 1 in X. Furthermore, we assume that j, g and τ are such that E [|g τ (X τ )|] and E τ 0 |j t (X t , α t )|dt are finite and uniformly bounded from above. Next, we define the Hamiltonian H t (ω, X, a, Y ) = f t (ω, X, a)Y + j t (ω, X, a) (A.4) for Y ∈ R n and for each admissible control (α t ) t≥0 , the adjoint equation: with Y τ = ∂ X g(X τ ) and Z t such that E τ 0 |Z t | 2 dt < ∞. Under these conditions we have the following result. and for every t ≥ 0, almost surely, the function (X, α) → H t X t ,α t , Y t is concave, thenα is an optimal control, that is, J(α) ≤ J(α) for all admissible α = (α t ) t≥0 .
Proof. If (X t ) t≥0 is the state associated to another admissible control (α t ) t≥0 , we have the chain of relationships:  13) which guarantees that the local martingale part is a martingale. (A.10) holds by the concavity of the Hamiltonian. (A.11) is just the definition of H. Finally, (A.12) is a consequence of the fact that α t maximizes H t (X t , ·, Y t ).
Appendix B. Derivation of the SPDE (4.16) We give the main steps of the proof of Proposition 4.1. By independence of the common randomness W and the idiosyncratic randomness (M i , α i 0 , i ) i≥1 , we can freeze the randomness of W and work after conditioning with respect to F W , the σ-algebra generated by W , without affecting the independence properties of the idiosyncratic random variables. By independence of the M i , the α i 0 and i , we have that, conditional on F W , the random variables are iid and Gaussian. So if f ∈ C 2 is such that f and its two derivatives have at most polynomial growth, given the assumption (4.17) on the joint distribution m of all the couples (α i 0 , i ), we can apply the law of large numbers and get: The other results can be derived directly from this explicit representation.