stationarity of the order book and give some hints about the behaviour of the price process in long
time scales.
Keywords: Limit order book; agent based modelling; order flow; bid-ask spread; Markov chain.
The emergence of algorithmic trading as a major means of trading financial assets makes the study of the order
book central to the understanding of the mechanism of price formation. In order driven markets, buy and sell orders
are matched continuously subject to price and time priority. The order book is the list of all buy and sell limit orders,
with their corresponding price and size, at a given instant of time. Essentially, three types of orders can be submitted:
• Limit order : Specifies a price (also called “quote”) at which one is willing to buy or sell a certain number of
shares;
• Market order : Immediately buy or sell a certain number of shares at the best available opposite quote;
• Cancellation order : Cancel an existing limit order.
In the econophysics literature, “agents” who submit exclusively limit orders are referred to as liquidity providers.
Those who submit market orders are referred to as liquidity takers.
Limit orders are stored in the order book till they are either executed against an incoming market order or cancelled.
The ask price P A is the price of the best (i.e. lowest) limit sell order. The bid price P B is the price of the best (i.e.
highest) limit buy order. The gap between the bid and the ask
S := P A − P B ,
is always positive and is called the spread. Prices are not continuous, but rather have a discrete resolution ∆P , the
tick, which represent the smallest quantity by which they can change. We define the mid-price as the average between
the bid and the ask
PA + PB
P := .
2
The price dynamics is the result of the interplay between the incoming order flow and the order book. Figure 1 is
a schematic illustration of this process. Note that we chose to represent quantities in the bid side of the book by
negative numbers.
Although in reality orders can have any size, we shall assume throughout this note that all orders are of unit size
τ . This assumption is convenient to carry out our analysis and is, for now, of secondary importance to the problem
we are interested in.
∗ E-mail: frederic.abergel@ecp.fr
† E-mail: aymen.jedidi@ecp.fr
2
Lf (P ) = q λ+ (f (P + ∆) − f ) + λ− (f (P − ∆) − f ) .
(3)
It is well known that a continuous limit obtains with suitable assumptions on the intensity and tick size. Noting that
(3) can be rewritten as
1 f (P + ∆) − 2f + f (P − ∆)
Lf (P ) = q(λ+ + λ− )∆2
2 ∆2
f (P + ∆) − f (P − ∆)
+ q(λ+ − λ− )∆P , (4)
2∆
and under the following assumptions
(
q(λ+ + λ− )∆2 −→σ 2 as ∆ → 0,
(5)
q(λ+ − λ− )∆−→µ as ∆ → 0,
σ2 ∂ 2 f ∂f
2
+µ , (6)
2 ∂P ∂P
corresponding to a Brownian motion with drift. This simple case is worked out as an example of the type of limit
theorems that we will be interested in in the sequel. One should also note that a more classical approach using the
Functional Central limit Theorem (FCLT) as in [Whi02] yields similar results: For given fixed values of λ+ , λ− and
∆, the rescaled, centred price process
√ P t − µδ t
δ δ (7)
σ
converges as δ → 0, to a standard Brownian motion Bt where
( p
σ = ∆ (λ+ + λ− )q,
(8)
µ = ∆(λ+ − λ− )q.
3
Let us mention that one can easily achieve more complex diffusive limits such as a local volatility model by imposing
that the limit is a function of P and t
(
q(λ+ + λ− )∆2 → σ 2 (P, t),
(9)
q(λ+ − λ− )∆ → µ(P, t),
always a possibility if the original intensities are functions of P and t themselves. The case of stochastic volatilities is
also encompassed by diffusive limits of these models. For instance consider the following pure-jump model for P and
the intensities λ+ , λ−
Lf (P, λ+ , λ− ) = q λ+ (f (P + ∆P ) − f ) + λ− (f (P − ∆P ) − f )
+ ν + f (J ++ λ+ , J −+ λ− ) − f + ν − f (J +− λ+ , J −+ λ− ) − f ,
(11)
−
where ν + , ν − are the intensities of λ+
t , and λt respectively.
In a more general fashion, we will use the expression generalized Bachelier market to designate a market model
where the best bid and ask prices, or equivalently the mid-price and the spread, obey the following type of dynamics
Q
X
dPt = ∆ Zti dMti , (12)
i=1
where the Mti are independent Poisson processes and the marks Zi are random variables with finite means and
variances. The same standard results on martingale convergence as the one used above show that the rescaled,
centred price process
√ h i
δ P δt − E P δt (13)
converges to a Gaussian process with a diffusion coefficient determined by the variance of the marks and the intensities
of the Poisson processes. This extension of the Bachelier market will come in handy in section VI, where we study
the stationary order book in a more general setting.
Model setup
We now consider the dynamics of a general order book under a Poisson type assumption for the arrival of new
market orders, limit orders and cancellations. We shall assume that the whole order book is fully described by a fixed
number of limits N , ranging at each time from 1 to N ticks away from the best available opposite quote. By doing so,
we adopt the representation described e.g. in [SFGK03] or [CST08], but depart slightly from it by adopting a finite
moving frame, as we think it more realistic and also, more convenient when scaling in tick size will be addressed. Let
us now recall the type of events that may happen:
• arrival of a new market order,
• arrival of a new limit order,
• cancellation of an already existing limit order.
These events are described by independent Poisson processes:
4
• L±i i±
t : arrival of a limit order i ticks away from the best opposite quote; with intensity λL ,
ai i− bi
• Ct±i : cancellation of a limit order i ticks away from the best opposite quote; with intensity λi+
C , λC .
τ τ
where, as usual, ∆P is the tick size, τ the size of any new incoming order, and the superscript “+” (respectively “−”)
refers to the ask (respectively bid) side of the book. The intensity of the cancellation process at level i is proportional
to the available quantity at that level.
We impose constant boundary conditions outside the moving frame of size 2N : Every time the moving frame leaves
a price level, the number of shares at that level is set to a∞ (or b∞ depending on the side of the book). Note that
this makes the model Markovian as we do not keep track of the price levels that have been visited (then left) by the
moving frame at some prior time.
where the J’s are shift operators corresponding to the number of ticks by which the best bid (respectively ask) moves
following an event on the ask side (respectively bid side) of the book. For instance the shift operator corresponding
to the arrival of a sell market order of size τ is
b
JM (a) = 0, 0, . . . , 0, a1 , a2 , . . . , aN −k , (15)
| {z }
k times
with
p
X
k = inf{p : bj > τ } − inf{p : bp > 0}, (16)
j=1
Similar expressions can be derived for the other set of events affecting the order book. Also one should note that the
last two summations in (14) are in fact taken only on the range of indexes smaller than the spread (in ticks).
In the next sections, we will study some general properties of such models, starting with the generator associated
to this 2N -dimensional continuous-time Markov chain.
5
Let us now work out the infinitesimal generator associated to the jump process described above. One can derive
the following result:
Lf (a; b) = λ+ i i−1 a
M f (a − (τ − A )+ )+ ; JM (b) − f
N
X
λi+ i i+
+ L (f a + τ ; JL (b) − f )
i=1
N
X ai
λi+ (f ai − τ ; JCi+ (b) − f )
+ C
i=1
τ
+ λ− b i i−1
M f JM (a); (b − (τ − B )+ )+ − f
N
X
λi− i− i
+ L (f JL (a); b + τ − f )
i=1
N
X bi
λi− (f JCi− (a); bi − τ − f ),
+ C (17)
i=1
τ
where, to ease the notations, we note f (ai ; b) instead of f (a1 , . . . , ai , . . . , aN ; b) etc. The operator above, although
cumbersome to put in writing, is simple to decipher: a series of standard difference operators corresponding to the
“deposition-evaporation” process of orders at each limit, combined with the shift operators expressing the moves in
the best limits and therefore, in the origins of the frames for the two sides of the order book. Clearly, the interesting
part lies in the coupling of the two sides of the book: the shifts on the a’s depend on the b’s, and vice versa. More
precisely the shifts depend on the profile of the order book on the other side, namely the cumulative number of orders
Xi
A = ak ,
i
k=1
(18)
X i
Bi = bk
k=1
Note that the index corresponding to the best opposite quote equals the spread S in ticks, that is
p
−1
X S
iA = A (0) = inf{p : aj > 0} = = iS ,
∆P
j=1
p
(20)
−1
X S
iB = B (0) = inf{p : bj > 0} = = iS .
j=1
∆P
6
V. PRICE DYNAMICS
Let us focus on the dynamics of the best ask and bid price, denoted by PtA and PtB . One can easily see that they
satisfy the following SDE:
" #
XN
dP A = ∆P (A−1 (τ ) − A−1 (0))dMt+ − (A−1 (0) − i)+ dLi+
t + (A
−1
(τ ) − A−1 (0))dCtiA +
t
i=1
" # (21)
XN
B −1 −1 − −1 i− −1 −1 i −
dPt = −∆P (B (τ ) − B (0))dMt − (B (0) − i)+ dLt + (B (τ ) − B (0))dCt B
i=1
which describes the various events that affect them: change due to market order, change due to new limit orders
inside the spread, and change due to the cancellation of limit orders at the best price. One can summarize these two
equations in order to highlight, in a more traditional fashion, the respective dynamics of the mid-price and the spread:
∆P −1
dPt = (A (τ ) − A−1 (0))dMt+ − (B −1 (τ ) − B −1 (0))dMt−
2
N
X N
X
− (A−1 (0) − i)+ dLi+
t + (B −1 (0) − i)+ dLi−
t
i=1 i=1
−1 −1
(0))dCtiA + − (B −1 (τ ) − B −1 (0))dCtiB − .
+ (A (τ ) − A (22)
N
X N
X
−1
− (A (0) − i)+ dLi−
t − (B −1 (0) − i)+ dLi+
t
i=1 i=1
The set of equations above are interesting in that they relate in an explicit way the profile of the order book with
the size of an elementary jump of the mid-price or the spread, therefore linking the volatility dynamics with order
arrival. For instance the “infinitesimal” drifts of the mid-price and of the spread, conditional on the shape of the
order book at time t, are given by
∆P −1
E [dPt |(at ; bt )] = (A (τ ) − A−1 (0))λ+
M − (B
−1
(τ ) − B −1 (0))λ−
M
2
N
X N
X
− (A−1 (0) − i)+ λi+
L + (B −1 (0) − i)+ λi−
L
i=1 i=1
−1 −1
(0))λiCA + − (B −1 (τ ) − B −1 (0))λiCB − dt,
+ (A (τ ) − A (24)
and
Of the utmost interest is the behaviour of the order book in a stationary state. We have the following result[15]:
N
X N
X
−
Lϕ(a; b) ≤ (λi+ i− +
L + λL )τ − (λM + λM )τ − (λi+ i i− i
C a + λC |b |)
i=1 i=1
N
X N
X
∞ ∞
+ λi−
L (iS − i)+ a + λi+
L (iS − i)+ |b | (26)
i=1 i=1
− −
≤ N (λ+ +
L + λL )τ − (λM + λM )τ − λC f (a; b)
+ N (N + 1)(λ−
La
∞
+ λ+ ∞
L |b |) (27)
where λ± i± i±
L = max1≤i≤N {λL } and λC = min1≤i≤N {λC } > 0.
The first three terms in the r.h.s. of inequality (26) correspond respectively to the arrival of a limit, market, or
cancellation order — ignoring the effect of the shift operators. The last two terms are due to shifts occurring after
the arrival of a limit order within the spread. The terms due to shifts occurring after market or cancellation orders
(which we do not put in the r.h.s) are negative, hence the inequality. To obtain inequality (27), we used the fact that
the spread iS (and hence (iS − i)+ ) is bounded by N + 1 — a consequence of the boundary conditions we impose.
Let γ be a positive constant and K a constant such that
− − ∞ −
γ + N (λ+
L + λL )τ + N (N + 1)(λL a + λ+ ∞ +
L |b |) − (λM + λM )τ
K > max{τ, }.
λC
We have:
• if ϕ(a; b) > K then
Lϕ(a; b) ≤ −γ;
R1
• the random variables sup{ϕ(Xt ) : t ≤ 1} and 0
|Lϕ(Xt )|dt are integrables;
• the set F = {(a; b) : ϕ(a; b) ≤ K} is finite.
By proposition 8.14 in [Rob03] (appendix A), we conclude that the Markov process Xt = (at ; bt ) is ergodic.
Remark 1 As a corollary of Proposition 1, the spread S = A−1 (0) has a well-defined stationary distribution. (This
is expected as by construction the spread is bounded by N + 1)
The stationarity of the order book is essential for the study of the long term behaviour of the price. We recall
equation (22) giving the mid-price increments
∆P −1
dPt = (At (τ ) − A−1 + −1 −1 −
t (0))dMt − (Bt (τ ) − Bt (0))dMt
2
N
X N
X
− (A−1
t (0) − i)+ dL i+
t + (Bt−1 (0) − i)+ dLi−
t
i=1 i=1
(A−1 A−1 iA +
− (Bt−1 (τ ) − Bt−1 (0))dCtiB − .
+ t (τ ) − t (0))dCt (28)
In order to clarify the dependence of the price process on the order book dynamics, let us introduce the following
deterministic functions:
• Φ : NN → {0, . . . , N }; Φ(a) = A−1 (τ ) − A−1 (0). Φ is the price impact in ticks of a market order of size τ (or
of a cancellation order at the best price);
• Ψ : NN → {1, . . . , N + 1}; Ψ(a) = A−1 (0). Ψ gives the value of the spread in ticks.
8
Should the order book be in its stationary state, then the price increments are stationary, and the model is recast
under the form described in section II
Q
X
dPt = ∆ Zti dNti .
i=1
We are interested in the existence of a stochastic process limit Pet after proper scaling[16]
Pnt − E(Pnt )
Pet = lim √ . (30)
n→∞ n
In order to apply a generalized version of the Functional Centrale Limit Theorem, one needs to measure the dependence
of price increments dPt . The analytical study of the dependence structure (mainly the autocovariance of price
increments) is not obvious and we shall investigate it in a future work [AJ], but numerical simulation (see figures 5–6)
suggests that the large scale limit process Pet is a Brownian motion with a volatility determined by the variance of the
marks Z i and the intensities of the Poisson processes.
This note provides a simple Markovian framework for order book modelling, in which elementary changes in the
price and spread processes are explicitly linked to the instantaneous shape of the order book and the order flow
parameters. Two basic properties were investigated: the stationarity of the order book and the large scale limit of
the price process. The first property, to which we answered positively, is desirable in that it assures the stability of
the order book in the long run. The scaling limit of the price process is more subtle to establish and one can ask
if, within our framework, stochastic volatility effects can arise. Of course, more realistic stylized facts of the price
process (in particular fat tails and long memory) can be added if we allow more complex assumptions on the order
flow (e.g. feedback effects [PGPS06]). Further properties of this model and its extensions will be discussed in detail
in future work.
30 30 30
20 20 20
10 10 10
0 0 0
30 30 30
20 20 20
10 10 10
0 0 0
FIG. 1: Order book schematic illustration: A market buy order arrives and removes liquidity from the ask side, then limit sell
orders are submitted and liquidity is restored. [Fer08]
[16] Technically the convergence happens in D([0, ∞[), the space of R-valued càdlàg functions, equipped with the Skorohod
topology.
Let (Xt ) be an irreducible Markov jump process on the countable state space S, and L its infinitesimal generator.
If there exists a function f : S → R+ and constants K, γ > 0 such that:
• if f (x) > K then Lf (x) ≤ −γ;
R1
• the random variables sup{f (Xt ) : t ≤ 1} and 0
|Lf (Xt )|dt are integrables;
• the set F = {x : f (x) ≤ K} is finite,
then (Xt ) is ergodic.
Appendix B: Figures
We provide below some representative figures obtained by numerical simulation of the order book (fig. 2-6).
10
2
Quantity
-2
-4
-6
0.3
0.25
0.2
Frequency
0.15
0.1
0.05
0
0 2 4 6 8 10 12 14 16 18 20 22
Spread (ticks)
0.3
0.25
0.2
Frequency
0.15
0.1
0.05
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
p(t+h)-p(t) (ticks)
60
50
40
30
p(t)-p(0) (ticks)
20
10
-10
-20
-30
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Event time x 10
5
150
100
Var[p(Lag)-p(0)]
50
0
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Lag