Optimal split of orders across liquidity pools: a stochastic algorithm

Oct 22, 2009 - Optimization Algorithm. The (IID) setting: a.s. ...... portfolio and mean-reversion, The Journal of Trading, 4(3):40-46. Pag`es G. (2001).
2MB taille 13 téléchargements 301 vues
Optimal split of orders across liquidity pools: a stochastic algorithm approach `s Sophie Laruelle, Charles-Albert Lehalle & Gilles Page LPMA & Chevreux

Atelier TaMS - Coll`ege de France October 22, 2009

Gilles Pag` es

Optimal split of orders across liquidity pools

Outline 1

Introduction A simple model for the execution of orders by dark pools

2

Optimal allocation under constraints Optimization Algorithm The (IID) setting: a.s. convergence and CLT The (ERG ) setting: convergence

3

A reinforcement algorithm Existence of an equilibrium A competitive system

4

Numerical Tests The IID setting The ERG setting The pseudo-real data setting

5

Provisional remarks Gilles Pag` es

Optimal split of orders across liquidity pools

Outline 1

Introduction A simple model for the execution of orders by dark pools

2

Optimal allocation under constraints Optimization Algorithm The (IID) setting: a.s. convergence and CLT The (ERG ) setting: convergence

3

A reinforcement algorithm Existence of an equilibrium A competitive system

4

Numerical Tests The IID setting The ERG setting The pseudo-real data setting

5

Provisional remarks Gilles Pag` es

Optimal split of orders across liquidity pools

Static modelling The principle of a Dark pool is the following: It proposes a bid price with no guarantee of executed quantity at the occasion of an OTC transaction. Usually this price is lower than the bid price offered on the regular market. So one can model the impact of the existence of N dark pools (N ≥ 2) on a given transaction as follows: Let V > 0 be the random volume to be executed, Let θi ∈ (0, 1) be the discount factor proposed by the dark pool i. Let ri denote the percentage of V sent to the dark pool i for execution. Let Di ≥ 0 be the quantity of securities that can be delivered (or mase available) by the dark pool i at price θi S.

Gilles Pag` es

Optimal split of orders across liquidity pools

Cost of the executed order The rest of the order is to be executed on the regular market, at price S. Then the cost C of the whole executed order is given by

C

= S

N X

θi min (ri V , Di ) + S

V−

i=1

= S

N X

! min (ri V , Di )

i=1

V−

N X

! ρi min (ri V , Di )

i=1

where ρi = 1 − θi ∈ (0, 1), i = 1, . . . , N.

Gilles Pag` es

Optimal split of orders across liquidity pools

Mean Execution Cost Minimizing the mean execution cost, given the price S, amounts to solving the following maximization problem max

( N X

) ρi E (S min (ri V , Di )) , r ∈ PN

(1)

i=1

n o PN where PN := r = (ri )1≤i≤N ∈ RN | r = 1 . + i=1 i It is then convenient to include the price S into both random variables V and Di by considering e := V S V

e i := Di S and D

instead of V and Di .

Gilles Pag` es

Optimal split of orders across liquidity pools

The dynamical aspect We consider the sequence Y n := (V n , D1n , . . . , DNn )n≥1 . We will take two types of stationarity assumptions on the sequence (IID)



The sequence (Y n )n≥1 is i.i.d. with

  N+1 distribution ν = L(V , D1 , . . . , DN ) on RN+1 + , B(R+ ) .

(ERG )i



the sequence (V n , Din )n≥1 is a stationary Feller homogeneous Markov chain with distribution L(V , Di ), (ii) the sequence (V n , Din )n≥1 is ergodic i.e.   n   (R2+ ) 1X   P-a.s. δ k  k (V ,Di ) =⇒ νi = L(V , Di ),  n  (i)        

k=1

Gilles Pag` es

Optimal split of orders across liquidity pools

Towards some solutions

