{'fraction_non_alphanumeric': 0.03609941756530765, 'fraction_numerical': 0.006458681736924053, 'mean_word_length': 4.599612528253148, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dealing with multi-currency inventory risk in FX cash markets

In FX cash markets, market makers provide liquidity to clients for a wide variety of currency pairs. Because of flow uncertainty and market volatility, they face inventory risk. To mitigate this risk, they typically skew their prices to attract or divert the flow and trade with their peers on the dealer-to-dealer segment of the market for hedging purposes. This paper offers a mathematical framework to FX dealers willing to maximize their expected profit while controlling their inventory risk. Approximation techniques are proposed which make the framework scalable to any number of currency pairs.


Introduction
As all market makers, FX dealers are naturally portfolio managers. By providing liquidity to clients in multiple currency pairs, they build inventory and have to manage the ensuing inventory risk which is a subtle combination of uncertainty of the client flow, market liquidity and market price risk at the portfolio level.
The management of inventory risk in financial markets has been a topic of recent interest in the academic field of quantitative finance, starting with the seminal paper [1] by Avellaneda 1 and Stoikov who revived an old economic literature on the topic that dated back to the 1980s (see, for instance, Ho and Stoll [11]). Avellaneda and Stoikov paved the way to a long list of contributions. In a nutshell, 2 Guéant et al. provided in [10] a detailed analysis of the stochastic optimal control problem introduced in [1] and proposed closedform approximations of the optimal quotes. New features were then progressively added to get closer and closer to reality: several trade sizes, client tiering, risk externalization through hedging, etc. Cartea and Jaimungal, along with various coauthors, replaced in [7] the original expected utility framework of [1] by a more intuitive one closer to mean-variance optimization and added new features while studying the impact of parameters ambiguity in a series of papers.
To be used in practice, market making models need to take into account the dependence structure between assets since market makers or market making algorithms typically cover dozens or hundreds of assets. A mathematical framework for multi-asset market making has been proposed in [8,9], but computing the optimal quotes almost always requires to solve differential equations in very high dimension (the number of equations typically grows exponentially with the number of assets). Several techniques have been proposed to tackle the curse of dimensionality: the use of a few numbers of risk factors, the use of neural networks and reinforcement learning techniques, and the use of a reduction technique toward a linear-quadratic control problem (see [4]) that provides surprisingly good approximations of the optimal market making strategy.
Existing multi-asset market making models consider assets labelled in the same currency. This is typically consistent with the problem faced by market makers in most asset classes (e.g. corporate bonds in Europe or in the US). However, the problem faced by FX dealers is different: each currency pair provides indeed a valuation of one currency in terms of the other. The inventory of a given currency is usually managed in the most liquid, so-called direct currency pair, typically against USD. However, non-USD pairs, so-called crosses, are also very important. The presence of crosses introduces both complexity and opportunities since there are several ways to achieve the same result (e.g. buying EURGBP is equivalent to buying EURUSD and selling GBPUSD). Our model is, to our knowledge, the first to address the problem faced by an FX dealer who quotes a wide variety of currency pairs, including crosses, and can mitigate inventory risk by hedging on dealer-to-dealer (D2D) and/or all-to-all platforms. In particular it answers subtle questions where liquidity and correlation issues are intertwined, e.g. for positively correlated EURUSD and GBPUSD legs, what should be the spread of EURGBP? How should it compare to the sum of leg spreads? How to attract offsetting client flow or deter risky client flow in an optimal way when the marker maker is active in both direct pairs and crosses? How to optimally hedge the portfolio when trading platforms exist for direct pairs and some crosses?
As a consequence of FX market specific characteristics, our model differs from classical market making models in many ways, going from price dynamics to how trade sizes are defined, to the choice of the mathematically relevant state variables. To obtain optimal quotes and optimal hedging rates, one needs to solve a high-dimensional differential equation, but the techniques proposed in [4] can be adapted so that approximations of the optimal strategies can be obtained by solving a low-dimensional matrix Riccati-like differential equation (the dimensionality of the differential equations to solve only grows quadratically with the number of currencies, hence linearly with the maximal number of currency pairs).
We start by presenting our multi-currency market making model and show that, through a smart choice of the state variables, the problem boils down to solving a partial differential equation. We then demonstrate how the ideas developed in [4] can be adapted to approximate the true value function in closed form up to the computation of the solution of a matrix Riccati-like differential equation. We hereby claim that our approach is sufficiently scalable for practical use since the size of the (square) matrix mentioned above corresponds to the number of currencies. We further discuss the relevance of our closed-form approximations and illustrate numerically the resulting market making strategy in a market with 5 major currencies: USD, EUR, JPY, GBP and CHF. In particular, we demonstrate how correlated currency pairs are engaged through pricing and hedging when managing the risk in a single pair and show the impact of the presence of several currency pairs on the internalization vs. externalization dilemma faced by FX dealers [5]. With the help of Monte Carlo simulations, we confirm that the inventory probability distribution is shaped up by the portfolio risk profile and that the observed risk autocorrelation time is much shorter than any of the currency pair position autocorrelation times, leading to cost savings.

Description of the framework
The market and the dealer We consider a market with d currencies and an FX dealer in this market over a time interval of length T . The dealer trades currency pairs through two channels: with clients at prices streamed electronically, and with other dealers on the D2D segment of the market or on all-to-all platforms.
Exchange rates In order to model exchange rates, we consider throughout this paper that currency 1 (which typically stands for USD) is the reference currency and we introduce d stochastic processes denoted by (S 1 t ) t∈[0,T ] , . . . , (S d t ) t∈[0,T ] that model the market price of each of the d currencies in terms of the reference one (in particular, S 1 t = 1 for all t ∈ [0, T ]). Then, the market exchange rate of any currency pair can be deduced from the market exchange rates of the two currencies with respect to currency 1.

Streamed pricing ladders and clients demand for currency pairs
The dealer divides their clients into N tiers and streams them pricing ladders at the bid and at the ask for each currency pair, i.e. exchange rates for each side and different sizes. Mathematically, we introduce for each couple (i, j) ∈ {1, . . . , d} 2 and each tier n ∈ {1, . . . , N } a R * + −marked point process J n,i,j (dt, dz) modelling transactions with clients from tier n regarding the currency pair (i, j), where z is the size variable measured in reference currency. Formally, if J n,i,j (dt, dz) has a jump corresponding to size z at time t, it means that the market maker sells to the client a "quantity" z/S j t of currency j and receives in exchange a payment in currency i in line with the corresponding streamed pricing ladder. To build our model, we assume that this payment is decomposed into a "quantity" z/S i t of currency i and fees, denoted by zδ n,i,j (t, z), that are accumulated on a separate account labeled in reference currency -hence δ n,i,j represents the markup (possibly negative) in percentage or basis points. The process J n,i,j (dt, dz) has an intensity kernel (ν n,i,j Moreover, the dynamics of the account where fees and execution costs are accounted for is Regarding the dynamics of market exchange rates, we assume that is a deterministic drift, σ i ≥ 0 is the volatility of currency i with respect to the reference currency, k i is a linear permanent market impact parameter, 5 and It is convenient for what follows to use vector and matrix notations: Given this dynamics for prices, we conclude that for all i ∈ {1, . . . , d}, the process corresponding to the inventory of currency i measured in reference currency has the following Markovian dynamics: In what follows, we denote by

Optimization problem
The FX dealer wants to maximize the Mark-to-Market value of their portfolio at time T , while mitigating inventory risk. Mathematically, we assume that they want to maximize over the admissible pricing (δ n,i,j ) 1≤n≤N,1≤i =j≤d and execution (ξ i,j ) 1≤i<j≤d controls, where γ > 0 represents the risk aversion of the market maker and is a penalty for the remaining inventory at time T . 6

Towards optimal quotes
Hamilton-Jacobi-Bellman equation and optimal quotes Applying Ito's formula to the process allows us to see that the above optimization problem is equivalent to maximizing . 5 We only consider the impact of our trades on the D2D segment of the market. Adverse selection could also be modeled through an impact of transactions with clients on the market exchange rates. Modeling adverse selection in a realistic and implementable way is in fact an active field of research. 6 could account for the market impact when unwinding.
This optimization problem can be addressed with the tools of stochastic optimal control. We denote by θ : [0, T ] × R d → R the value function of this stochastic control problem. The associated Hamilton-Jacobi-Bellman equation is Tr D(y)ΣD(y)D 2 yy θ(t, y) where and D(y) denotes the diagonal d × d matrix such that D(y) i,i = y i for all i ∈ {1, . . . , d}.
It is proved in [9] that for all (n, i, j), the supremum in the definition of H n,i,j (z, p) is reached at a uniquē δ n,i,j (z, p) = (f n,i,j ) −1 −∂ p H n,i,j (z, p) and this function can easily be computed numerically in the logistic case we consider. If θ is known, we therefore obtain the optimal quotes in the following form Similarly, the optimal trading rates are given by

Approximation of the value function and optimal quotes
Following the same ideas as in [4], we now approximate for n ∈ {1, . . . , N } and for each couple (i, j) ∈ {1, . . . , d} 2 with i = j the Hamiltonian function H n,i,j by a quadratic functionȞ n,i,j : where a natural choice is of course α n,i,j 0 (z) = H n,i,j (z, 0), α n,i,j 1 = ∂ p H n,i,j (z, 0), and α n,i,j 2 = ∂ 2 pp H n,i,j (z, 0). The structure of the problem leads us to approximate the Hamiltonian terms associated with H i,j by 0 since H i,j is typically flat around 0 when ψ i,j > 0.
We then consider the new equation If (y) = y κy with κ a semi-definite positive symmetric matrix, then Eq. (4) has a solution of the form θ(t, y) = −y A(t)y − y B(t) − C(t) where t → A(t) ∈ S d , t → B(t) ∈ R d and t → C(t) ∈ R solve differential equations. As the value of C is irrelevant for what follows, we only report here the equations for A and B: where D(A) is a d × d diagonal matrix with the same diagonal as A.
The ODE system (5) involves a matrix Riccati-like differential equation whose solution can be approximated very easily using an Euler scheme (i.e. without suffering from the curse of dimensionality, unlike when using an inventory grid as in the case of the original Hamilton-Jacobi-Bellman equation). Once A and B are obtained, approximations of the optimal strategies can be computed by replacing θ byθ in Eqs. (2) and (3). We thereby obtainδ

Numerical results and discussion
Before illustrating the market making strategy proposed above, it is noteworthy that we have validated, when d = 2, our approximations against the optimal strategy computed thanks to the solution of Eq. (1) approximated with a monotone implicit Euler scheme on an inventory grid. Using parameters inspired from earlier work [2,3], we studied both the strategies and the corresponding efficient frontier. Only under extreme conditions which are not practically relevant, such as strong order flow asymmetry (as high as fivefold) and very high or very low risk aversion, have we detected significant deviations.
For our illustrations, we consider a market with 5 major currencies: USD, EUR, JPY, GBP and CHF. We considered two tiers and a discretization of trade sizes corresponding to 1, 5, 10, 20 and 50 M$ for all currency pairs. We used the parameters documented in Table 1 unless specified otherwise. These parameters have been selected by analysing a subset of HSBC market making franchise, as previously described in [3]. However, they should not be considered as representative of HSBC but rather of a typical FX dealer. Standard currency pair naming convention is respected except that we used CHFUSD and JPYUSD instead of USDCHF and USDJPY to be consistent with our model (USD being the reference currency in our examples).
In what follows, both the drift vector µ and the terminal penalty κ are assumed to be 0. The time horizon is set to T = 0.05 days (72 minutes) that ensures convergence towards stationary quotes and hedging strategy at time t = 0. In particular, to compute the market making strategy, we used A(0) and B(0) instead of A(t) and B(t) throughout to mimic what would happen in the stationary case. with a skew to attract risk-offsetting flow and divert risky flow. Without correlation and without the cross, EURUSD pricing would be unaffected by GBP inventory. Here, instead, positive correlation leads to a protective pricing strategy for EURUSD. The pricing of the cross pair EURGBP also attracts or diverts the flow as a function of the GBP inventory, and this in turn influences the pricing of EURUSD.  Table 1: Parameters for the currency pairs. The correlation coefficient ρ provided for crosses describes correlation between the corresponding dollar-based legs. Size ladders are the same for all pairs in reference currency, i.e. z = 1, 5, 10, 20, 50 M$. Two client tiers with different α and β parameters (independent of z) are considered for each pair. Intensity amplitudes λ(z) are taken to be the same for each tier.   In line with intuition, the pure internalization zone is slanted because of correlation: it is not always optimal for a dealer to start hedging externally when positions in correlated currencies already mitigate part of the risk. The pure internalization zone is even more slanted in the presence of the cross pair which can attract client flow on its own and limit the necessity to hedge externally. Interestingly, the presence of the cross influences the internalization zone even without correlation: it is slanted and not horizontal even when ρ = 0.

Direct pairs
Once the optimal strategy has been computed, one can follow [3] and simulate the inventories resulting from the use of the market making strategy via standard Monte Carlo procedure. Fig. 4 illustrates the probability distribution of inventories in EUR and GBP in the case of a market with the three currencies USD, EUR and GBP. This empirical distribution is superimposed onto the risk contour plot and we clearly see that risk drives the inventory distribution. Fig. 5 returns to the case of a market with the 5 currencies and shows that the inventory autocorrelation functions of individual pairs decay much slower than the risk autocorrelation function. This means that the dealer is able to offload risk fast while essentially trading slower and thus saving on impact and transaction cost. The figure also provides information on volume share, P&L share and internalization ratio. The latter is consistent with previously reported typical internalization levels of about 80% for G10 currencies by top-tier banks [12].

Concluding remarks
We have introduced and analyzed in detail a multi-currency market making model incorporating fundamental risk controls taking into account correlations, client tiering, pricing ladders and external hedging with transaction costs and market impact. Approximation techniques are proposed which make the framework scalable to any number of currency pairs and thus offering immediate practical application to the FX industry. The results obtained demonstrate efficient risk reduction due to optimization at portfolio rather than individual currency pair level.

Statement and acknowledgment
The results presented in this paper are part of the research works carried out within the HSBC FX Research Initiative. The views expressed are those of the authors and do not necessarily reflect the views or the practices at HSBC. The authors are grateful to Richard Anthony (HSBC) for helpful discussions and support throughout the project.