The microscopic relationships between triangular arbitrage and cross-currency correlations in a simple agent based model of foreign exchange markets

Foreign exchange rates movements exhibit significant cross-correlations even on very short time-scales. The effect of these statistical relationships become evident during extreme market events, such as flash crashes. Although a deep understanding of cross-currency correlations would be clearly beneficial for conceiving more stable and safer foreign exchange markets, the microscopic origins of these interdependencies have not been extensively investigated. This paper introduces an agent-based model which describes the emergence of cross-currency correlations from the interactions between market makers and an arbitrager. The model qualitatively replicates the time-scale vs. cross-correlation diagrams observed in real trading data, suggesting that triangular arbitrage plays a primary role in the entanglement of the dynamics of different foreign exchange rates. Furthermore, the model shows how the features of the cross-correlation function between two foreign exchange rates, such as its sign and value, emerge from the interplay between triangular arbitrage and trend-following strategies. In particular, the interaction of these trading strategies favors certain combinations of price trend signs across markets, thus altering the probability of observing two foreign exchange rates drifting in the same or opposite direction. Ultimately, this entangles the dynamics of foreign exchange rate pairs, leading to cross-correlation functions that resemble those observed in real trading data.


Introduction
Various non-trivial statistical regularities, known as stylized facts [1], have been documented in trading data from markets of different asset classes [2]. The available literature examined the heavy-tailed distribution of price changes [3][4][5][6], the long memory in the absolute mid-price changes (volatility clustering) [4,[6][7][8][9][10], the long memory in the direction of the order flow [10][11][12][13] and the absence of significant autocorrelation in mid-price returns time series, with the exclusion of negative, weak but still significant autocorrelation observed on extremely short time-scales [6,9,[14][15][16]. Different research communities (e.g., physics, economics, information theory) took up the open-ended challenge of devising models that could reproduce these regularities and provide insights on their origins [2,17,18]. Economists have traditionally dealt with optimal decision-making problems in which perfectly rational agents implement trading strategies to maximize their individual utility [2,17,18]. Previous studies have looked at cut-off decisions [19][20][21], asymmetric information and fundamental prices [22][23][24][25][26] and price impact of trades [27][28][29][30]. In the last thirty years the orthodox assumptions of full rationality and perfect markets have been increasingly disputed by emerging disciplines, such as behavioral economics, statistics and artificial intelligence [17]. The physics community have also entered this quest for simple models of non-rational choice [17] by taking viewpoints and approaches, such as zero-intelligence and 1/32 arXiv:2002.02583v1 [q-fin.TR] 7 Feb 2020 Schematic of a LOB and related terminology. At any time t the bid price b t is the highest limit price among all the buy limit orders (blue) while the ask price a t is the lowest limit price among all the sell limit orders (red). The bid and ask prices are the best quotes of the LOB. The mid point between the best quotes m t = (a t + b t )/2 is the mid price. The distance between the best quotes s t = a t − b t is the bid-ask spread. The volume specified in a limit order must be a multiple of the lot size ς, which is the minimum exchangeable quantity (in units of the traded asset). The price specified in a limit order must be a multiple of the tick size δ, which is the minimum price variation imposed by the LOB. The lot size ς and the tick size δ are known as resolution parameters of the LOB [2]. Orders are allocated in the LOB depending on their distance (in multiples of δ) from the current best quote. For instance, a buy limit order with price b t − nδ occupies the n + 1-th level of the bid side.
The limit order with the best price (i.e., the highest bid or the lowest ask quote) is always the first to be matched against a forthcoming order. The adoption of a minimum price increment δ forces the price to move in a discrete grid, hence the same price can be occupied by multiple limit orders at the same time. As a result, exchanges adopt an additional rule to prioritize the execution of orders bearing the same price. A very common scheme is the price-time priority rule which uses the submission time to set the priority among limit orders occupying the same price level, i.e. the order that entered the LOB earlier is executed first [54].

Triangular Arbitrage
In the FX market, the price of a currency is always expressed in units of another currency and it is commonly known as foreign exchange rate (FX rate henceforth). For instance, the price of one Euro (EUR henceforth) in Japanese Yen (JPY henceforth) is denoted by EUR/JPY. The same FX rate can be obtained from the product of two other FX rates, e.g. EUR/JPY = USD/JPY×EUR/USD, where USD indicates US Dollars. In the former case EUR is purchased directly while in the latter case EUR is purchased indirectly through a third currency (i.e., USD), see that is, the costs of a direct and indirect purchase of the same amount of a given currency must be the same. Assuming that the arbitrager completes each transaction at the best quotes (i.e., sell at the best bid and buy at the best ask) available in the EUR/JPY, USD/JPY and EUR/USD LOBs, any strategy presented in Fig. 3 is effectively profitable if the following condition (i.e., Eq. (3a) for left panel strategy or Eq. (3b) for right panel strategy) is satisfied a EUR/JPY (t) < b USD/JPY (t) × b EUR/USD (t) (3a) b EUR/JPY (t) > a USD/JPY (t) × a EUR/USD (t) (3b) where b x/y (t) and a x/y (t) are the best bid and ask quotes available at time t in the x/y market respectively.
In the same spirit of [37,50,51], we detect the presence of triangular arbitrage opportunities when one of the following processes exceeds the unit.

The EBS Dataset
In this study, we employ highly granular LOB data provided by Electronic Broking Services (EBS henceforth Each record (i.e., row) corresponds to a specific market event. Records are reported in chronological order (top to bottom) and include the following details: i) date (yyyy-mm-dd), ii) timestamp (GMT), iii) the market in which the event took place, iv) event type (submission (Quote) or execution (Deal) of visible or hidden limit orders), v) direction of limit orders (Buy/Sell for deals and Bid/Ask for quotes), vi) depth (number of occupied levels) between the specified price and the best price, vii) price and viii) units specified in the limit order.
The shortest time window between consecutive records is 100 millisecond (ms). Events occurring within 100 ms are aggregated and recorded at the nearest available timestamp. The tick size has changed two times within the considered four years window, see [56] and Table S1 for further details. The EBS dataset provides a 24-7 coverage of the trading activity (from 00:00:00.000 GMT Monday to 23:59:59.999 GMT Sunday included), thus offering a complete and uninterrupted record of the flow of submissions, executions and deletions occurring in the first ten price levels of the bid and ask sides of the LOB. The EBS dataset, in virtue of its features, is a reliable source of granular market data. First, EBS directly collects data from its own trading platform. This prevents the common issues associated to the presence of third parties during the recording process, such as interpolations of missing data and input errors (e.g., incorrect timestamps or order types). Second, the EBS dataset offers a continuous record of LOB events across a wide spectrum of currencies, thus becoming a natural choice for cross-sectional studies (e.g., triangular arbitrage or correlation networks). Third, in spite of the increasing competition, the EBS platform has remained a key channel for accessing FX markets for more than two decades by connecting traders across more than 50 countries [57,58]. The enduring relevance of this 5/32 platform has been guaranteed by the fairness and the competitiveness of the quoted prices.