There are two approaches to deal with this problem. A classical maximization (under constraints using a Lagrangian). An approach, somewhat more intuitive, based on a reinforcement principle; the algorithm is devised by R. Berenstein and C.-A. Lehalle in keeping with R. Almgren. We will study both and try comparing their assets and drawbacks.

Gilles Pag` es

Optimal split of orders across liquidity pools

Outline 1

Introduction A simple model for the execution of orders by dark pools

2

Optimal allocation under constraints Optimization Algorithm The (IID) setting: a.s. convergence and CLT The (ERG ) setting: convergence

3

A reinforcement algorithm Existence of an equilibrium A competitive system

4

Numerical Tests The IID setting The ERG setting The pseudo-real data setting

5

Provisional remarks Gilles Pag` es

Optimal split of orders across liquidity pools

The mean execution function of a dark pool Let ϕ : [0, 1] → R+ be the mean execution function of a single dark pool defined by ∀r ∈ [0, 1] ,

ϕ(r ) = ρ E (min (rV , D))

(2)

where ρ > 0, (V , D) is an R2+ -valued random vector defined on a probability space (Ω, A, P). To ensure the consistency of the model, we assume that V > 0 P − a.s., V ∈ L1 (P)

and P(D > 0) > 0

(3)

The positivity of V means that we consider only true orders. The fact that D is not identically 0 means that the dark pool exists in practice.

Gilles Pag` es

Optimal split of orders across liquidity pools

The function ϕ is clearly concave, non-decreasing, bounded and if the distribution function of

D is continuous on R∗+ , V

(4)

then ϕ is everywhere differentiable on the unit interval [0, 1] with  ϕ0 (r ) = ρE 1{rV max ϕi . (9) i∈IN i∈IN N −1 Then arg maxHN Φ = arg maxPN Φ ⊂ int(PN ) where  arg max Φ = r ∈ PN | ϕ0i (ri ) = ϕ01 (r1 ), i = 1, . . . , N . PN

Gilles Pag` es

Optimal split of orders across liquidity pools

Interpretation and Comments Assumption (C) is a kind of homogenity assumption on the rebates made by the involved dark pools. If we assume that P(Di = 0) = 0

for every i ∈ IN

(all dark pools buy or sell at least one security at the announced price!), then ! E V 1{ V ≤Di } N−1 (C) ≡ min ρi > max ρi i∈IN i∈IN EV since ϕ0i (0) = ρi E V . In particular, it is always satisfied when ρi = ρ, i ∈ IN .

Gilles Pag` es

Optimal split of orders across liquidity pools

Interpretation of Condition (C) We consider the case where N = 2. We have then the two following derivatives 0 0 0 ϕ1 (r1 ) and ϕ2 (r2 ) = ϕ2 (1 − r1 ) Condition (C) satisfied

Condition (C) not satisfied

4.5

4

φ’1(r) φ’2(1−r)

4

3.5

3

3

2.5

2.5

2

2

1.5

1.5

1

1

0.5

0.5

0

0.2

0.4

0.6

0.8

φ’1(r) φ’2(1−r)

3.5

1

r

0

0

0.2

0.4

0.6

0.8

r

Gilles Pag` es

Optimal split of orders across liquidity pools

1

Design of the stochastic algorithm N , ∀1 ≤ i ≤ N. Then using Remark: a1 , . . . , aN are equal iff ai = a1 +···+a N 0 the representation of the derivatives ϕi yields that, if Assumption (C) is satisfied, then

r ∗ ∈ arg max Φ ⇔ PN

  ∀i ∈ {1, . . . , N} , E V ρi 1{r ∗ V 0), u ≥ 0, v > 0, admits a density fD (u, v ) such that and satisfying Ru  (i) FD (u | V = v , D > 0) = 0 fD (u 0 , v )du 0       (ii) for every v > 0, u → 7 fD (u, v ) is continuous and positive,      sup fD (u, V )V 2 ∈ L1 (P).  (iii) ∀ ε ∈ (0, 1), εV ≤u≤V /ε

