Dynamic Coupling and Market Instability
DDynamic Coupling and Market Instability
Christopher D. Clack ∗ , Elias Court, Dmitrijs Zaparanuks † University College London, Gower Street, London WC1E 6BT, UK5th July 2014
Abstract
We examine dynamic coupling and feedback effects between High FrequencyTraders (HFTs) and how they can destabilize markets. We develop a generalframework for modelling dynamic interaction based on recurrence relations,and use this to show how unexpected latency and feedback can trigger os-cillatory instability between HFT market makers with inventory constraints.Our analysis suggests that the modelled instability is an unintentional emer-gent behaviour of the market that does not depend on the complexity of HFTstrategies — even apparently stable strategies are vulnerable. Feedback in-stability can lead to substantial movements in market prices such as pricespikes and crashes.
Keywords:
HFT, market maker, latency, feedback, instability, coupling
C61, 63, G19, G14
1. Introduction
In a recent journal special issue on High Frequency Trading (HFT) Chor-dia et al highlighted a key unanswered problem: what is “the nature of themechanism by which the interaction of HFT algorithms improves marketquality”? (Chordia et al., 2013). In the same issue, Hasbrouck and Saarsaid they “cannot rule out that in times of severe market conditions HFTsmay contribute to market failure” (Hasbrouck and Saar, 2013). Here, wecontribute to this debate by investigating the low-level mechanisms by which ∗ [email protected]. Corresponding Author. † Author was supported by SNSF grant a r X i v : . [ q -f i n . T R ] M a y igh Frequency Traders (HFTs) may interact to reduce market quality andlead to failure, especially during times of market disequilibrium. We showhow coupling and feedback loops may occur between HFTs, we introduce ageneral framework for modelling dynamic interaction between financial algo-rithms, and we show how latency and feedback loops may trigger instabilityas an unintentional emergent behaviour of the market. Concern has previously been expressed about the potential for feedbackloops to impact prices and destabilize markets (Danielsson et al., 2012; Zi-grand et al., 2012). Feedback loops are not only widespread within the fi-nancial markets but may also exist for a long time, in some cases possiblyremaining unnoticed. The adverse effects of a destabilising feedback loopmay only become apparent when its strength becomes sufficiently large.A prominent example of market instability either arising from or exacer-bated by HFTs was the Flash Crash of May 6th 2010 (CFTC-SEC, 2010).Of direct relevance to our work is the “hot potato” trading behaviour ofmarket makers at the heart of the Flash Crash, where multiple HFTs tradedwith each other in a rapid oscillation of large aggressive orders. This highlyunusual oscillatory instability created both deceptive trading volume (whichimplied liquidity where none was present) and a spike in messaging traffic thatstressed the already-overloaded technology infrastructure (Nanex, 2010c).We model dynamic coupling and feedback between HFTs at the levelof the market microstructure, and expose the underlying mechanics of dy-namic interaction. We illustrate this with a case study of interaction betweeninventory-driven HFT market makers (Menkveld, 2013) in an order-bookmarket, each executing a simple, stable trading strategy. Unlike those ob-served by (Hasbrouck and Saar, 2013), our HFTs do not intentionally interactor “play” with each other. Nevertheless, we explain how dynamic couplingbetween our HFTs leads to a feedback loop where each HFT influences thebehaviour of the other, and how this feedback has the potential to generateunintentional instability (including highly volatile oscillatory behaviour) asan emergent behaviour of the market.Our model shows that one of the triggers for such behaviour is the in-troduction of unexpected additional latency (unexpected delay), as mightbe experienced for example when a sudden burst of quotes overwhelms an This follows a more pragmatic and sector-specific approach than our prior work onmodelling emergent behaviour such as Chen et al. (2007, 2008, 2009, 2010). how latency and feedback loops between dynamically-coupledHFTs may trigger unintentional market instability. Although our case studyfocuses on oscillation arising from the interaction of automated market-making strategies, we suspect that many of the previously observed feedbackloops (e.g. in Danielsson et al. (2012)) and the impact of market maker in-ventories on time-varying liquidity (Comerton-Forde et al., 2010) may also bemodelled and analysed using the techniques we describe in this article. Ourwork may also have implications for models of pricing and market impact,since we demonstrate that traders do not necessarily have independence ofaction and such models may need to account for unexpected coupling withother traders.The paper is organized as follows. First we set out the relationship withprior work, followed by an introduction to modelling coupling and feedback.Section 4 details our dynamic interaction model for a simple case study, andSection 5 analyses this model and makes the link from coupling and feedbackto market instability (including numerical simulation results, which illustratesome theoretically infinite modes of oscillation). Section 6 concludes, and isfollowed by an appendix containing further definitions for our case-study.
2. Relation to prior work
Previous theoretical and empirical studies of instability have predomi-nantly focused on interaction as an indirect process via prices (Arthur et al.,1996; Caldarelli et al., 1997), or via globally-shared information (Brock andHommes, 1998; Lux and Marchesi, 1999; Hommes and Wagener, 2009) with-out providing a detailed exploration of the underlying mechanism of interac-tion that causes such price fluctuations. Where direct interaction is includedin the model, it is often abstracted — for example, using an Ising model toprovide an abstraction of nearest-neighbour communication between traders(Kaizoji, 2000; Iori, 2002), or assuming traders form bidirectional links in arandom network (Cont and Bouchaud, 2000). By contrast, we explore themechanistic order-by-order interaction within the limit order book, where weexplicitly model multiple bilateral direct interactions between traders.3e follow Iori (2002) and Cvitanic and Kirilenko (2010) by modelling dy-namic interaction in discrete time, thereby exposing substantial microstruc-ture detail such as the discrete nature of computer messaging, of order pro-cessing by heterogeneous traders, and the discrete nature of order arrival andorder processing by the limit order book (Day and Huang, 1990).We have found recurrence relations to be the most helpful technique forour discrete-time models. Recurrence relations have been used in relatedwork such as price instability caused by fundamentalist/chartist interac-tion (Chiarella et al., 2006), clustered volatility caused by feedback effects(Farmer and Joshi, 2002), price instability from time-varying demand (Dayand Huang, 1990), and instability from leveraging (Thurner et al., 2012).Game-theoretic models focus on the systemic instability effects of inter-action between traders (Giardina and Bouchaud, 2003; Brunnermeier andPedersen, 2005), yet they start from the premise that instability arises fromthe complexity of traders adapting the value of some internal parameter inorder to optimise a utility function, and the model is used to explore marketequilibria. By contrast, we are interested in systemic effects that arise fromtraders with fixed strategies where no optimisation is involved and we exploremarket disequilibria and detailed causation at a microstructure level.Other studies of feedback in financial markets include: Gennotte andLeland (1990), who model price instability and show how the extent of aprice crash may be determined by the feedback effect arising from unobservedportfolio hedging; Bouchaud and Cont (1998), who emphasize the role offeedback effects in market instability (in particular through risk aversion)and utilise a Langevin equation to model feedback mediated via prices; andWesterhoff (2003), whose agent-based numerical simulation explores risk-averse market making strategies in foreign exchange markets and shows howfeedback interaction between market makers and speculators can increasetrading volume and distort exchange rates.Menkveld and Zoican (2014) have recently provided a Markovian recursivemodel of interaction between HFT market makers and predators; this is in thesame spirit as our model, in that it models direct interaction in discrete timeand aims to “uncover effects that remain hidden in static models” — however,we develop a more general framework that for example supports a full orderbook, dependencies on historical values, independent communication delays,and the tracking of multiple variables at each time step.Our work extends the current understanding of interaction-based instabil-ity by examining the detailed mechanisms (including latency and feedback)4y which HFTs (and others) can become dynamically coupled, causing themto operate unintentionally as a collaborative unit that leads to nonlinearoscillation and unstable markets. We suspect dynamic coupling may be im-plicated in a range of previously observed instabilities.
3. Background to modelling feedback loops
For our purpose of modelling feedback loops, we consider a market to becomprised of multiple subsystems, which may overlap. The smallest subsys-tem is a single component; components can be any entity — for example, ahuman trader or a trading algorithm or a news source, though componentsmay be larger (an exchange) or smaller (a risk management subroutine). Asubsystem may contain components or further subsystems. What is impor-tant for the model is the interaction between these subsystems.
We say that if the behaviour of one subsystem influences the behaviourof another the latter is coupled to the former and the two comprise a largersystem that exhibits coupling . For example, two HFTs are coupled if onemimics the operations of the other. The HFTs would also be coupled if oneof them acted according to some pattern triggered by the other’s activity.Any two subsystems may be coupled and there may exist chains of coupledsubsystems (e.g. one HFT is coupled to another that in turn is coupled toa news source). If a subsystem is coupled to itself either directly or indi-rectly via a coupling chain, we define this to be a feedback loop and all thesubsystems in this cyclic chain are said to be mutually coupled .We say a coupling is static if it always persists, with constant strength:a coupling is dynamic if it is transient or has varying strength. Dynamiccoupling is less predictable, hence more dangerous, than static coupling. Wedefine market instability as a large change or volatility in one or more marketparameters such as market price, traded volume, or frequency of trading.
Oscillation can arise in many ways: for example, the interaction betweenmomentum and fundamental traders can lead to oscillatory price behaviour(Sethi, 1996; Chiarella et al., 2006). Oscillatory instability may also arisefrom two stabilising feedback loops. Consider a simple contrarian trader whobuys when prices are too low, and sells when prices are too high. Assume the5rices of the trader’s limit orders are set to be halfway between the currentmarket price and a reference price ( T b for buying and T s for selling); thus thetrader’s behaviour is coupled to the market price. If these orders affect themarket price, causing the price to drop when selling and to rise when buying,then the market price is also coupled to the trader behaviour. A two-waycoupling is created and each phase (buying/selling) creates a stabilising feed-back: when selling, market price asymptotically drops to T s ; when buying,market price asymptotically rises to T b . Now if T b > T s and if the strat-egy exhibits inertia between T b and T s (if it was previously buying(selling),it continues until T b ( T s ), at which point it switches to selling(buying)), thecombined effect is an oscillatory instability as illustrated in Figure 1. Trader selling phase Trader buying phase P r i c e Time T b T s P r i c e Time T b T s Price falling phase Price rising phase Price oscilla0ng phase
Figure 1: Oscillatory instability arising from two stabilising feedback loops: (a) the be-haviours of the two trader feedback loops (the lines plot price during trader selling phaseand buying phase); (b) the three phases for the market as a whole — price bands identifiedfor rising ( price < T s ), oscillating ( T s ≤ price ≤ T b ) and falling ( price > T b ) prices. Modelling such a market is complex because the behaviour of the marketin the region T b > P > T s is not entirely determined by the price P but alsoby the current behavioural phase of the trading algorithm. The trader in thisexample displays two behavioural phases : buying and selling. We also saythat the overall market exhibits three phases: a falling-price phase ( P ≥ T b ),a rising-price phase ( P ≤ T s ), and an oscillating-price phase ( T b > P > T s ).More precisely, we say that a phase of a subsystem (or of a market) is aset of measurable properties which define a distinctly different behaviour ofthe subsystem, and the transition from one phase to another we call phase-shifting . Phase-shifting by itself is not necessarily a sign of instability, how-ever we shall show later how phase-shifting can lead to instability.6 . The Model In this section we explain how we model dynamic coupling and feedbackin a financial market. We start with some background comments to explainwhat we wish to model and why we adopt a particular approach; then weillustrate our method with a case study. Our initial model is a market withtwo market makers and an exchange; we then add a fundamental seller, andadditional unexpected communication latency (delay).
Our aim is to model coupling and feedback at a sufficient level of detailto investigate how they arise, how they operate, and how they contribute tomarket instability. Our technique is deterministic rather than probabilistic,in order to expose precise mechanistic causality. For example, the precisetiming and interleaving of order flow may be critical to the analysis of insta-bility arising from HFT interactions.In general, when modelling a market with complex feedback loops, thesubsystem behaviours of interest may not be expressible in analytic form,they may depend on local memory (e.g. whether to buy or sell at a price maydepend on whether the price has recently been rising or falling), they maybe rugged (non-smooth), and they may exhibit complex inter-relationships.Here we present our deterministic discrete-time model using mutually-recursive recurrence relations. A key characteristic of our model is that itsupports the direct expression of coupling in the structure of the model.The recurrence relations describe how the value of a subsystem parameterchanges with time. Where one relation references another, this indicates adependency or coupling; where the latter also references the former, this in-dicates a simple feedback loop. For example, consider the following relationsfor parameters X t , Y t and Z t (for general functions f (), g () and h ()): X t = f ( Y ( t − ) Y t = g ( Z ( t − ) Z t = h ( Y ( t − )In the above equations, X is unidirectionally coupled to Y and there is abidirectional coupling between Y and Z . In a slightly less abstract exampleof feedback, consider traders issuing sell orders based on a delta-hedgingmodel: the delta-hedging model depends on the price of a stock index; the The functions f (), g () and h () might express linear or nonlinear couplings. sellorders t = deltahedge ( index t − ) marketprice t = priceimpact ( marketprice t − , sellorders t − ) index t = indeximpact ( marketprice t − )It is sometimes more convenient to use a single function to define the be-haviour of two or more parameters simultaneously. For example, parameters R t and S t may be defined as the result of some general function f ():( R t , S t ) = f ( R ( t − , S ( t − )Where the above style of description is used, the coupling is made explicitinside the function f () (for example, Equation (4) in Section 4.2.1 uses afunction match () whose definition contains the detailed couplings).We may also wish to explore the behaviour in time of a market parameter X ; this is achieved by animating the aforementioned equations from somestarting values (e.g. X , Y ) and plotting the sequence { X , X , . . . X final } .This provides a time series such as that shown in Figure 1. To illustrate our technique, we provide as a case study the detailed modelof dynamic coupling with oscillatory feedback between risk-averse HFT mar-ket makers. Although HFT market makers typically straddle multiple ex-changes (Menkveld, 2013), our case study comprises a single exchange, witha number maxi of market makers each identified by a number i ; we then adda fundamental seller. In our model the exchange manages two limit orderbooks — bidbook t for bids, and askbook t for asks.Our method permits order flow to be modelled with each trader issuingone order at each time step, or many orders. In our case study, each traderissues up to four orders per time step (one bid, one ask, one sell and onebuy), and the exchange processes all orders received at one time step beforeconsidering orders received at the next step. Bids and asks are resting (passive) orders. Buys and sells are aggressive executableorders; e.g. immediately executable limit orders or market orders. .2.1. Couplings Figure 2 illustrates the couplings for a minimal system with an exchangeand two HFT market makers. Although this is a simplified version of realmarket couplings, it is still complex. Many arrows in Figure 2 represent dynamic couplings; e.g. a sell order is determined by the difference betweena trader’s inventory and its inventory threshold, and this varies with time.Such feedback diagrams are not easy to analyse. We provide a formal, andtractable, description by introducing a discrete time dimension. Each time( t ) represents the point when a message is sent from one entity to another,and the step from t to t + 1 represents the time taken for an entity to receiveincoming data, process it, and issue a new message. Many couplings occurwithin a time-step but others are time-dependent where the behaviour of oneentity is coupled to the behaviour at a previous time of another entity (inFigure 2 these are arrows with ovals at their tails). Our model requires thatevery cyclic chain of couplings includes at least one time-dependent coupling.In the model, all communication occurs synchronously — either all enti-ties are processing, or they are all sending and receiving messages. Never-theless, it is possible to model entities that take differing amounts of time tocalculate what to do next (e.g. a slow trader), and it is also possible to modeltraders issuing orders at different times. Both of these effects are achieved bysupporting “empty” messages; for example, a fast trader might send ordersevery even timestep and send an “empty” message every odd time step, anda slow trader might send orders only on every tenth timestep (otherwise itsends empty messages). Thus, we can specify the relative speeds of differ-ent subsystems. Furthermore, we shall see in Section 4.3 how specific delaycomponents can be used to model different latencies in communications links.For simplicity, we assume all traders and the exchange take the same timeto process incoming data and issue messages. Thus, the total round-trip timebetween a trader and the exchange is two time steps, and if a trader waitsfor a response to one order before issuing the next then that trader will onlyissue orders on alternate time steps. We hereafter assume that traders issueorders on even time steps and the exchange issues confirmations on odd steps.The value of a parameter at time t may depend on its own previous valueat time t − t ). This is an example of a time-dependent coupling. Forexample, we say that the inventory for trader i at time t + 1 (denoted by inv i, ( t +1) ) is coupled both to its value at the previous time step inv i,t and to9he sizes of the confirmed executions (sent from the exchange at time t ) ofthat trader’s previously issued orders: xbids i,t , xasks i,t , xbuys i,t and xsells i,t .Figure 2 denotes the dependency on the sizes of the executed orders as atime-dependent feedback dependency (coloured black) because the inventorydepends on the sizes of the executions, which depend on previously issuedorders, which in turn depend on previous inventory. We introduce the selection function ψ ( i, x ) (see Appendix A) to sum thesizes of all (and only) those orders issued by trader i in a set of orders x , andour discrete-time recurrence relation for the inventory for market maker i is: inv i, ( t +1) = (cid:26) inv i,t + ψ ( i, xbids t ) + ψ ( i, xbuys t ) − ψ ( i, xasks t ) − ψ ( i, xsells t ) (1)Equation (1) holds at all time steps, but inventory will only change oneven steps since the confirmations ( xbids etc) are only issued on odd steps.Similarly, we define the couplings (to current inventory inv i, ( t +1) ) thatdetermine the size of each market maker’s sell and buy orders. We introducethe functions buysize () and sellsize () (see Section 4.2.2), which embodythe market-maker internal logic for determining buy and sell sizes, and thefunction order (), which takes an order type, size, price and identifier, andreturns an order. Orders are only issued on even time steps: buy i, ( t +1) = order ( buy, buysize ( inv i, ( t +1) ) , ν, i ) sell i, ( t +1) = order ( sell, sellsize ( inv i, ( t +1) ) , ν, i )We also introduce the functions bidsize () and asksize () (see Section 4.2.2)to embody the sizing logic for resting limit order (coupled to inventory), andthe functions bidprice () and askprice () (see below) to embody the pricinglogic (coupled to both inventory and order-book information). This defineshow limit orders are coupled to trader inventory and order-book informationas illustrated in Figure 2, where the dependency on order-book informationis coloured black to denote a feedback dependency (e.g. because the best bidprice depends on the previously issued bids and the previously issued bids Although feedback couplings are generally time-dependent, time-dependent couplingsneed not be feedback couplings. ν is the price of the executable order — for the rest of this paper, we assume executableorders are market orders with no price (represented by ν =0). bid i, ( t +1) = order ( bid, bidsize ( inv i, ( t +1) ) ,bidprice ( bestbid t , bestask t , inv i, ( t +1) ) , i ) ask i, ( t +1) = order ( ask, asksize ( inv i, ( t +1) ) ,askprice ( bestbid t , bestask t , inv i, ( t +1) ) , i )Amihud and Mendelson (1980), Comerton-Forde et al. (2010) andMenkveld (2013) show how market makers skew order prices to control theirinventories, and in our case study we use a very simple version of this be-haviour: we set limit order prices such that for high inventory both bid andask prices are low (encouraging more asks and fewer bids to be executed)and for low inventory both bid and ask prices are high (encouraging morebids and fewer asks to be executed). We ensure that bid and ask prices arenot negative, new bid prices are not higher than midprice −
1, and new askprices are not lower than midprice + 1 (so resting orders are never crossed).11 ell inv buy bid ask {xbids i } {xsells i } sell inv buy bid ask bidbook’ Sells Bids Asks Buys Trader Trader Exchange insertbid insertask match sizes prices bestbid Sell trades sizes prices askbook’ sizes prices bestask {xasks i } {xbuys i } Buy trades sizes prices match prices sizes prices sizes bidbook bestbid askbook bestask Figure 2: Coupling between components for a market with one exchange
Exchange andtwo HFT market makers
T rader and T rader . Arrows are unidirectional dependencies(the head is coupled the tail): bold black arrows are key feedback dependencies (the dashedarrows are explained in Section 4.2.1). If an arrow’s tail has an oval it is a time-relateddependency — the head is coupled to the value of the tail at a previous time. Tradersmay issue sell or buy orders (determined only by current inventory inv ) and may alsoissue bid or ask orders (determined by inventory inv and knowledge of the best bid andbest ask at the exchange). Orders are grouped (e.g. Bids ) before being added to theintermediate bidbook (cid:48) and askbook (cid:48) and matched to produce sets of executed orders (e.g. { xbids i } , { xsells i } ) and the resulting bidbook and askbook . Each trader only sees his/herown confirmed executions. Rectangles indicate functions that are described in the text.In this simple model, crossed bids and asks are not executed against each other; neitherare buys against sells. bidprice ( bestbid, bestask, inv ) = max (0 , ( midprice − − α × inv ) askprice ( bestbid, bestask, inv ) = max (0 , ( midprice + 1) + β × inv ) (2)The orders from the two market makers are grouped before being pro-cessed by the exchange and we represent these groups as ordered sequencesusing the notation { . . . } (where {} is the empty sequence): Bids ( t +2) = { bid , ( t +1) . . . bid maxi, ( t +1) } Asks ( t +2) = { ask , ( t +1) . . . ask maxi, ( t +1) } Buys ( t +2) = { buy , ( t +1) . . . buy maxi, ( t +1) } Sells ( t +2) = { sell , ( t +1) . . . sell maxi, ( t +1) } The exchange then processes the incoming orders. Bids and asks areadded to the bidbook and the askbook to create intermediate books bidbook (cid:48) and askbook (cid:48) . In our model the order books are ordered sequences of limitorders and the positions of the limit orders within an order book are deter-mined by their price and their time of arrival. The first bid (ask) in bidbook (cid:48) ( askbook (cid:48) ) is the one with the highest (lowest) price (and where there is morethan one bid (ask) at that price, they are sorted in order of arrival time sothat the earliest arriving bid (ask) is the first in the sequence). We introducethe further notational device x : y to represent a sequence of orders wherethe first order in the sequence is x and y is the remainder of the sequencewith x removed. It follows from the above that if bidbook = b : bs then thebest bid is b , and if askbook = a : as then the best ask is a .To add new orders to an order book, we introduce the functions insertbid () and insertask () (defined in Appendix A). If we wished bidsto rest on the bidbook until cancelled, we would define bidbook (cid:48) as: bidbook (cid:48) ( t +2) = insertbid ( bidbook ( t +1) , Bids ( t +2) )However, to simplify the presentation of our case study, we assume that allorders are Fill And Kill (they are fully or partially executed immediately or Detailed expressions for α and β are given in Appendix A but are not necessary tounderstand this presentation. This simple model assumes all orders are guaranteed to be delivered to and acceptedby the exchange, though it is also possible to model order confirmations in the case of asystem where one or both of these assumptions does not hold. The coupling of bidbook and askbook to order arrival time is not shown in Figure 2. bidbook (cid:48) ( t +2) = insertbid ( {} , Bids ( t +2) ) askbook (cid:48) ( t +2) = insertask ( {} , Asks ( t +2) ) (3)The exchange then matches the incoming sell (or buy) orders issued at time t + 1 with those limit orders resting on the bidbook (cid:48) ( t +2) (or askbook (cid:48) ( t +2) ) todetermine the new trade executions xbids ( t +2) and xsells ( t +2) (or xasks ( t +2) and xbuys ( t +2) ) and the new bidbook ( t +2) (or askbook ( t +2) ). The dependencyof bidbook t +2 ( askbook t +2 ) on bidbook t +1 ( askbook t +1 ) is another example ofa benign feedback and is coloured black in Figure 2.The exchange’s matching engine is represented by the function match (),which must also remove executed limit orders from the relevant order book(discussed below). Confirmations are only issued on odd time steps:( bidbook t +2 , xbids t +2 , xsells t +2 ) = match ( bidbook (cid:48) t +2 , Sells ( t +2) )( askbook t +2 , xasks t +2 , xbuys t +2 ) = match ( askbook (cid:48) t +2 , Buys ( t +2) ) (4)Each executed sell (buy) will be at the price of the currently best bid(ask); and if the size of the sell (buy) is greater than that of the best bid(ask), this may change the subsequent best bid (ask) price used for the nextexecution. Thus, the executed sell (buy) prices are coupled to (i) the currentbest bid (ask) prices, (ii) the sizes of the executed sell (buy) orders, and (iii)the sizes of the bids (asks) in bidbook (cid:48) ( askbook (cid:48) ).The operation of the matching engine is complex (see Appendix A), butwe can express the executed sell prices and buy prices inductively using thefunction P ( r : rr, e : ee ) where e : ee is a sequence of executable orders to bematched against an ordered sequence r : rr of resting limit orders (using thenotation introduced above). We consider one executable order at a time; wematch each executable order against the resting limit orders on the relevantorder book — if there is no liquidity, there are no more trades, but otherwisewe have (where π () gives the price of an order, σ () gives the size of an order,and ρ ( x, y ) reduces the size of x by the size of y ): P ( r : rr, e : ee ) = π ( r ) : P ( ρ ( r, e ) : rr, ee ) if ( σ ( e ) < σ ( r )) π ( r ) : P ( rr, ρ ( e, r ) : ee ) if ( σ ( e ) > σ ( r )) π ( r ) : P ( rr, ee ) if ( σ ( e ) = σ ( r )) (5)The above equation for market prices specifies exactly how the matchingengine “walks the book” in order to fill an executable order — first executing14gainst the best-priced resting limit order and, if that was insufficient tofill the executable order, progressing to the next-best resting order. Givena particular distribution of limit orders on the book, a large total size ofexecutable orders is more likely (than a small total size) to deplete the topprice level on the relevant order book and cause a jump in the execution price(see Figure 3). Whether a price change will occur at all is simply given bycomparing the total sizes of all executable orders (in either Sell or Buy ) withthe total sizes of all the resting limit orders resting on the relevant book atthe best price (if the former is greater, then at least one execution will be ata different price). How much the price moves will depend on the distributionof limit orders on the book — especially the distribution near the top of thebook, and the degree of “gapping” in that distribution.
Size of bids Size of asks Price a b c
Figure 3: Matching sells against bids: the executed prices occur first at the best bid (a);then at (b) since this will have become the new best bid; and finally a larger price jumpto (c). The bolded portions of the bid lines are the executions.
The information from bidbook t and askbook t is published by the exchange,including the best bid and ask prices which are used by the traders in cal-culating the next set of limit orders. The values xbids t , xasks t , xbuys t and xsells t are the local trade confirmations sent by the exchange to the relevanttraders (the two counterparties to the trade). Finally, Figure 2 contains twobold dashed black arrows which merge with two other feedback arrows —this represents an optional price banding constraint that might be applied asa market protection mechanism. This completes our set of recurrence relations to model the main depen-dencies illustrated in Figure 2. We note in particular that the existence of The previous section described how we model dependencies between sys-tem components, but we have not yet described the detailed behaviour of themarket-making algorithm. In particular, we wish to model the phase-shiftingof an algorithm between two different types of behaviour. Computer tradingalgorithms are frequently subject to phase-shifting, typically implemented asconditional branches to choose between different behaviours in different mar-ket contexts. Here we create an algorithm with a somewhat simplistic shiftbetween two dramatically different behaviours — in practice, an algorithmmight exhibit many phases and the switching between phases might be moresubtle than this example.We model a simple risk-averse, long-short market maker that activelymanages risk based on the size of the current inventory (Manaster and Mann,1996). Although in practice a market maker could make complex risk cal-culations, it suffices for our model simply to use raw inventory (since weare only interested in the switching between behaviours and not precise val-ues). Our market maker uses a threshold policy (Huang et al., 2012) with anupper-bound inventory limit
U L and a lower-bound inventory limit LL (anegative number). To simplify the presentation, these limits are assumed tobe fixed, though in practice they could vary according to market risk factorssuch as observed volatility. Based on these inventory limits, our risk-aversemarket maker phase-shifts between two different behaviours:1. A stable phase whenever LL < inv i,t < U L , where only resting limitorders are issued — at each even time step (to allow for round-tripcommunication with the exchange) both a bid and an ask are issued.We assume that all orders are Fill And Kill. A special situation arisesfor inv i,t = LL + 1 where only a bid is issued and inv i,t = U L − inv i,t ≥ U L or inv i,t ≤ LL , where at each eventime step either a large sell or a large buy is issued in an attempt to See (Chakraborty and Kearns, 2011) for a similar model, though in our simple casestudy we only place one bid and one ask at each time step. In our model, executable order size is either
U L for a positive-inventory panic or − LL for a negative-inventory panic— in practice, the size might also depend on market conditions andconstraints, but we find this simple approximation is sufficient for ourinitial model. No resting limit orders are issued in a panic phase.Phase-switching is defined in the functions that determine order size: buysize ( inv i,t ) = (cid:26) if ( inv i,t > LL ) − LL otherwisesellsize ( inv i,t ) = (cid:26) if ( inv i,t < U L ) U L otherwisebidsize ( inv i,t ) = (cid:26) if ( inv i,t ≥ U L ) bidsize (cid:48) ( inv i,t ) otherwiseasksize ( inv i,t ) = (cid:26) if ( inv i,t ≤ LL ) asksize (cid:48) ( inv i,t ) otherwise Precise limit order size is delegated to the functions bidsize (cid:48) () and asksize (cid:48) ().Our model does not require any particular values to be chosen, but we observethat if the limit order sizes are chosen to be within the shaded region ofFigure 4 then under normal circumstances the market maker will not switchinto a panic phase if it starts in the stable phase (see Section 5.2). Forour case study, we set bid and ask sizes to be exactly the maximum thatwill never exceed the inventory limits
U L and LL (to keep the presentationsimple, we ignore details such as minimum size constraints imposed by theexchange, and we use a single large order rather than splitting into severalsmaller orders). Thus: bidsize (cid:48) ( inv ) = max (0 , U L − − inv ) asksize (cid:48) ( inv ) = max (0 , inv − ( LL + 1)) (6) This aligns (somewhat simplistically) with the empirical observation of (Kirilenkoet al., 2010) that “HFTs do not accumulate a significant net position and their positiontends to quickly revert to a mean of about zero”, and with the Nanex description of HFTbehaviour during the Flash Crash: “they slammed the market with 2,000 or more contractsas fast as they could” (Nanex, 2010b). idsize' asksize'Inventory'LL+1' O r d e r ' s i z e '
0' UL71'UL71'7(LL+1)'
UL-‐1 -‐(LL+1) 0
Figure 4: Risk-averse order sizes as a function of inventory, given inventory limits LL and U L . Bidsize crosses the y axis at
U L − − ( LL + 1). Ifbid (ask) size is chosen within the shaded area beneath the “bidsize” (“asksize”) line, thenit is impossible under normal conditions for inventory to reach the limit (see Section 5.2). In the next section we will require a fundamental seller to provide sellorders to trade with the market makers. We therefore define the equationsfor a trader with index 0 whose behaviour is to issue a sell order of a fixedsize ω at every even time step (it does nothing else) up to a predeterminedtime timelimit , and then exits the market. Thus (for even time steps only): buy ,t = order ( buy, , , sell ,t = (cid:26) order ( sell, ω, , if ( t < timelimit ) order ( sell, , , otherwisebid ,t = order ( bid, , , ask ,t = order ( ask, , , Information delay is a known and widespread source of instability in thefinancial markets (Beja and Goldman, 1980; Chiarella, 1992; CFTC-SEC,2010; Tse et al., 2012). We define information delay to be an unexpectedadditional latency in transmitting information; it may manifest in differentways throughout a financial market, and may affect all kinds of information.For example: (i) delays in financial and economic news, and consequentdelays in relevant information being incorporated into traded prices (Bejaand Goldman, 1980; Chiarella, 1992); (ii) delays due to exchange throttling;(iii) delays due to technology infrastructure having switched to a business-18ontinuity site; (iv) delays in market data: both direct feeds (Nanex, 2010c;Informa, 2011; Levin, 2012; Eholzer, 2013) and consolidated feeds (CFTC-SEC, 2010; Nanex, 2010c); (v) delays and dropouts in the transmission of any information due to lost or corrupted messages (Corvil, 2009); and (vi) delaysin any messages to or from an execution venue due to excessive message trafficexceeding the capacities of inbound and/or outbound queues; typically whenthe market is under stress, but also potentially due to deliberate “quote-stuffing” manipulation by traders (Tse et al., 2012). The extent of delays can be considerable. For example, order processingtimes at Eurex are normally 0 . ms –0 . ms but can be delayed by a factorof 10 under normal business conditions and occasionally by a factor of 200(Eholzer, 2013); and market data reporting from NYSE to the CQS systemduring the Flash Crash was delayed by 5 , ms – 24 , ms (Nanex, 2010c).Delayed information can substantially affect trading algorithms, sincethey will make calculations based on incorrect data. For example, a risk-averse market maker operating a two-phase strategy as described above mayunder-estimate inventory risk and this may lead to a phase-shift from “nor-mal” to “panic” trading. Where all traders are affected by delays then sys-temic effects such as oscillatory instability may ensue.Consider the introduction of a delay in the trade-confirmation communi-cations link from the exchange to the traders, and let the confirmations ofall executed orders be delayed by an additional δ time steps where δ ∈ N .We model the delayed information on executed orders as four separate com-ponents defined as follows:( dxbids t , dxasks t ) = ( xbids ( t − δ ) , xasks ( t − δ ) )( dxbuys t , dxsells t ) = ( xbuys ( t − δ ) , xsells ( t − δ ) )This delay is inserted into our model by specifying that the market makeruses the delayed versions rather than the undelayed versions of the executedorders. Equation (1) becomes: inv i, ( t +1) = inv i,t + ψ ( i, dxbids t ) + ψ ( i, dxbuys t ) − ψ ( i, dxasks t ) − ψ ( i, dxsells t ) Even specialist high-bandwidth interfaces (Eholzer, 2013) may suffer from delays whentraffic is excessive. Furthermore, if an exchange provides information about current delays(Eholzer, 2013) in a normal message, this information will itself be delayed. dxsells t = xsells ( t − δ ) . The foregoing equations define our model of the main components of ourcase study: the exchange, the market makers, and a fundamental seller. Weclaim that this style of definition, using mutually-recursive recurrence rela-tions, has the advantage that the multiple interactions between the compo-nents are made explicit. For example: (i) market maker prices bidprice and askprice are coupled to the best bid and best ask prices published by theexchange (Equation (2)); (ii) market maker inventories are coupled to theexecuted orders xbids , xask , xbuys and xsells published by the exchange(Equation (1)); and (iii) the executed orders at the exchange are coupled tothe orders received from the traders (Equation (4)).This equational style provides a highly expressive medium for the descrip-tion of coupling effects in financial systems with complex dependencies, andwe find it to be very useful during the formulation and discussion of hypothe-ses. It can be used at varying levels of abstraction (it is not necessary forall components to be modelled at the same level of detail) and it supports awide variety of real behaviours, including information delay.
5. From Coupling to Instability
Here we use our case study to illustrate how we reason about coupling-induced instability in a financial market. First we review the feedback loopsin Figure 2, and indicate how instability in trader inventories may lead toinstability in market prices. We show that under normal circumstances ourmarket makers are stable, and then we show how instability can be inducedby the introduction of an information delay. The remainder of the sectionshows how we analyse feedback effects and market instability.For a different case study, e.g. with different pricing functions and strate-gies, the dynamic interaction model would be different but our reasoningprocess in relation to coupling, feedback and instability would be the same.20 .1. Feedback loops
Figure 2 gives the bilateral couplings for our case study with one exchangeand two market makers, showing how selected components are coupled. Thebilateral couplings form chains, and the bolded arrows in the figure show keycouplings that turn chains into feedback loops.Limit order prices are coupled to the best bid and ask prices, which arecoupled to the prices of previously-issued limit orders. This forms a feedbackloop; either a trader is coupled to him/herself, or a loop covers both traders.The two bold dashed arrows show the effect of an optional price-bandingconstraint where order prices are deliberately coupled to the last traded price,thereby creating a feedback loop.Inventories are coupled to the sizes of trades, and the sizes of trades arecoupled to the order sizes, which themselves are coupled to the previousinventories. This creates a dynamic feedback loop (Figure 2) comprisingchains of dynamic couplings. We will later show how this feedback loop caninduce inventory oscillation.Market price is an attribute of the executed trades — it is not (absentprice-banding) a component of a feedback loop, though it is coupled to theabove feedback loop that connects executed trades to inventories. As thetraders’ inventories change, so the limit order book is exposed to changingpressure on traded prices. The bid book comes under price pressure as thetotal sizes of all sell orders exceeds the total sizes of all bids at the best price,and the ask book comes under pressure as the total sizes of all buys exceedsthe total sizes of all asks at the best price. Unbalanced pressure causes themarket price to move: balanced pressure leads to liquidity being depleted atthe top of both books, more volatile traded prices and increasing spreads.Figure 5 illustrates the couplings by which unstable inventories mightdestabilize market price. The feedback loop between inventories and ordersizes can be explored in further detail by expanding Equation (1). The sizeof each execution is the minimum of the resting order size and the executableorder size; at each time step the latter is always either U L for the first sellor − LL for the first buy, and the former is given by Equation (6): In the presence of price-banding, order prices would be coupled to market price, form-ing another feedback loop. nventories Market prices Traded sizes Best bid/ask prices Limit order prices Limit order sizes Executable order sizes match Changes inventories Deletes/modifies executed orders
Sizes of best bid/ask Order books
Figure 5: How unstable inventories can affect market price. Order prices and sizes arecoupled to inventories, traded prices and sizes are (via the matching function) coupled toorder prices and sizes, and inventories are coupled to traded sizes. inv i, ( t +1) = inv i,t + ψ ( i, xbids t ) + ψ ( i, xbuys t ) − ψ ( i, xasks t ) − ψ ( i, xsells t )= inv i,t + min ( U L, bidsize i, ( t − ) + min ( − LL, asksize j, ( t − ) − min ( − LL, asksize i, ( t − ) − min ( U L, bidsize j, ( t − )= inv i,t + min ( U L, max (0 , U L − − inv i, ( t − ))+ min ( − LL, max (0 , inv j, ( t − − ( LL + 1))) − min ( − LL, max (0 , inv i, ( t − − ( LL + 1))) − min ( U L, max (0 , U L − − inv j, ( t − ))The recurrence relation for inventory displays complex feedback: inv i, ( t +1) is not only coupled to its previous values at times t and t-1 but also to theother trader’s inventory at time t-1 ( inv j, ( t − ). Furthermore, this recurrencerelation only holds if trades occur between the two traders — yet, if both startin a stable phase there should be no executable orders and no trades. We shalldevote the remainder of this section to the analysis of the dynamic behaviourof our simple market-making strategy: first, to establish its inherent stability,then to demonstrate how it may be destablized, and finally to explore howtwo or more such market makers may exhibit self-exciting instability. Here we analyse the dynamic behaviour of a single market maker’s inven-tory. We establish that under normal conditions if our market maker startsin a stable phase it cannot shift into a panic phase.22 simple algebraic manipulation can be used to establish the stability ofthe market. From Section 4.2.2, we know that if LL + 1 ≤ inv i, ≤ U L − all bids and no asks for the market maker are executed. Furthermore, recallthe prerequisites for our case study — that all limit orders are Fill And Kill(so there are no resting bids from before time t-1 ), and that traders issueorders only on even time steps (so inv i, ( t − = inv i, ( t − if t is even). NowEquation (1) may be explored by expanding terms as follows: inv i,t = inv i, ( t-1 ) + ψ ( i, xbids ( t-1 ) ) + ψ ( i, xbuys ( t-1 ) ) − ψ ( i, xasks ( t-1 ) ) − ψ ( i, xsells ( t-1 ) )= inv i, ( t-1 ) + ψ ( i, xbids ( t-1 ) ) − ψ ( i, xasks ( t-1 ) ) ∵ only limit orders = inv i, ( t-1 ) + ψ ( i, xbids ( t-1 ) ) ∵ only bids executed = inv i, ( t-1 ) + ψ ( i, bidbook (cid:48) ( t-1 ) ) ∵ all bids executed = inv i, ( t-1 ) + ψ ( i, Bids ( t-1 ) ) ∵ no old bids, Eq.3 = inv i, ( t-1 ) + bidsize i, ( t-2 ) = inv i, ( t-1 ) + max (0 , U L − − inv i, ( t-2 ) )= inv i, ( t-1 ) + max (0 , U L − − inv i, ( t-1 ) ) if t is even = max ( inv i, ( t-1 ) , U L − U L −
1) is a strict, inclusive, upper-bound for the market makerinventory. By a similar argument, ( LL + 1) is a strict, inclusive, lower-bound.We therefore say this market-making algorithm is stable — it will never reacheither of its two inventory limits U L or LL , and therefore will never panicand will never issue aggressive executable orders. If a delay were introduced into the market, unknown to the market maker,such that confirmations of all trades were delayed by δ time steps, and ifthere were another trader issuing sells to hit the bids, then we would use thefollowing revised inventory equation, from which (by expanding terms, withthe same assumptions as above) we derive a prerequisite for a market makerto shift into panic in such a market. 23 nv i,t = inv i, ( t-1 ) + ψ ( i, dxbids ( t-1 ) ) + ψ ( i, dxbuys ( t-1 ) ) − ψ ( i, dxasks ( t-1 ) ) − ψ ( i, dxsells ( t-1 ) )= inv i, (t-1) + ψ ( i, dxbids ( t-1 ) )= inv i, ( t-1 ) + ψ ( i, xbids ( t-1- δ ) )= inv i, ( t-1 ) + ψ ( i, bidbook (cid:48) ( t-1- δ ) ) ∵ all bids executed = inv i, ( t-1 ) + ψ ( i, Bids ( t-1- δ ) ) ∵ no old bids, Eq.3 = inv i, ( t-1 ) + bidsize i, ( t-2- δ ) = inv i, ( t-1 ) + max (0 , U L − − inv i, ( t-2- δ ) )= max ( inv i, ( t-1 ) , U L − inv i, ( t-1 ) − inv i, ( t-2- δ ) )The trader will phase-shift into panic if inv t ≥ U L and from the abovewe therefore have the worst-case pre-condition for shifting to panic that: inv i, ( t − > inv i, ( t − − δ ) Consider the case where a market maker’s inventory has been stable atvalue ν for some time, and then at time τ a fundamental buyer enters themarket and issues very large sell orders at every time step — sufficient tocause every bid to be executed. Assume δ = 2. The previously used algebraicmanipulation can be applied, and the changes in inventory for the marketmaker (which only occur on even timesteps) would be: T ime Inventory Reasonτ ν xbids ( τ − = {} τ + 2 ν xbids ( τ − = {} τ + 4 max ( ν, ( U L −
1) + ν − ν ) = U L − xbids ( τ +1) (cid:54) = {} τ + 6 max ( U L − , ( U L −
1) + (
U L − − ν ) > U L − ν < U L − Thus, the market maker’s inventory hits or exceeds the limit
U L at timestep τ + 6, at which point the market maker shifts into a panic phase andissues executable orders to offload the excess inventory. Since traders issue orders only on even time steps, this is equivalent to inv i, ( t − >inv i, ( t − − δ ) if t is even. Here, ν can take any value ν < ( U L −
1) — in Section 5.4.1 we shall return to thisexample with ν = 2 − U L
U L (at a rate that depends on the sizes of its executed bids); whereasif a delay is introduced the inventory initially is unchanged because tradeconfirmations are buffered in the delay component and the market makerissues more orders based on this unchanged inventory, then the first delayedtrade confirmation is received and the inventory increases. The subsequentincrease in inventory is linear for the same length of time as the inventorywas previously unchanged (because in our case study the bid sizes and conse-quently the executions are directly linked to current inventory), and then theinventory increases at a slower rate because the confirmed trades result nowfrom bids issued at higher inventories. The inventory then hits or exceedsthe limit
U L and the market maker shifts into the panic phase.
Inv with no delay Inv with delay δ t t+δ UL i n v e n t o r y PANIC
Figure 6: Inventory grows with and without delay
In the panic phase the market maker will try to return to a stable phase assoon as possible by issuing a sell order. Whether this is possible in one trans-action depends on both the extent to which the current inventory exceedsthe limit and whether the resting liquidity on the order book is sufficient tofully execute the sell order. To provide such liquidity, thereby permittingthe market maker to phase-shift back to a stable phase, we would requirethe other trader to phase-shift its own behaviour so that it issues bids. Inthe best case for our case study, ψ ( i, xsells ( t − − δ ) ) = U L (i.e. the marketmaker’s sell is completely executed) and we have: inv i,t = inv i, ( t − − ψ ( i, dxsells ( t − )= inv i, ( t − − ψ ( i, xsells ( t − − δ ) )= inv i, ( t − − U L
25f the inventory is too high ( inv i, ( t − ≥ U L ) or the available liquidity istoo small ( ψ ( i, xsells ( t − − δ ) ) ≤ inv i, ( t − − U L ), the market maker will stay inpanic and will keep issuing sell orders until (if satisfied) the current inventoryfalls below the
U L limit.With the introduction of a very small delay into the market, an oscilla-tory phase-shifting of another trader can, via unidirectional coupling (withno feedback), induce an oscillatory phase-shifting behaviour in the marketmaker. Our equational model illustrates very clearly how this occurs: if theother trader phase-shifts between issuing sells and bids, this leads to a mar-ket maker oscillation between a positive-inventory panic phase and a stablephase as shown above, and by contrast if the other trader phase-shifts be-tween issuing buys and asks, this leads to a market maker oscillation betweena negative-inventory panic phase and a stable phase.
Here we analyse a market containing a feedback loop, where two mar-ket makers can be induced into a self-exciting oscillation. To establish thefeedback loop requires a third trader (a fundamental seller to hit the bids),together with a destabilising scenario such as information delay to send oneof the market makers into a panic phase. As soon as one of the market mak-ers shifts into panic (it doesn’t matter which one, but we assume that theydo not both panic at the same time), the third trader is no longer neededand exits the market. Having achieved a situation where one market makeris in panic and the other is stable, they are able to trade with each other;one issues an executable order and the other issues resting limit orders.The market maker in panic will reduce its inventory by trading withthe stable market maker, and this will change the inventories of both; sincethe orders subsequently issued by both are dependent on their inventories,there exists a bi-directional coupling between the two market makers. Thiscreates a feedback loop (involving the two market makers, the exchange andthe delay component), and we shall demonstrate how this feedback loop is“self-exciting” in that it needs no other component to continue.This feedback loop can lead to an infinite oscillatory instability betweenthe two market makers, with each shifting in and out of panic in a syn-chronised contra-oscillation. At first such carefully choreographed contra-oscillation may appear to be unlikely, but our flow analysis will show how thesynchronicity arises naturally out of the equations that describe the market,with the action of one component causing the action of the other component.26 .4.1. Information delay with two market makers
We recreate the delay market described in Section 5.3, but now with twomarket makers and a fundamental trader, and with a delay δ in all tradeconfirmations. As before, it is a precondition that the fundamental traderleaves the market as soon as one market maker is in panic and the other isstable (if both market makers panic at exactly the same time step, there willbe no trades — the market will remain inactive and therefore stable).We assume the additional delay δ from the exchange is unknown to thetraders and they are unaware that their current inventories may subsequentlybe increased or decreased as the result of trade executions that have oc-curred but whose confirmations have not yet been received. Consequently,a stable market maker may issue a limit order that, if executed, may causethe previously-panicking market maker to become stable and the previously-stable market maker to enter a panic phase.Our model facilitates analysis and understanding of the behaviour of thismarket, since it permits the tracking of individual items of the market state(such as orders and confirmations) at each time step. Table 1 illustrates suchdetailed flows — this flow analysis demonstrates how a starting market stateat time τ where market maker 2 is in positive panic (inventory 2 U L −
2) andthe other is stable (inventory 2 − U L ) can without external impetus movefirst to a market state where both traders are stable (time τ + 4), then to astate where market maker 2 is stable and market maker 1 is in panic (time τ + 6), and finally back again to both being stable (time τ + 10).In this example, the delayed transit of one trade confirmation is high-lighted by a succession of three grey cells. Different patterns of movementin and out of panic are generated with different starting inventories, exceptthat there is a precondition that the initial stable inventory is not
U L − In general, we need δ − pending xorders columns for this kind of flow analysis. ime inv inv orders xorders pending dxorders inv inv ( t ) ( t ) ( size ) xorders ( t + 1) ( t + 1) τ θ b, ,τ (2UL-3) θ S, ,τ ( UL ) 2-UL τ +1 2-UL ( θ b, ,τ , θ S, ,τ ) UL τ +2 2-UL θ b, ,τ +2 (2UL-3) θ S, ,τ +2 ( UL ) ( θ b, ,τ ,θ S, ,τ ) UL τ +3 2-UL ( θ b, ,τ +2 ,θ S, ,τ +2 ) UL ( θ b, ,τ ,θ S, ,τ ) UL τ +4 2 UL-2 θ b, ,τ +4 (UL-3) θ b, ,τ +4 (1) ( θ b, ,τ +2 ,θ S, ,τ +2 ) UL τ +5 2 UL-2 ( θ b, ,τ +2 ,θ S, ,τ +2 ) UL UL+2 -2 τ +6 UL+2 -2 θ S, ,τ +6 ( UL ) ,θ b, ,τ +6 (UL+1) UL+2 -2 τ +7 UL+2 -2 ( θ S, ,τ +6 ,θ b, ,τ +6 ) UL UL+2 -2 τ +8 UL+2 -2 θ S, ,τ +8 ( UL ) ,θ b, ,τ +8 (UL+1) ( θ S, ,τ +6 ,θ b, ,τ +6 ) UL UL+2 -2 τ +9 UL+2 -2 ( θ S, ,τ +8 ,θ b, ,τ +8 ) UL ( θ S, ,τ +6 ,θ b, ,τ +6 ) UL τ +10 2 UL-2 θ b, ,τ +10 (UL-3) θ b, ,τ +10 (1) ( θ S, ,τ +8 ,θ b, ,τ +8 ) UL τ +11 2 UL-2 ( θ S, ,τ +8 ,θ b, ,τ +8 ) UL τ +12 2-UL θ b, ,τ +12 (2UL-3) θ S, ,τ +12 ( UL ) 2-UL Table 1: Inventory and flow analysis for two panicking HFT market makers: delay δ = 2;time τ is even; HFTs orders are issued on even timesteps and executed on odd timesteps.Negative panics (and executable buy orders) never occur, so asks are not shown. Columns4 to 7 give: orders issued ( orders ); trades executed ( xorders ); trade confirmations sentbut not yet received ( pending xorders ); and confirmations received ( dxorders ). Ordersare denoted by θ b (bid) and θ S (sell), followed by the size; panic inventories are bolded.One confirmation flow is highlighted in grey. The rows at times τ and τ +12 are identicaland after time τ +12 the market infinitely repeats the flows and inventories from times τ +1 to τ +12, with both HFTs oscillating in and out of panic. .5. Infinite oscillation The alternate phase-shifting illustrated in Table 1 is due to the bidirec-tional coupling between the two market makers, and this can lead to aninfinite oscillation where two market makers trade with each other indefi-nitely. This is highly unusual for market makers, who make a loss on eachfilled executable order — this behaviour is not motivated by any economicimperative but is an artefact of the unintentional dynamic coupling betweenthe two automated strategies. Our analysis demonstrates that an infiniteoscillation is theoretically possible by detecting the case where the marketstate repeats itself — in particular, the repetition of a sub-state consistingof the two inventories and the outstanding trades whose confirmations havenot yet been delivered. This is illustrated in Table 1 at times τ and τ + 12.The inventory and flow analysis in Table 1 provides a detailed understandingof how such oscillations may occur, and we have found flow analysis espe-cially helpful in understanding markets with delays. The resulting changes ininventory for the two market makers is further illustrated in Figure 7 (Left).Manual algebraic manipulation is appropriate for markets involving rel-atively few instances of coupling, and flow analysis helps to explore marketbehaviour in great detail over a short timescale. Although it is possible to au-tomate algebraic manipulation using a symbolic algebra application, we havefound numerical simulation to be more helpful for modelling and analysingthe behaviour of complex feedback markets over longer timescales; we viewnumerical simulation as an important component of hypothesis formulation,to assist in clarifying hypotheses and the consequences that ensue from thelogic embodied in a given hypothesis given certain initial conditions.We have built a numerical simulator (“InterDyne” ) that visualizes ourmodel by animating all its underlying equations through time (as mentionedin Section 4.1). This allows us to monitor time-varying interactions betweendifferent components. Our simulator also allows us to expand our recurrencerelations to be substantially more complex and to encompass a much greaterrange of real behaviour, such as randomised order arrival times at the ex-change, the execution of crossed bids and asks, and markets with a largenumber of heterogeneous market makers using different order pricing and In a flat market, they gain the spread on executions of pairs of bid and ask limitorders, but lose the spread on an executable order. InterDyne was originally coded in the functional language Miranda (Turner (1985),Clack (1995)).
A necessary precondition for oscillatory instability is that at least onemarket maker should be in a panic state. We have previously demonstratedhow a fundamental trader can provoke a market maker into a panic state ifthere is an information delay, and Figure 7 (Right) shows this in simulationfor four heterogeneous market makers with randomised order arrival times,leading to a phase-shifting oscillation.In this example, the four market makers have different inventory limitsand different order pricing and sizing functions. For example, resting ordersizes are chosen randomly in a range bounded by 0 and a maximum givenby Equation (6). They are all initially in a stable state within the inventorylimits. However, a fundamental seller (not shown in the figure) who issuesa fixed number of executable orders in the first few timesteps can lead onemarket maker to panic, and then the other market makers.
Trader 1 Trader 2 I n v e n t o r y *me UL LL
PANIC I n ve n t o r y Time
UL 0 LL 2LL 0 100
Figure 7: Left: oscillatory instability with two homogeneous traders moving in and out ofpanic in contra-correlation. Right: oscillating inventories of four coupled heterogeneoustraders in a delayed market — inventories are initially stable, but the market makers areprovoked into panic by a single fundamental seller (not shown) issuing sells at the start ofthe simulation; this seller stops once panic has been provoked. In both figures the shadedzone indicates the stable region of the trader with the smallest inventory limit.
Figure 8 shows the dynamic inventories of five homogeneous market mak-ers when a market exhibits a minimal information delay of one time step, and30hen order arrival times at the exchange are randomised at each time step.For this example, two of the traders start trading from a positive-inventorypanic state, another two traders start from a negative-inventory panic state,and the last trader starts with an inventory of zero. I n v en t o r y Time
0 100 UL 0 LL
Figure 8: Inventory changes for paired coupling in a market with five homogeneous marketmakers. The shaded zone is a stable state zone within the algorithms’ inventory limits.
Figure 8 shows the simulation for the first 100 time steps. In roughlythe first 25 steps all market makers trade among themselves causing periodicjumps to the panic state and back (due to information delay). These jumpsare undesired because the executable orders typically incur financial loss;the market makers therefore try to avoid those jumps by restraining theirresting orders when their inventories approach the limits
U L and LL . In theremaining 75 steps three out of five market makers manage to stabilize theirinventories near the limit U L . At an inventory of exactly
U L − Figure 5 shows how market prices are coupled to the previously describedinventory feedback loop, and we have demonstrated how even a very smallinformation delay can trigger that feedback loop to create an oscillating insta-bility in the market maker inventories. What we have not yet demonstrated31s the extent to which inventory instability can affect market price — i.e. thestrength of the coupling relationship between inventories and prices.In Section 4.2.1 we presented Equation (5) to specify how the matchingengine “walks the book” in order to fill an executable order, and Figure 3illustrated how, given a particular distribution of limit orders on the book,a large total size of executable orders is more likely (than a small size) todeplete the top price level on the book and cause a jump in execution price.The effects on market price are subtle; different distributions of startinginventories lead to different distributions of orders on bidbook and askbook and therefore different probabilities that a particular executable order willcause a price jump. However, in our simple case study we found that acoarse measure of the pressure from large executable orders overwhelmingthe liquidity on the book can be used as a good “rough guide” to changes inprice — it causes prices to change within a single time step, and changes thebasic parameters (e.g. best bid and best ask) that drive the pricing functions.Our coarse measure (for which we make no general claims) subtractsthe pressure on resting bids from the pressure on resting asks, and we callthis “Net Liquidity Pressure”; if its value is mostly positive we predict risingprices, and if it is mostly negative we predict falling prices. In our case studyall orders are Fill And Kill, and this simplifies the definitions enormously: N et Liquidity P ressure t = (cid:80) i ψ ( i, Buys t )1 + (cid:80) i ψ ( i, Asks t ) − (cid:80) i ψ ( i, Sells t )1 + (cid:80) i ψ ( i, Bids t )Figure 9 illustrates the price impact associated with coupling-inducedinventory oscillations. The results of two numerical simulations are shown,with graphs set out in two rows — the top row is an example oscillationcausing market price to rise, and the bottom row is an example causing priceto drop. In each row there are three graphs showing, from left to right, themarket maker inventories, the Net Liquidity Pressure, and the market price.Each simulation comprises a market with an exchange and five heteroge-neous market makers (with different inventory limits, different pricing andsizing functions, and where messages to the exchange are randomised at eachtime step), and a delay in trade confirmations of just one time step ( δ = 1). Menkveld (2013) observes that prices are negatively correlated with HFT inventories. The “1+” in the denominator addresses the case where there is no resting liquidity.
32n both cases, we assume that prior to the start of the simulation at least onemarket maker has been induced to panic, and that the fundamental traderhas now withdrawn from the market. Thus, whatever happens to the priceduring these simulations is not due to any fundamental trading — it can onlybe due to the trading between the market makers themselves.For the upper simulation, two market makers start with inventories innegative panic and the rest have zero inventories: for the lower simulation,two market makers start with inventories in positive panic and the rest havezero inventories. In both cases, the inventories are highly unstable withrepeated phase switches into and out of panic (both positive and negativepanics). The net liquidity pressure for the upper simulation is mostly posi-tive, and the rightmost graph shows that market prices rise by about 50% in500 time steps (equivalent to about 100 ms ); the net liquidity pressure for thelower simulation is mostly negative, and the rightmost graph shows marketprices dropping by about 40% over the same timescale. I n ve n t o r y Time -20000 -10000 0 10000 20000 L i qu i d i t y Time
Net Liquidity Pressure 0 500 P r i ce Time P b
0 500 I n ve n t o r y Time
0 500 3UL 2UL UL 0 LL -20000 -15000 -10000 -5000 0 5000 10000 L i qu i d i t y Time
Net Liquidity Pressure 0 500 P r i ce Time P b
40% 0 500
Figure 9: Coupling-induced heterogeneous inventory oscillation, net liquidity pressure,and market prices for two simulations (upper row and lower row). UL and LL are thelimits for the trader with the largest limits and UL = -LL for all traders.
The results of Figure 9 indicate that if market makers are induced totrade amongst themselves while other traders exit from the market, then arapid and appreciable impact on price (up or down) is theoretically possible.Finally, Figure 10 recreates the price behaviour during the Flash Crashof 2010, using public data wherever possible (CFTC-SEC, 2010; Kirilenko33 r i ce Time
0 3m P b
1% 2% 3% 4% 5% 6%
E-Mini Price Simulated Price
Figure 10: Comparison of E-Mini futures price drop during 3 minutes of the Flash Crash(from 14:42.30 to 14:45.27) with 12 oscillating HFTs, opportunistic and other traders. et al., 2010; Nanex, 2010a). Our simulation uses known factors such as thenet HFT inventory, total contracts traded within the selected 3 minutes,and the reported mixture of HFT and Opportunistic traders, but there isinsufficient public data available for a detailed model and other factors mustbe assumed or estimated.Even with very limited public data, our model of dynamic coupling andfeedback provides a reasonable approximation to the key price dynamics.Figure 10 illustrates that it is possible to use a low-level dynamic interactionmodel during hypothesis formulation for understanding real events.Mimicking the price movements of the Flash Crash is not new (e.g. Pad-drik et al. (2012)), but our approach has the benefit that it is amenable toformal analysis. We have given some examples of analysis in this article, andwe are developing more sophisticated techniques.
6. Conclusion
We have demonstrated how coupling between trading algorithms (espe-cially HFTs) can destabilize markets, and have introduced a new techniquefor modelling dynamic interaction at varying levels of abstraction. Our casestudy has shown how unexpected latency and feedback may trigger instabil-ity as an unintentional emergent behaviour.The concept of “coupling” (including static, dynamic and time-dependentcoupling) has been defined as a bilateral behavioural dependency betweensubsystems of a market, where a “subsystem” has been defined inductivelyto be a single component or an entity comprising other subsystems. We havethen defined feedback loops in terms of cyclic chains of couplings, and these34efinitions underlie our ability to describe a wide variety of market feedbackbehaviour at multiple levels of detail, and specifically our ability to modeldynamic interaction at the level of the market microstructure.We have introduced a general framework for modelling dynamic interac-tion and feedback, where recurrence relations in discrete time are used toexpress the precise nature of bilateral couplings. Our dynamic interactionmodels are at a sufficiently low level to express and reason about mechanisticcausality, yet are highly flexible in that different parts of the model can beat different levels of detail. The framework also supports the precise expres-sion of communication latencies. We have demonstrated how such modelscan be used during hypothesis formulation and can be analysed to provideunderstanding of the causes and triggers of feedback and prerequisites forinstability. We have also shown how we use numerical simulation to trackthe time-varying value of a specific variable such as market price, based ona set of starting conditions and a set of recurrence relations to describe agiven market; this provides a further way to analyse the feedback dynamicsof a particular model, and we have used this to show how low-level instabil-ity in the microstructure of a market can cause high-level instability such ascrashes and spikes in market price.We have explored unexpected latency (“delay”) as an example trigger forfeedback instability; this has been illustrated with a case study using simple,stable, HFT market makers with inventory constraints in an order-book mar-ket. We have expained how dynamic coupling between the HFTs (via theorder book) leads to a feedback loop, and how delays can then induce thesestable algorithms into an oscillatory instability, phase-shifting with preciselyanti-correlated synchrony into and out of inventory panic (“hot potato” trad-ing). We have also shown how coupling-induced feedback between HFTs canbe self-exciting — in the absence of other effects, it can lead to a theoreticallyinfinite instability. These effects are induced by the size of delay relative tothe frequency of trading; thus, because short delays occur much more fre-quently than long delays, HFTs are more likely to suffer from these effectsthan low-frequency traders. In broader terms, our analysis suggests that in-stability can arise as an unintentional emergent behaviour of markets; i.e. itarises not as a consequence of algorithm complexity or predatory behaviour,but instead as a result of transitive interaction effects. Such emergent insta-bility can arise for a wide range of heretogeneous algorithms with differingorder-pricing and order-sizing functions, and is considerably more complexthan a simple “resonance” effect. Although we would not expect feedback35oops to cause major market instability during equilibrium trading (due tothe large mix of strategies (Hasbrouck and Saar, 2013) and because tradeswithin a feedback loop would be outnumbered by other trades), we do expectfeedback to become dominant at times of market breakdown when there arefewer traders, and fewer and more correlated trades.We believe that the concept of feedback as a cyclic chain of bilateralcouplings is essential to understanding emergent instability from stable com-ponents. Further, we find that the creation of dynamic interaction modelsbased on recurrence relations is an extremely helpful technique in exploringfeedback dynamics, to be used alongside other methods during hypothesisformulation. We have not demonstrated how large-scale dynamic interactionmodels can be constructed and analysed, and clearly there are importantissues still to be resolved such as determining how to analyse a very largemarket model to determine whether (and how many) feedback loops exist, tocompare the relative importance or strength of different feedback loops, andhow likely a given market model is to suffer from feedback-induced instability.Although our case study focuses on oscillation arising from the interactionof HFT market makers, we suspect that many previously observed feedbackloops (Danielsson et al., 2012; Zigrand et al., 2012) may also be modelledand analysed using our general framework. Our work may therefore help tounderstand previously unexplained sources of volatility in financial markets;it may also have implications for models of pricing and market impact, sincewe demonstrate that traders do not necessarily have independence of actionand such models might need to account for unexpected coupling with othertraders.From a practitioner perspective, our dynamic interaction models mayhelp to understand how algorithms and markets could be re-engineered toimprove stability. Since even stable algorithms may be subject to dynamicfeedback, traders might now decide to test their algorithms for vulnerabilityto common modes of feedback instability; execution venues might now decideto offer deterministic latency to improve stability, or to monitor feedbackeffects and provide enhanced information to subscribers; and regulators mightdecide to use feedback models to help anticipate the efficacy and consequencesof proposed regulation — especially during periods of disequilibrium, whenregulatory control can be particularly important.36 ppendix A. Definitions of functions ψ ()The function ψ () is applied to a sequence of orders x and sums the sizesof all those orders with trader identifier i . We use the notation for sequencesdefined in Section 4.2.1, and we model each order as a quadruplet ( a, b, c, d )containing the type of order ( a ), the size of the order ( b ), the price of a limitorder ( c ) and the trader identifier ( d ). The function ψ () is defined as follows: ψ ( i, x ) = {} if ( x = {} ) b + ψ ( i, r ) if ( x = ( a, b, c, d ) : r ) and ( d = i ) ψ ( i, r ) if ( x = ( a, b, c, d ) : r ) and ( d (cid:54) = i ) bidprice () and askprice () bidprice () and askprice () calculate the prices of resting limit orders. Theprices are varied linearly according to the current inventory (the aim is thatinventory should be zero-reverting). The functions each take the same threearguments — the best bid, the best ask, and the inventory. The bid price isgreatest when the inventory is smallest (we set bidprice = midprice − LL +1), and the ask price is lowest when inventory is highest (weset askprice = midprice + 1 when inventory is U L − bidprice = midprice − − ζ when inventory is U L − askprice = midprice + 1 + ζ when inventory is LL + 1, where ζ is arbitrarily chosen (e.g. we use half theCME price band), and we ensure prices do not become negative. bidprice ( bb, ba, inv ) = max (0 , (( ba + bb ) / − − ζ × (1 − UL − − invUL − LL − )) askprice ( bb, ba, inv ) = max (0 , (( ba + bb ) /
2) + 1 + ζ × ( UL − − invUL − LL − )) insertask () and insertbid() These functions insert a sequence of new orders (argument z ) into anorderbook sequence (argument x ). The orderbook must be sorted to en-sure price-time ordering: the first order has the lowest price for askbook and the highest price for bidbook . We use the notation introduced in Sec-tion 4.2.1 for sequences. As explained above, orders are quadruplets — e.g.37 type, size, price, id ). The definition below is for insertask (): the definitionfor insertbid () is identical except that the relational tests are reversed. insertask ( x, z ) = x if ( z = {} ) insertask ( { a } , y ) if ( x = {} ) and ( z = a : y ) insertask (( τ, σ, π, i ) : x, y ) if ( x = ( d, e, f, g ) : q ) and ( z = ( τ, σ, π, i ) : y ) and ( π < f )( d, e, f, g ) : ( insertask ( q, z )) if ( x = ( d, e, f, g ) : q ) and ( z = ( τ, σ, π, i ) : y ) and ( π ≥ f ) match() The function match () takes a sequence of limit orders ( l ) and a sequenceof market orders ( m ), and returns a triple containing (i) a revised sequence oflimit orders (after executed orders have been deleted, and partial executionsamended), (ii) a sequence of executed limit orders, and (iii) a sequence ofexecuted market orders. We either denote an order by a single letter “ x ” orby a quadruplet “( a, b, c, d )” to access its components. The definition (whichdiscards unmatched market orders) follows the structure of Equation 5. match ( l, m ) = ( {} , {} , {} ) if ( l = {} )( l, {} , {} ) if ( m = {} )( i, ( a, f, c, d ) : j, ( e, f, g, h ) : k ) if ( l = ( a, b, c, d ) : q ) and ( m = ( e, f, g, h ) : z ) and f < band ( i, j, k ) = match (( a, b − f, c, d ) : q, z )( i, ( a, b, c, d ) : j, ( e, b, g, h ) : k ) if ( l = ( a, b, c, d ) : q ) and ( m = ( e, f, g, h ) : z ) and f > band ( i, j, k ) = match ( q, ( e, f − b, g, h ) : z )( i, ( a, b, c, d ) : j, ( e, b, g, h ) : k ) if ( l = ( a, b, c, d ) : q ) and ( m = ( e, f, g, h ) : z ) and f = band ( i, j, k ) = match ( q, z ) eferences Amihud, Y., Mendelson, H., 1980. Dealership Market Market-Making with Inventory.Journal of Financial Economics 8, 31–53.Arthur, W. B., Holland, J. H., Lebaron, B., Palmer, R., Tayler, P., 1996. Asset PricingUnder Endogenous Expectations in an Artificial Stock Market. Tech. Rep. 9625, SocialSystems Research Institute, University of Wisconsin-Madison.Beja, A., Goldman, M. B., 1980. On The Dynamic Behavior of Prices in Disequilibrium.Journal of Finance 35 (2), 235–248.Bouchaud, J.-P., Cont, R., Dec. 1998. A Langevin approach to stock market fluctuationsand crashes. The European Physical Journal B 6 (4), 543–550.Brock, W., Hommes, C., Jul. 1998. Heterogeneous beliefs and routes to chaos in a simpleasset pricing model. Journal of Economic Dynamics and Control 22 (8-9), 1235–1274.Brunnermeier, M. K., Pedersen, L. H., 2005. Predatory Trading. Journal of Finance 60 (4),1825–1863.Caldarelli, G., Arsili, M., Zhang, Y.-C., 1997. A prototype model of stock exchange.Europhysics Letters (EPL) 40, 479.CFTC-SEC, 2010. Findings regarding the market events of May 6, 2010. Tech. Rep. 202,US Commodity Futures Trading Commission & Securities and Exchange Commission.Chakraborty, T., Kearns, M., 2011. Market making and mean reversion. In: ACM Con-ference on Electronic Commerce (EC). ACM Press, pp. 307–314.Chen, C-C., Nagl, S. B., Clack, C. D., 2007. A calculus for multi-level emergent behavioursin component-based systems and simulations. In Proceedings of Emergent Propertiesin Natural and Artificial Complex Systems (EPNACS 2007), 35–51.Chen, C-C., Nagl, S. B., Clack, C. D., 2008. A method for validating and discoveringassociations between multi-level emergent behaviours in agent-based simulations. InKES International Symposium on Agent and Multi-Agent Systems: Technologies andApplications, Springer. 1–10.Chen, C-C., Nagl, S. B., Clack, C. D., 2009. A formalism for multi-level emergent be-haviours in designed component-based systems and agent-based simulations. In FromSystem Complexity to Emergent Properties. Springer. 101–114.Chen, C-C., Clack, C. D., Nagl, S. B., 2010. Identifying multi-level emergent behaviors inagent-directed simulations using complex event type specifications. Simulation, 86(1),41–51. hiarella, C., 1992. The Dynamics of Speculative Behaviour. Annals of Operations Re-search 37, 101–123.Chiarella, C., He, X., Hommes, C., Oct. 2006. Moving average rules as a source of marketinstability. Physica A: Statistical Mechanics and its Applications 370 (1), 12–17.Chordia, T., Goyal, A., Lehmann, B. N., Saar, G., 2013. Editorial - high frequency trading.Journal of Financial Markets 16 (4), 637–645.Clack, C. D., Myers, C., Poon, E., 1995. Programming with Miranda. Prentice Hall.Comerton-Forde, C., Hendershott, T., Jones, C. M., Moulton, P. C., Seasholes, M. S., 2010.Time Variation in Liquidity: The Role of Market-Maker Inventories and Revenues. TheJournal of Finance 65 (1), 295–331.Cont, R., Bouchaud, J.-P., 2000. Herd behavior and aggregate fluctuations in financialmarkets. Macroeconomic Dynamics 4, 170–196.Corvil, 2009. Low Latency Market Data. Tech. rep., Corvil Ltd.Cvitanic, J., Kirilenko, A., 2010. High frequency traders and asset prices, Working Paper,Cal. Tech.Danielsson, J., Shin, H. S., Zigrand, J.-P., 2012. Endogenous extreme events and the dualrole of prices. Annual Review of Economics 4 (1), 111–129.Day, R. H., Huang, W., 1990. Bulls, Bears and Market Sheep. Journal of Economic Be-havior and Organization 14, 299–329.Eholzer, W. E., 2013. Some insights into the details that matter for high-frequency trading!Tech. Rep. November, Eurex.Farmer, J. D., Joshi, S., Oct. 2002. The price dynamics of common trading strategies.Journal of Economic Behavior & Organization 49 (2), 149–171.Gennotte, G., Leland, H., 1990. Market liquidity, hedging, and crashes. The AmericanEconomic Review 80 (5), 999–1021.Giardina, I., Bouchaud, J.-P., Jun. 2003. Volatility clustering in agent based market mod-els. Physica A: Statistical Mechanics and its Applications 324 (1-2), 6–16.Hasbrouck, J., Saar, G., Nov. 2013. Low-latency trading. Journal of Financial Markets16 (4), 646–679.Hommes, C., Wagener, F., 2009. Complex Evolutionary Systems in Behavioral Finance.In: Handbook of Financial Markets: Dynamics and Evolution. Elsevier, pp. 217–276.Huang, K., Simchi-Levi, D., Song, M., Jul. 2012. Optimal Market-Making with Risk Aver-sion. Operations Research 60 (3), 541–565. urner, D. A., 1985. Miranda: A non-strict functional language with polymorphic types.In Proceedings Conference on Functional Programming Languages and Computer Ar-chitecture, Springer. 1–16.Westerhoff, F. H., 2003. Market-maker, inventory control and foreign exchange dynamics.Quantitative Finance 3, 363–369.Zigrand, J.-P. L., Shin, H. S., Beunza, D., 2012. Feedback effects and changes in thediversity of trading strategies. The UK Government Office for Science, Foresight ProjectDriver Review 2.urner, D. A., 1985. Miranda: A non-strict functional language with polymorphic types.In Proceedings Conference on Functional Programming Languages and Computer Ar-chitecture, Springer. 1–16.Westerhoff, F. H., 2003. Market-maker, inventory control and foreign exchange dynamics.Quantitative Finance 3, 363–369.Zigrand, J.-P. L., Shin, H. S., Beunza, D., 2012. Feedback effects and changes in thediversity of trading strategies. The UK Government Office for Science, Foresight ProjectDriver Review 2.