The Arbitrager Model
We introduce a new microscopic model (Arbitrager Model hencefort) in which market makers trade d = 3 FX rates in d = 3 inter-dealer markets. Trading is organized in LOBs and, for simplicity, prices move in a continuous grid. We enforce the assumption that market makers cannot interact across markets, that is, they can only trade in the LOB they have been assigned to. Finally, echoing [37], we include a special agent (i.e., the arbitrager) that is allowed to submit market orders in any market. Trading is organized in continuous price grid LOBs as in [42], see Section S3. Market makers (black agents) maintain bid (blue circles) and ask (red circles) quotes with constant spread (black segment). To adjust these quotes, market makers dynamically update their dealing prices (squares) by adopting trend-based strategies. The best quotes are marked by dotted lines (blue for bid and red for ask). Transactions occur when the best bid matches or exceeds the best ask. Market makers engaging in a trade close the deal at the mid point between the two matching prices (i.e., transaction price), see Fig. S4. Finally, we include an arbitrager (green agent) that exclusively submits market orders across the three markets to exploit triangular arbitrage opportunities emerging now and then. The actions of this special agent, affecting the events occurring in otherwise independent markets, entangle the dynamics of the FX rates traded in the ecology. Echoing [37], the ecology can be visualized as a spring-mass system in which the dynamics of three random walkers (i.e., the markets) are constrained by a restoring force (i.e., the arbitrager) acting on the center of gravity of the system.