Gilles Pag` es

Optimal split of orders across liquidity pools

(11)

Central Limit Theorem Theorem 2 Assume that Assumption (11) holds for every (V , Di ), i ∈ IN and that V ∈ L2+δ (P), δ > 0. Set γn = nc , n ≥ 1 with c > 2 0. ∂xj

As concerns the reinforcement algorithm, the mean function h is given by !! xi , (16) h : x 7−→ xi − ϕi P j xj 1≤i≤N

and under the standard differentiability assumption on the functions ϕi ’s,   ∂hi xi xi N 0 ∀x ∈ R , > 0. (x) = ϕi ∂xj x1 + · · · + xN (x1 + · · · + xN )2

Gilles Pag` es

Optimal split of orders across liquidity pools

Advantages and Drawbacks Drawbacks I

I

No hope to prove that all the equilibrium points lie in the interior of PN since one may always adopt an execution strategy which boycotts a given dark pool or, more generally N0 dark pools. Elementary combinatorial arguments show that there are at least 2N − 1 equilibrium points. As a competitive system, the algorithm has possibly a non converging behaviour even in presence of a single (attracting) equilibrium. This is to be compared to their cooperative counterparts (with negative non diagonal partial derivatives).

Advantages I

on the contrary of the optimization algorithm, the reinforcement algorithm naturally lives in the simplex PN .

Gilles Pag` es

Optimal split of orders across liquidity pools

Outline 1

Introduction A simple model for the execution of orders by dark pools

2

Optimal allocation under constraints Optimization Algorithm The (IID) setting: a.s. convergence and CLT The (ERG ) setting: convergence

3

A reinforcement algorithm Existence of an equilibrium A competitive system

4

Numerical Tests The IID setting The ERG setting The pseudo-real data setting

5

Provisional remarks Gilles Pag` es

Optimal split of orders across liquidity pools

Abundance and Shortage We compare the behaviour of both algorithms in different settings : the IID one, the ERG one and with pseudo-real data (whose construction is explained below). We examine specifically two situations : abundance and shortage. What we call ”abundance” is the fact that the mean of V is less that the sum of the means of the Di , i.e. EV ≤

N X

EDi

i=1

, and the ”shortage” is the situation where we have the contrary, i.e. EV >

N X

EDi .

i=1

The most interesting setting to compare them is the shortage since it is the situation the most common in the market. Gilles Pag` es

Optimal split of orders across liquidity pools

Comparison Criterions We present the performances of both algorithms and compare them to the strategy devised by an insider ”oracle” who would know the true values of V and Di . This “oracle” strategy is the best possible allocation. ∀n ≥ 1,

n

min V ,

N X

! Din

.

i=1

So we introduce in the following figures the allocation coefficients of the optimization algorithm and the reinforcement algorithm (just drawn in the IID setting as example because the best way to compare the two algorithms is to look at their performances),

Gilles Pag` es

Optimal split of orders across liquidity pools

Comparison Criterions the ratios between the executed quantity and the sent quantity for the three algorithms (we name it satisfaction), i.e. for every n ≥ 1, Pi0 −1 ◦

i=1

for the oracle, where Vn Pi0 Pi0 −1 Di < V ≤ i=1 Di . ρ1 < ρ2 < · · · < ρN , and i0 such that i=1 PN



  Pi0 −1 ρi Di ρi Di + ρi0 V − i=1

i=1

ρi min (rin V n , Din ) for both algorithms. Vn

the ratios between the satisfaction index of both optimization and reinforcement algorithms and that of the oracle, i.e. for every n ≥ 1 PN

min (rin V n , Din )  . Pi0 −1 Pi0 −1 ρ D + ρ V − ρ D i i i i i 0 i=1 i=1 i=1 ρi