Market makers
The i-th market maker operating in the -th market actively manages a bid quote b i, (t) and an ask quote a i, (t) separated by a constant spread L = a i, (t) − b i, (t). To do so, the i-th market maker updates its dealing price z i, (t) , which is the mid point between the two quotes (i.e., z i, (t) = a i, (t) − L /2 = b i, (t) + L /2), by adopting a trend-based strategy where N is the number of market makers participating the -th market, σ > 0, and i, (t) ∼ N (0, 1). The term is the weighted average of the last n < g t, changes in the transaction price p in the -th market, g t, is the number of transactions occurred in [0, t[ in the -th market and ξ > 0 is a constant term. The real-valued parameter c controls how the current price trend φ n, (t) influences market makers' strategies. For instance, c > 0 (c < 0) indicates that market makers operating in the -th market tend to adjust their dealing prices z(t) in the same (opposite) direction of the sign of the price trend φ n, (t).
Transactions occur when the i-th market maker is willing to buy at a price that matches or exceeds the ask price of the j-th market maker (i.e., b i, ≥ a j, ). Trades are settled at the transaction price p(g t, ) = (a j, (t) + b i, (t))/2 and only the market makers who have just engaged in a trade adjust their dealing prices z(t + dt) to the latest transaction price p(g t, ), see Figs. S3 and S4

The arbitrager
The arbitrager is a liquidity taker (i.e., she does not provide bid and ask quotes like market makers) that can only submit market orders in each market to exploit an existing triangular arbitrage opportunity. Assuming that agents exchange EUR/JPY, EUR/USD and USD/JPY, the triangular arbitrage processes are where b (t) and a (t) are the best bid and ask quotes at time t in the -th market. Whenever Eqs. (7a) or (7b) exceeds the unit, the arbitrager submits market orders to exploit the current opportunity (henceforth predatory market orders). Contrary to limit orders, market orders trigger an immediate transaction between the arbitrager and the market maker providing the best quote on the opposite side of the LOB. This implies that transactions involving the arbitrager are always settled at the bid or ask quote offered by the matched market maker, which are by the definition the current best bid or ask quote of the LOB. Following the post-transaction update rule, the matched market maker adjust its dealing price to its own matched bid or ask quote, that is, z i, (t + dt) → a i, (t) in case of a buy predatory market order or z i, (t + dt) → b i, (t) in case of a sell predatory market order, see

Cross-correlation functions
Echoing previous empirical studies [47, 48], we examine the shape of the cross-correlation function where the time-scale ω is the interval (i.e., in seconds) between two consecutive observations of the -th mid price m time series, ∆m (t) ≡ m (t) − m (t − ω) is the linear change between consecutive observations and σ ∆m is the standard deviation of ∆m (t). In real trading data we observe that the value of the cross-correlation function ρ i,j (ω) varies with ω on very short time-scales (ω < 1 sec). This time-scale dependency starts to weaken after ω ≈ 1 sec and vanishes beyond ω ≈ 10 sec, see Fig. 5(a). The characteristic shape of ρ i,j (ω) displayed in Fig. 5(a) is compatible with the one found by Mizuno et al. [47]. However, our trading data-based cross-correlation functions stabilize on much shorter time-scales. Considering that [47] employed trading data collected in 1999, a period where lower levels of automation imposed a slower trading pace, we hypothesize that the time-scale ω beyond which ρ i,j (ω) stabilizes reflects the speed at which markets react to a given event. Furthermore, ρ i,j (ω) stabilizes around different levels over the four trading years covered in our analysis. For instance, the cross-correlation between ∆USD/JPY and ∆EUR/JPY, see Fig. 5(a), stabilizes around 0.6 in 2011-2012 and 0.3 in 2013-2014. We assert that the variability in the stabilization levels of ρ i,j (ω) might be related to the different tick sizes adopted by EBS during the four years covered in this empirical analysis, see [56] and Table S1. Detailed investigations on how changes in the design of FX LOBs (e.g., tick size) and the increasing sophistication of market participants (e.g., high frequency traders) affect the characteristic shape of ρ i,j (ω) are outside the scope of this paper, however, such studies will be a very much welcomed addition to the current literature. The Arbitrager Model satisfactorily replicates the characteristic shape of ρ i,j (ω), suggesting that triangular arbitrage plays a primary role in the entanglement of the dynamics of currency pairs in real FX markets. We observe two quantitative differences between the characteristic shape of ρ i,j (ω) derived from simulations of the Arbitrager Model and real trading data. First, ρ i,j (ω) flattens after ω ≈ 30 sec in the model, see Fig. 5(b), and ω ≈ 10 sec in real trading data, see Fig. 5(a). Second, in extremely short time-scales (ω → 0 sec) the model-based ρ i,j (ω) does not converge to zero as in real trading data, see Fig. 5(b), but to nearby values. We assert that these discrepancies stem from the extreme simplicity of the Arbitrager Model which neglects various practices of real FX markets that contribute, to different degrees, to the shape and features of ρ i,j (ω) revealed in real trading data. To support this hypothesis, we developed an extended version of the Arbitrager Model which includes additional features of real FX markets, see Section S6. This more complex version of our model overcomes the main differences between the curves displayed in Fig. 5(a) and (b), reproducing cross-correlation functions ρ i,j (ω) that approach zero when ω → 0 sec and 8/32 stabilize on shorter time-scales than those emerged in the baseline model.

The interplay between triangular arbitrage and trend-following strategies intertwines FX rates dynamics
The Arbitrager Model, reproducing the characteristic shape of ρ i,j (ω), suggests that triangular arbitrage plays a primary role in the formation of the cross-correlations among currencies. However, it is not clear how the features of ρ i,j (ω), such as its sign and values, stem from the interplay between the different types of strategies adopted by agents operating in our ecology. Addressing this open question is one of the main objectives of the present study. We define the actual state of the j-th market ν j (t) as the sign of the current price trend sgn(φ n, (t)) ∈ {−, +}, see Eq. (6). It follows that the current configuration of the ecology q(t) = {ν 1 (t), ν 2 (t), ν 3 (t)} is the combination of the states of each market. Our model, considering three markets, admits 2 3 = 8 different ecology configurations. When the arbitrager is not included in the system, two markets have the same probability of being in the same and opposite state, see first column of Fig. 6. This occurs because price trends are driven by transactions triggered by endogenous decisions, that is, events occurring in different markets remain completely unrelated. As a consequence, market states flip independently and at the same rate. It follows that the eight possible combinations of market states share the same appearance probabilities 1/2 3 and expected lifetimes, see We find that the inclusion of the arbitrager increases the probability of observing EUR/USD and USD/JPY as well as EUR/USD and EUR/JPY in the same state and USD/JPY and EUR/USD in the opposite state. Furthermore, the active presence of this special agent intertwines the dynamics of different FX rates, creating cross-correlations functions that resemble those emerged in real trading data.
The inclusion of the arbitrager has a major impact on the overall behavior of the model. We notice the emergence of imbalances in the probability of observing two markets in the same or opposite state. For instance, the EUR/USD and EUR/JPY markets have the same state in ≈ 57% of the experiment duration, see Fig. 6(b). Movements of FX rate pairs become correlated, revealing cross-correlation functions ρ i,j (ω) whose shapes qualitatively mimic those found in real trading data. The sign and stabilization levels of these functions are consistent with the sign and size of the probabilities imbalances, suggesting that these two results are two faces of the same coin. To understand how the findings presented in Fig. 6 unfold we need to take a closer look at the statistical properties of the eight ecology configurations. The presence of the arbitrager introduces a degree of heterogeneity in both the expected lifetimes and appearance probabilities of ecology configurations, see Fig. 7. This reveals three interesting facts. First, the average lifetime of every ecology configuration is smaller than its counterpart in an arbitrager-free system. To explain this feature, we recall that predatory market orders trigger three simultaneous transactions (i.e., one in each market) altering the current price trends φ n, (t), see Eq. (6). When the latest change in transaction price p (g t, ) − p (g t, − 1) induced by a predatory market order and φ n, (t − dt) have opposite signs, the actions of 10/32 the arbitrager weaken (i.e., |φ n, (t)| < |φ n, (t − dt)|) or even flip the sign (i.e., φ n, (t)φ n, (t − dt) < 0) of the price trend. When this occurs, the arbitrager weakens the trend-following behaviors of market makers in at least one of the three markets, thus increasing the likelihood of a transition to another ecology configuration. As triangular arbitrage opportunities of both types appear, with different incidences, during any ecology configuration, see Fig. S15, the expected lifetimes of these configurations are, to different extents, shorter than in an arbitrager-free system. Second, certain ecology configurations are expected to last more than others (i.e., single episodes). As reactions to triangular arbitrage opportunities increase the likelihood of flipping a market state, the average lifetime of a given configuration relate to the time required for the first triangular arbitrage opportunity to emerge. For instance, the time between the inception and the first time µ I (t) or µ II (t) becomes larger than one never exceeds 4 sec for {−, −, +}, which is the configuration with shortest expected lifetime, while it can reach ≈ 6.5 sec for {+, +, +}, which is the configuration with longest expected lifetime, see Fig. S14(a). This difference can be intuitively explained by looking at the combination of market states. When the ecology configuration is {−, −, +}, EUR/USD and USD/JPY have the opposite state of EUR/JPY. In this scenario, the implied FX cross rate EUR/USD×USD/JPY moves in the opposite direction of the FX rate EUR/JPY, creating the ideal conditions for a rapid emergence of triangular arbitrage opportunities. Conversely, the three markets share the same state when the ecology configuration is {+, +, +}. In this case, both the FX rate and the implied FX cross rate move in the same direction, extending the time required by these prices to create a gap that can be exploited by the arbitrager. The third and final interesting fact emerged in Fig. 7 is that certain configurations are more likely to appear than others. To understand this aspect, we first highlight the significant differences between the probabilities of transitioning from a configuration to another, see Table S5. For instance, assuming that the system is leaving {+, +, +}, the probabilities of transitioning to {−, +, +} and {+, +, −} are 35.8% and 22.7%, respectively. This difference can be explained by the fact that it is much easier to flip the state of EUR/USD and move to {−, +, +} than flipping EUR/JPY and move to {+, +, −}. The value of the price trend φ n, (t) can be intuitively seen as the resistance to state changes of the -th market: the higher its value, the more the transaction price must fluctuate in the opposite direction to flip its sign. For each configuration, we sample the absolute value of this statistics at the emergence of any triangular arbitrage opportunity and normalize its average by the initial center of mass p (t 0 ), see Section S5, to make it comparable with the same quantity measured in other markets. For {+, +, +} we find that |φ n, (t)| /p (t 0 ) is substantially higher for EUR/JPY than EUR/USD and USD/JPY, see Such dynamics find an explanation in the fact that the market that has recently flipped its state, causing a departure from {+, +, +} towards {−, +, +} or {+, −, +}, can be easily flipped back again before its resistance to state changes φ n, (t) increases in absolute value. This happens when the arbitrager responds to a type 2 triangular arbitrage opportunity (i.e., µ II (t) > 1) when the ecology configuration is either {−, +, +} or {+, −, +}. The significant probabilities of returning to {+, +, +} stem from the interplay of two elements. First, triangular arbitrage opportunities are more likely to be of type 2 than type 1 in both {−, +, +} and {+, −, +}, see Fig. S15. Second, the markets with lowest resistance to state changes |φ n, (t)| /p (t 0 ) are EUR/USD for {−, +, +} and USD/JPY for {+, −, +}, see Fig. S17, which are exactly the states that should be flipped to return to {+, +, +}. The conditional transition probability matrix displayed in Table S5 reveals Fig. S16 shows this mechanism in action by displaying the sequence of ecology configurations during a segment of the model simulation. It is easy to observe how the system tends to move across configurations belonging to the same looping triplet for long, uninterrupted time windows. Ultimately, this peculiar mechanism increases, to different degrees, the appearance probabilities of configurations involved in these loops at the expenses of {−, −, +} and {+, +, −}.
To sum up, our model elucidates how the interplay between different trading strategies entangles the dynamics of different FX rates, leading to the characteristic shape of the cross-correlation functions observed in real trading data. The Arbitrager Model restricts its focus to the interactions between two types of strategies, namely triangular arbitrage and trend-following. Despite the simplicity of our framework, the interplay between these two strategies alone satisfactorily reproduces the cross-correlation functions observed in real trading data. In particular, trend-following strategies preserve the current combination of market states for some time while reactions to triangular arbitrage opportunities influence the behavior of trend-following market makers by altering the price trend signals used in their dealing strategies. The interactions between these two strategies constantly push the system towards certain configurations and away from others through multiple mechanisms. This can be easily seen in Fig. 7 as two distinct statistics, the average expected lifetimes and the appearance probability, put the eight configurations in the same order. For instance {+, +, +} has the longer expected lifetime but also the highest appearance probability. This force shapes the features of the statistical relationships between currency pairs. FX rates traded in markets that share the same state in configurations with higher (lower) appearance probabilities and longer (shorter) expected lifetimes are more likely to fluctuate in the same (opposite) direction. For instance, let us consider USD/JPY and EUR/JPY.

Discussion and outlook
The purpose of this study was to obtain further insights on the microscopic origins of the widely documented cross-correlations among currencies. We took up this challenge by introducing a new ABM, the Arbitrager Model, in which market makers adopting trend-following strategies provide liquidity in three independent markets and interact with an arbitrager. In these settings, our model reproduced the characteristic shape of the cross-correlation function between between fluctuations of FX rate pairs under the assumption that triangular arbitrage is the only mechanism through which the different FX rates become synchronized. This suggests that triangular arbitrage plays a primary role in the entanglement of the dynamics of currency pairs in real FX markets. In addition, the model explains how the features of ρ i,j (ω) emerges from the interplay between triangular arbitrage and trend-following strategies. In particular, triangular arbitrage influences the trend-following behaviors of liquidity providers, driving the system towards certain combinations of price trend signs and away from others. This affects the probabilities of observing two FX rates drifting in the same or opposite direction, making one of the two scenarios more likely than the other. Ultimately, this entangles the dynamics of these prices, creating the significant cross-currency correlations that are reproduced in our model and observed in real trading data. The present study, finding a common ground between previous microscopic ABMs of the FX market and triangular arbitrage [37,42,59], sets a new benchmark for further investigations on the relationships between agent interactions and market interdependencies. In particular, it is the first ABM to provide a complete picture on the microscopic origins of cross-currency correlations. The outcomes of this work open different research paths and raise new challenges that shall be considered in future studies. First, the Arbitrager Model could be further generalized by including a larger number of currencies, allowing traders to monitor different currency triangles. We assert that extending the number of available currencies could reveal new insights on i) statistical regularities related to the triangular arbitrage processes, such the distributions of µ I (t) and µ II (t), and ii) how the features of the cross-correlation function between two FX rates stem from a much more complex system in which the same FX rate is part of several triangles. Second, a potential extension of this model should consider the active presence of special agents operating in FX markets. For instance, simulating public interventions implemented by central banks could be a valuable exercise to understand how the large volumes moved by these entities affect the dynamics of the triangular arbitrage processes µ I (t) and µ II (t) and the local correlations (i.e., in the intervention time window) between currency pairs. Third, another interesting path leads to market design problems. In this study we have hypothesized a relationship between changes in the stabilization levels of the cross-correlation functions ρ i,j (ω) and the different tick sizes adopted by EBS in the period covered by the employed dataset. Calling for further investigations, we believe that an extended version of the present model should examine how different tick sizes affect the correlations between FX rates. We are confident that appropriate extensions and enhancements could turn the model into a valuable tool that could be used by exchanges, regulators and market designers. In particular, its simple settings would allow these entities to make predictions on how regulations or design changes could affect the relationships between FX rates and the properties (e.g., frequency, magnitude, duration, etc.) of triangular arbitrage opportunities in a given market. Furthermore, its applicability might attract the attention of other actors operating in the FX market, such as central banks. The ultimate objective of this work and its potential future extensions shall remain the provision of useful means to enhance the understanding of financial market dynamics, assisting the aforementioned entities in conceiving safer and more efficient trading environments.