Gilles Pag` es

Optimal split of orders across liquidity pools

With log-normal simulated data (Shortage)

Allocation Coefficients

Satisfactions

Satisfactions Ratios

0.61

1.02 Oracle Optimization Reinforcement

Optimization Reinforcement

0.6 0.55

One Optimization/Oracle Reinforcement/Oracle

0.605

1.01

0.6

1

0.4 0.35

ratio

% of satisfaction

Coefficients of allocation

0.5 0.45

0.595

0.99

0.3 0.59

0.98

0.585

0.97

0.25 0.2 0.15 0.1

0

10

20

30 40 50 60 70 Number of simulations x 102

80

90

100

Figure: Case N = 3, mV =

0.58

3 2

0

10

20

PN

i=1

30 40 50 60 70 Number of simulations x 102

80

90

100

0.96

0

10

20

30 40 50 60 70 Number of simulations x 102

80

90

100

mDi , mDi = i, σV = 1, σDi = 1, 1 ≤ i ≤ N.

Gilles Pag` es

Optimal split of orders across liquidity pools

Satisfaction evolution according to variance variation Satisfaction vs Variance 1 Reinforcement Optimization 0.9

Satisfaction

0.8

0.7

0.6

0.5

0.4

0

1

2

3

4

5

Variance

Figure: The satisfaction decreases as the variance increases between 0 and 2.5, then increases but less smoothy and is perturbated.

Gilles Pag` es

Optimal split of orders across liquidity pools

Exponential of OU The quantity V and Di , i ∈ IN , are exponentials of an Ornstein-Uhlenbeck process, i.e. X n+1 = m + AX n + BΞn+1 , where kAk < 1,  m1  .. m= .

BB ∗ ∈ Gl(d, R) and   N+1 , ∈R

Ξn+1

 Ξn+1 1   =  ...  ∼ N (0, IN+1 ) i.i.d., 

Ξn+1 N+1

mN+1

 Vn Dn   1 =  . .  ..  

eX

n

DNn

Gilles Pag` es

Optimal split of orders across liquidity pools

Numerical Data The initial value of the algorithms is ri0 = 

 0.95 ρ = 0.97 , 0.99

  1  ..  m = . , 1

1 N,

1 ≤ i ≤ N and we set



 0.7 0.01 0.01 0.01  0.01 0.3 0.01 0.01   A=  0.01 0.01 0.2 0.01  , 0.01 0.01 0.01 0.1



 0.02 0 0 0  0.01 0.9 0 0  . B=  0.01 0.01 0.6 0  0.01 0.01 0.01 0.3

Gilles Pag` es

Optimal split of orders across liquidity pools

Numerical Results (Shortage) Satisfactions

Satisfactions Ratio

0.47

1 Oracle Optimization Reinforcement

One Optimization/Oracle Reinforcement/Oracle 0.99

0.46

0.98

0.97 Ratios

% of satisfaction

0.45

0.44

0.96 0.43 0.95

0.42

0.41

0.94

0

20

40 60 Number of simulations x 102

80

Figure: Case N = 3, mV ≥

100

PN

i=1

Gilles Pag` es

0.93

0

20

40 60 Number of simulations x 102

80

100

mDi , σV ≥ 1, σDi ≥ 1, 1 ≤ i ≤ N.

Optimal split of orders across liquidity pools

Generation of pseudo-real data We consider an asset volume V which we want buy or sell, and the volumes which are offered by the N dark pools (Di )1≤i≤N . We have picked up data on the market for V and the Di are building from the N assets which are the most correlated with V , denoted by Si , i = 1, . . . , N, and V by the mixing function ∀1 ≤ i ≤ N, Di := βi

  EV (1 − αi )V + αi Si ESi

where αi , i = 1, . . . , N are the mixing coefficients, βi , i = 1, . . . , N some weights. So E(Di ) = βi E(V ).

Gilles Pag` es

Optimal split of orders across liquidity pools

Abundance and Shortage Cases PN

hP N

i

If i=1 βi < 1, then E i=1 Di < EV : this is a shortage situation and we use the algorithm to find the optimal allocation. The simulation presented here have been made with the asset BNP and the four most correlated assets with BNP, so N = 4. The data used extend on 11 days. To explain the changes in the response of the algorithms, we have underlined the days by drawing vertical lines to separate the days of execution. We place in the shortage situation : we set       0.94 0.1 0.4 0.96 0.2 0.6      ρ= 0.98 , β = 0.3 and α = 0.8 . 1 0.2 0.2

Gilles Pag` es

Optimal split of orders across liquidity pools

Shortage case with pseudo-real data Satisfactions

Satisfactions Ratios

0.8

1.3 Oracle Naif Optimization Reinforcement

One Optimization/Oracle Reinforcement/Oracle Naif/Oracle

1.2

0.7 1.1

1 Ratios

% of satisfaction

0.6

0.5

0.9

0.8 0.4

0.7

0.6 0.3

0

2

4

6

8 10 Number of data

Figure: Case N = 4,

12

14

0.5

16 4

x 10

PN

i=1

0

2

4

6

8 10 Number of data

12

14

16 4

x 10

βi < 1, 0 < αi ≤ 0.2 and ri0 = 1/N 1 ≤ i ≤ N

Gilles Pag` es

Optimal split of orders across liquidity pools

Outline 1

Introduction A simple model for the execution of orders by dark pools

2

Optimal allocation under constraints Optimization Algorithm The (IID) setting: a.s. convergence and CLT The (ERG ) setting: convergence

3

A reinforcement algorithm Existence of an equilibrium A competitive system

4

Numerical Tests The IID setting The ERG setting The pseudo-real data setting

5

Provisional remarks Gilles Pag` es

Optimal split of orders across liquidity pools

Toward more realistic mean execution functions One natural idea is to take into account that the rebate may depend on the quantity rV sent to be executed by the dark pool. The mean execution function of the dark pool can be modeled by ∀ r ∈ [0, 1],

ϕ(r ) = E(ρ(rV ) min(rV , D))

(17)

where the rebate function ρ is a non-negative, bounded, non-decreasing right differentiable function. For the sake of simplicity, we assume that (V , D) satisfies (4). The right derivative of ϕ reads   ϕ0r (r ) = E ρ0r (rV )V min (rV , D) + E ρ(rV )V 1{rV 0} ) > 0 as above.

Gilles Pag` es

Optimal split of orders across liquidity pools

The main gap is to specify the function ρ so that ϕ remains concave. But the choice for ρ turns out to strongly depend on the (unknown) distribution of the random variable D. Example: V , D ∼ E(λ) independent. The function g is defined by g (u) := E(u ∧ D) =

1 − e −uλ ,u≥0 λ

so that, the execution function ϕ(r ) = E(ρ(rV )g (rV )) will be concave as soon as the function ρ g is so. Typical choices are ρ = g θ with θ ∈ (0, λ] which may appear as not very realistic since the rebate function is a structural feature of the different dark pools.

Gilles Pag` es

Optimal split of orders across liquidity pools

A responsive dark pool The dark pool may take into account the volume rV to decide which quantity will really executed rather than simply the a priori deliverable quantity D. One reason for such a behaviour is that the dark pool may wish to preserve the possibility of future transactions with other clients. So we introduce a delivery function ψ : R2+ → R+ , non-decreasing and concave w.r.t. its first variable and satisfying 0 ≤ ψ(x, y ) ≤ y , so that the new mean execution function is as follows: ϕ(r ) = ρ E (min(rV , ψ(rV , D))) .

(19)