Acknowledgments
We thank EBS, NEX Group plc. for providing the data employed in this study. Alberto Ciacci acknowledges PhD studentships from the Engineering and Physical Sciences Research Council through Grant No. EP/L015129/1. Alberto Ciacci and Takumi Sueshige thank Kiyoshi Kanazawa for fruitful discussions.  S2 Tick sizes adopted by EBS in the period 2011-2014 Table S1. Tick sizes adopted in the EBS market.  The Dealer Model [42] introduces a simple market ecology in which N agents interact in a single inter-dealer market where trading is organized in a LOB. For simplicity, the model assumes a continuous price grid, neglecting the role played by the tick size in real financial markets. Agents act as market makers by maintaining buy and sell limit orders through which they provide a bid and an ask quote to the market. Transactions occur when the i-th market maker is willing to buy at a price that matches or exceeds the ask price of the j-th market maker (i.e., b i ≥ a j ). Trades are settled at the transaction price p(g t ) = (a j (t) + b i (t))/2, where g t is the number of transactions occurred in [0, t[. We stress that the mid-price m(t) and the transaction price p(g t ) are two different quantities. The former, being the mid point between the best quotes, is the center of the LOB and can be tracked at any time step. The latter is sampled whenever two market makers engage in a trade.

Author Contributions
The Dealer Model assumes that a transaction prompts the entire market to immediately update their dealing prices z i (t + dt), i = 1, . . . , N to the latest transaction price p(g t ), see Fig. S3. In the absence of interactions, market makers independently update their dealing prices by adopting a trend-based strategy where σ > 0 and i (t) ∼ N (0, 1). The term ∆p n = 2 n(n + 1) is a weighted average of the last n < g t changes in the transaction price p.
The real-valued parameter c controls how the current price trend ∆p n influences market makers' strategies. For instance, c > 0 represents a market maker that tends to adjust its dealing price z(t) in the direction of the price trend (i.e., trend-following). Conversely, c < 0 characterizes a market maker that tends to adjust its dealing price in the opposite direction of the price trend (i.e., contrarian).

S4 Agent interactions in the Arbitrager Model
In this section we provide further details on the mechanisms ruling agents interactions in the Arbitrager Model, see Figs. S4 and S5.  The evolution of the Arbitrager Model ecology is controlled by 9 parameters. For each parameter, we report its nomenclature, symbol, dimension and the section in which we explain how its value is set in the simulations presented in Fig. 5.

S5.3 Initial state of the LOB
To initialize the -th LOB, we first fix its initial center of mass p (t 0 ) and the constant market making spread L . The former is set arbitrarily to a value with the same magnitude of the mid-price patterns observed in real trading data, see Fig. S1. Following the analysis of [59], we fix the market making spread in the USD/JPY market to L USD/JPY = 0.05. For simplicity, the market making spread in other markets is set such that it becomes proportional to the size of p (t 0 ), that is L = L USD/JPY × (p (t 0 )/p USD/JPY (t 0 )).   Table S3 to obtain the initial dealing prices for each trader and market, thus revealing the initial profile of the LOBs where u i, ∼ U (0, 1) is an uniformly distributed random variable. The expression in Eq. (S4) is derived from the inverse function sampling procedure. Let r ≡ (z(t 0 ) − p(t 0 )) be the relative distance between an initial dealing price z(t 0 ) and the initial center of mass price p(t 0 ). The LOB profile is stable when the probability density function (PDF) of r is it follows that the cumulative density function (CDF) of r is then, we compute the inverse function of Eq. (S6) Finally, assuming that y = u ∼ U (0, 1), we use Eq. (S7) to obtain the value of the initial dealing price z i, (t 0 ), see Eq. (S4).

S5.4 Relationships between simulation time and real time
Kanazawa et al. [60] found that the average time between two consecutive transactions is In Section S5.3 we have fixed L . For the sake of simplicity, we assume that the three markets in the Arbitrager Model moves at the same pace, on average. This implies that Γ is the same in each market and constant in time. Informed by real trading data, we fix Γ as follows. We consider each market separately and calculate the average waiting times between consecutive transactions in each trading year. This leads to 12 averages (i.e., 4 years × 3 FX rates). Finally, we compute the median of these averages to obtain a common value for Γ ≈ 0.7 sec. To ensure that simulations of our model maintain Γ ≈ 0.7 sec, we must fix N and σ such that Eq. (S8) is satisfied. The number of market makers participating each market is set heuristically by considering several combinations (N EUR/USD ,N USD/JPY ,N EUR/JPY ) and examining how well the model-based cross-correlation function ρ i,j (ω) replicates the same function built on real trading data. Having fixed N , the volatility of the dealing price updates is found by rearranging Eq. (S8)

22/32
Finally, the amplitude of a discretized time step in the model simulation ∆t should be set such that ∆t Γ. We fix ∆t = 0.01 sec and use this constant in the discrete approximation of Eq. (5).

S5.5 Parameters involved in the calculation of the current price trend
The calculation of the price trend process φ n, (t), see Eq. (6), requires us to set the number of accounted transaction price changes n and the scaling constant of the exponential weighting function ξ. In the simulations presented in Figs. 5 and S11 we arbitrarily set n = 15 observations and ξ = 5. These choices allow us to model a scenario in which trend-following market makers do not exclusively rely on the latest change in the transaction price to determine the current direction of the market. Instead, they compute a weighted average of the most recent price changes where weights are calculated according to an exponential function.

S5.6 Trend-following strength parameter
The trend-following strength parameter c determines how the sign and value of the current price trend φ n, (t) affect the strategic decisions of the participating market makers. When c > 0, market makers are likely to update their dealing prices z(t) upward when the price trend is positive and downward when the price trend is negative. Conversely, c < 0 indicates that market makers are more likely to update their dealing prices in the opposite direction of the price trend sign.
Recently, Sueshige et al. Relying on these studies, we enforce the assumption that market makers populating the Arbitrager Model ecology adopt trend-following strategies (i.e., c > 0). For simplicity, we assume that c is the same for every market maker and across markets. To fix c, we use Eq. (91) in [60]. The nondimensional parameter ∆p * = 1/(cΓ) (S10) shall take values that are not far from 2 for the model to produce the marginal trend-following behavior, which successfully replicated various statistical properties of real trading data in [60]. This motivates us to set c = 0.8, thus obtaining ∆p * ≈ 1.79.

24/32
S6 An extended version of the Arbitrager Model

S6.1 Motivations
The Arbitrager Model qualitatively replicates the shape of the cross-correlation functions ρ i,j (ω) and provides important insights on how the microscopic interactions between market makers and arbitragers entangles the dynamics of different FX rates. However, the cross-correlation functions ρ i,j (ω) reproduced by this extremely simple model present two features that are not found in real trading data. First, on extremely short time-scales (i.e., ω → 0 sec) the model-based ρ i,j (ω) does not approach zero as the same function built on real trading data. Second, the model-based ρ i,j (ω) flattens when ω 30 sec while the data-based ρ i,j (ω) flattens when ω 10 sec. We assert that the differences analyzed in Fig. S9 stem from the extreme simplicity of the Arbitrager Model. To verify this assertion, we introduce and examine the behavior of a modified version of the model which mimics more features of real FX markets. This extended, more realistic framework retains the same fundamental rules of the Arbitrager Model, that is, i) market makers continuously provide liquidity in a single market and ii) the arbitrager is the only agent allowed to operate across markets through the submission of predatory market orders. However, it also adds three distinct features inspired by real markets practices. First, agents' responses to triangular arbitrage opportunities emerge from a more rational decision making process in which they take into the account the risks associated to the implementation of this strategy. Second, market makers foresee predatory market orders and re-adjust their quotes in advance, reducing the likelihood of being matched by arbitragers' orders. Third, market makers operating in the EUR/JPY market peg their quotes to the implied best bid and ask prices with probability γ. This introduces an additional toy (i.e., unrealistic) mechanism through which the dynamics of different FX rates become entangled.

S6.2.1 The arbitrager
In the original model, see Section 2.3, the arbitrager automatically submits predatory market orders as soon as Eqs. (7a) or (7b) exceeds the unit. In real FX markets this decision is far less trivial as these orders might not be executed at the prices used in the calculation of Eqs. (7a) and (7b). For instance, faster traders could have already exploited the existing opportunity, pushing back Eqs. (7a) or (7b) below the unit. As a result, the profitable misprice evaporates, exposing slower arbitragers to the risk of generating losses. We introduce a more realistic decision making 25/32 process in which the arbitrager takes into the account the risks associated with this trading strategy. In particular, the arbitrager submits market orders if one of the following conditions is satisfied where ζ A (t) ∼ exp(λ A ). The parameter λ A represents the risk profile of the arbitrager. The higher the value of λ A , the more profitable the gap between real and implied prices must be to convince the arbitrager to exploit the current opportunity.

S6.2.2 Market makers
The submission of predatory market orders ensures immediate execution, forcing the matched market makers to either sell too low or buy too high. In the original Arbitrager Model, see Section 2.3, market makers remain indifferent to triangular arbitrage opportunities, that is, they do not attempt to anticipate the arbitrager to avoid predatory market orders. However, it is plausible that such a simplifying assumption does not adequately describe the behavior of liquidity providers acting in real FX markets. In this extension of the Arbitrager Model we enhance the strategic behaviors of market makers by allowing them to foresee the arbitrager's moves and re-adjust their quotes accordingly. Their dealing price updates are driven by Eq. (5), however, they also track the likelihood of engaging in an unfavourable transaction with the arbitrager. For instance, the i-th market maker operating in the EUR/JPY market monitors its exposure to predatory market orders by calculating the following ratios where b i, (t) and a i, (t) are the current bid and ask limit prices of the i-th market maker and b (t) and a (t) are the current best quotes in the -th market. Clearly, Eqs. (S12a) and (S12b) can be straightforwardly rewritten for market makers operating in the USD/JPY or EUR/USD markets. The more Eqs. (S12a) or (S12b) exceeds the unit, the larger the discrepancy between the current quote of the i-th market maker and the implied best cross FX rate. In the former case, the i-th market maker is underpricing EUR/JPY, facing the risk of selling too low. In the latter case, the i-th market maker is overpricing EUR/JPY, facing the risk of buying too high. As the implied cross FX rate is the same for every agent, the market maker with the highest value of χ is always the one who is offering the best quote, hence the first to be matched by predatory market orders.
In the same spirit of Eqs. (S11a) and (S11b), we assume that the i-th market maker, perceiving a high risk of interacting with the arbitrager, deletes and re-adjusts its current quotes if one of the following conditions is satisfied where ζ MM, EUR/JPY (t) ∼ exp(λ MM, EUR/JPY ). The parameter λ MM,EUR/JPY represents the average risk profile (i.e., is the same for every market maker) in the EUR/JPY market. The lower the value of λ MM,EUR/JPY , the less market makers tolerate their exposure to predatory market orders. When Eqs. (S13a) or (S13b) is satisfied, the i-th market maker sets its dealing price to the current mid price