It is clear that the function ϕ is concave (as the minimum of two concave functions) and bounded. In this case, the first (right) derivative of ϕ reads  (20) ϕ0r (r ) = ρ E V 1{rV 0} ) > 0. Gilles Pag` es

Optimal split of orders across liquidity pools

Example We consider for modelling the quantity delivered by the dark pool i a function where we can define a minimal quantity required to begin to consum Di , namely ψi (rV , Di ) = Di 1{rV >si Di } where si is a parameter of the dark pool i assumed to be deterministic. Allocation Coefficients

Satisfactions

0.7

0.65 Optimization Reinforcement

Optimization Reinforcement

0.6

0.6

% of satisfaction

Coefficients of allocation

0.5

0.4

0.3

0.55

0.2 0.5 0.1

0

0

2

4

6

8 10 Number of data

12

14

0.45

16 4

x 10

Figure: Pseudo-real data with N = 4, t 1 ≤ i ≤ N, s = (0.3, 0.2, 0.2, 0.3) .

PN

Gilles Pag` es

i=1

0

2

4

6

8 10 Number of data

12

14

16 4

x 10

βi < 1, 0 < αi ≤ 0.2 and ri0 = 1/N,

Optimal split of orders across liquidity pools

Optimization vs reinforcement ? For practical implementation what conclusions can be drawn form our investigations on both procedures. Both reach quickly a stabilization/convergence phase close to optimality. The reinforcement algorithm leaves the simplex structurally stable which means the proposed dispatching at each time step is realistic whereas the stochastic Lagrangian algorithm may sometimes need to be corrected. However, in a high volatility context, the stochastic Lagrangian algorithm clearly prevails with performances that may be significantly better performance. This optimization procedure also relies on established convergence results in a rather general framework (stationary α-mixing input data). Given the computational cost of these procedures which is close to zero, a good strategy is probably to implement both in parallel. Gilles Pag` es

Optimal split of orders across liquidity pools

Variants of the implementation

Resetting the step Constant step vs decreasing step Convergence vs pursuit

Gilles Pag` es

Optimal split of orders across liquidity pools

References Almgren, R. F. and Chriss N. (2000). Optimal execution of portfolio transactions, Journal of Risk, 3(2):5-39. Almgren R. and Harts B. (2008). A dynamic algorithm for smart order routing, Technical report, StreamBase. ´tivier M., Priouret P. (1987). Adaptive Benveniste M., Me Algorithms and Stochastic Approximations, Springer Verlag, Berlin, 365p. Berenstein R. (2008). Algorithmes stochastiques, microstructure et ex´ecution d’ordres, Master 2 internship report (Quantitative Research, ´ Dir. C. Lehalle, CA Cheuvreux), Probabilit´es & Finance, UPMC-Ecole Polytechnique, 2008. Doukhan P. (1991). Mixing: Properties and Examples, Lecture Notes Statist. 85, Springer, New York, 142p. Duflo M. (1997). Random Iterative Models. Series: Stochastic Modelling and Applied Probability, Vol. 34. XVI, 385 p., Springer, Gilles Pag` es

Optimal split of orders across liquidity pools

Foucault, T. and Menkveld, A. J. (2006). Competition for order flow and smart order routing systems, Journal of Finance, 63(1):119-158. Hirsch M., Smith H. (2004). Monotone Dynamical systems, monography, 136p. Kushner H.J., Yin G.G. (1997). Stochastic approximation and recursive algorithms and applications, New York, Springer, 496p; and 2nd edition, 2003. `s G. (2009). Stochastic Approximation with Laruelle S., Page Ergodic Innovation Revisited, pr´e-pub LPMA. Lehalle C.-A. (2009). Rigorous strategic trading: Balanced portfolio and mean-reversion, The Journal of Trading, 4(3):40-46. `s G. (2001). Sur quelques algorithmes r´ecursifs pour les Page probabilit´es num´eriques, ESAIM P&S, 5:141-170. Gilles Pag` es

Optimal split of orders across liquidity pools