S6.3 An additional price-entangling mechanism
The law of one price states that in frictionless markets the prices of two assets with the same cash flows must be identical [63]. The law of one price is maintained by two distinct mechanisms, triangular arbitrage and and shopping around, which promptly correct temporary gaps between the prices of two identical assets [63]. The former has been extensively described in Section 2.1.2 and it is the only way to enforce the law of one price in the standard version of the Arbitrager Model, see Section 2.3. The latter mechanism relates to the fact that rational traders, having detected two assets with identical cash flows but different prices, always buy the one with lower price and sell the one with higher price. This alters the demand and supply in the markets in which these assets are exchanged, thus closing the gap between their prices [63]. Reproducing the shopping around mechanism in the Arbitrager Model requires market makers to operate in multiple LOBs. To avoid a complete overhaul of the fundamentals of the Arbitrager Model, we opt instead for a simpler stylized mechanism which retains the basic feature that distinguishes shopping around from triangular arbitrage, that is, the absence of a round trip (e.g. JPY → EUR → USD → JPY) [63]. We assume that market makers operating in the EUR/JPY market peg their bid and ask quotes to the implied best bid and ask prices with constant probability γ, thus rejecting the dealing price update imposed by Eq. (5). For instance, the quotes of the i-th market maker that decides to peg its prices to the implied best quotes at time t are a i,EUR/JPY (t) = a EUR/USD (t) × a USD/JPY (t). (S15) This introduces an additional, simplistic mechanism through which the price of EUR/JPY is pushed towards its implied FX cross rate EUR/USD×USD/JPY.

S6.4 Cross-correlation functions and discussion
Fig. S11 reveals how the inclusion of additional features of real FX markets improves the replication of the characteristic shape of ρ i,j (ω). In particular, both the data-based and model-based cross-correlation functions ρ i,j (ω) approach zero on extremely short time-scales (i.e., ω → 0 sec), see insets of Fig. S11(b). Furthermore, the model-based ρ i,j (ω) flattens on much shorter time-scales when compared to the standard Arbitrager Model, see Fig. 5(b). This rapid stabilization is indeed observed in cross-correlation functions derived from real trading data, see Fig. S11(a). These results suggest that the discrepancies between model-based and data-based cross-correlation functions stem from the extreme simplicity of the Arbitrager Model which neglects several features and practices of real FX markets. Nonetheless, the standard Arbitrager Model succeeds in providing a comprehensive and intriguing explanation on how the dynamics of different FX rates are entangled at a microscopic level. This result is remarkable, considering the limited number of input parameters and straightforward settings that characterize our model. The effort of extending the Arbitrager Model leaves us with few important insights. First, the inclusion of reacting market makers corrects the behavior of ρ i,j (ω) when ω → 0 sec, that is, the model-based cross-correlation function collapses to zero as in real trading data. The key difference between arbitragers and market makers reactions to triangular arbitrage opportunities is that the former prompt simultaneous transactions, causing mid price changes in each market, while the latter cause a sequence of asynchronous mid price changes and eventually transactions. The characteristic shape of ρ i,j (ω) presented in Fig. S11(b) is based on a set of risk profile parameters that gives market makers a predominant role at the expense of the arbitrager. This means that a large fraction of triangular arbitrage opportunities are neutralized by market makers before the arbitrager can place predatory market orders. This result cannot inform us on the fraction of opportunities that are destroyed by market makers or exploited by arbitragers in real FX markets. However, it suggests that the entanglement of the dynamics of FX rates starts at different times in each market, depending on the current state of the LOB. The second insight emerging from Fig. S11 is that the interdependencies among currencies stem from the interplay of several agents' behaviors. While the interactions between triangular arbitrage and trend-following strategies retain a primary, necessary role in the entanglement of FX rates dynamics, the introduction of a second, complementary mechanism (i.e., shopping around ) to close the gap between real and implied prices allows the model based ρ i,j (ω) to stabilize on shorter time-scales ω, obtaining a characteristic shape that is strongly compatible with the same function derived from real trading data. This suggests that in real FX markets additional strategies are likely to interact with triangular arbitrage and trend-following behaviors to shape the features of cross-currency correlations. Rows (Columns) indicate the departed (reached) configuration. We count how many times the system transitioned between two specific configurations and normalize this number by the total number of transitions from the departed configuration. The two grey portions of the matrix mark the first (upper-left) and second (lower-right) clusters discussed in Section 3.2.

30/32
Probabilities EUR/USD USD/JPY EUR/JPY 0 0.5 1 Fig S15. Fraction of triangular arbitrage opportunities of the first and second type in each ecology configuration. Black bars denote the incidence of type 1 opportunities, see Eq. (4a), while white bars represent the incidence of type 2 opportunities, see Eq. (4b). We notice that one type appears more frequently than the other, depending on the considered configuration. . Normalizing by the initial center of mass p (t 0 ) allows us to compare the price trends across markets with different price magnitudes. We exclusively sample the value |φ n, (t)|/p (t 0 ) at the emergence of each triangular arbitrage opportunity and consider each configuration independently. As arbitrager's market orders alter price trends, the value of |φ n, (t)|/p (t 0 ), where t is the time step when µ I or µ II exceeds the unit, informs us on how currently hard is to flip the state of the -th market. For instance, we consider {+, +, +} and observe that |φ n, (t)|/p (t 0 ) is much higher in EUR/JPY than in EUR/USD and USD/JPY. This is reflected in the probabilities of transitioning from {+, +, +} to other configurations. Flipping EUR/JPY before the other two markets, causing a transition to {+, +, −}, occurs in 22.7% of the cases. However, flipping EUR/USD or USD/JPY first, causing a transition to {−, +, +} or {+, −, +}, occur in 35.8% and 33.6% of the cases respectively, see Table S5.