610 likes | 704 Views
Online and Offline Selling in Limit Order Markets. Aaron Johnson Yale University Kevin Chang Yahoo! Inc. Workshop on Internet and Network Economics December, 17 th 2008. Limit Order Markets. Match buyers with sellers Electronic Communication Networks (ECNs) NASDAQ Instinet
E N D
Online and Offline Selling in Limit Order Markets Aaron JohnsonYale University Kevin ChangYahoo! Inc. Workshop on Internet and Network Economics December, 17th 2008
Limit Order Markets • Match buyers with sellers • Electronic Communication Networks (ECNs) • NASDAQ • Instinet • NYSE-Euronext • Prediction Markets • Intrade • Iowa Electronic Markets • Market makers • Market orders, fill or kill, cancellation
Results • Reservation price algorithm for online selling has competitive ratio e log(R), R = pmax/pmin.(improves O(logRlogN) of [KKMO04]) • Optimal selling offline is NP-Hard. • PTAS for offline selling when number of prices is constant. • Extend PTAS to offline buying
Related Work • [EKKM06] Even-Dar, Kakade, Kearns, and Mansour. (In)Stability properties of limit order dynamics. ACM EC 2006. • [KKMO04] Kakade, Kearns, Mansour, and Ortiz. Competitive algorithms for VWAP and limit order trading. ACM EC 2004. • [LPS07] Lorenz, Panagiotou, and Steger. Optimal algorithms for k-search with applications in option pricing. ESA 2007.
Limit Order Markets • Trading one commodity
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) BUY 1 $3
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book SELL 10 $10 SELL 3 $7 SELL 1 $5 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 SELL 1 $5 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 SELL 1 $5 BUY 2 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 BUY 2 $6 SELL 1 $5 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 BUY 1 $6 SELL 0 $5 1 $5 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 BUY 1 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 BUY 1 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 BUY 1 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Problems General Problem • Sequence of orders • Volume to trade • Insert orders to maximize value at given volume Options Online / Offline / Probabilistic Buy / Sell / Both Exact volume / Volume constraint
Limit Order Problems General Problem • Sequence of orders • Volume to trade • Insert orders to maximize value at given volume Options Online / Offline / Probabilistic Buy / Sell/ Both Exact volume / Volume constraint
Limit Order Problems Offline Selling • Sequence of orders: (σ1,…, σn) : σi = <B/S,vi,pi> • Volume to sell : N • Insert sell orders to maximize revenue. • Output (σ1,τ1,σ2,τ2,…, σn,τn), τi = <S,vτi,p τi>. • Σivτi≤N • Maximize revenue earned from τi sales.
Limit Order Problems Offline Selling Results • Problem is NP-Hard, even when there are only three prices in sequence. • Problem with two prices is linear-time solvable. • Exists a Polynomial-Time Approximation Scheme when number of prices is constant.
Limit Order Problems Offline Selling Results • Problem is NP-Hard, even when there are only three prices in sequence. • Problem with two prices is linear-time solvable. • Exists a Polynomial-Time Approximation Scheme when number of prices is constant.
Offline Selling Proving Hardness • Give a canonical form for optimal solutions to case when input sequence has only three prices. • Form leads to algorithm for two-price case. • Reduce Knapsack to three-price instance. • Easy to see that solutions to Knapsack instance give solutions to three-price instance. • Canonical form guarantees that a solution to three-price selling gives a solution to Knapsack.
Optimal Offline Selling Lemma 1: We can assume that all sales at the highest price i) are made by the algorithm and ii) have sell orders that are placed at the beginning. Lemma 2: We can assume that all sell orders at the lowest price that are inserted by the algorithm are placed immediately after the last sale made by the algorithm at a higher price.
Two-Price Offline Algorithm • With only two prices for orders (high and low), use this algorithm: At the beginning, place a sell order for volume N at the high price. If volume sold is N, return this. Else, After each high-price sale, calculate value of inserting sell order for remaining volume at low price. Return the maximum sequence.
Three-Price Offline Selling • Three prices for orders (high: ph, medium: pm, and low: pl). Lemma 3: We can assume that the algorithm inserts any medium-price orders i) immediately after high-price sales and ii) such that they are tight, i.e., increasing the volume would reduce the volume of high-price sales. Theorem 1: Three-price offline selling is NP-Hard.
Reducing Knapsack to 3-Price Selling Knapsack • n items (wi, vi) • Capacity C • Value V • Find subset S [n] such that iSwi ≤ C and iS vi ≥ V
Reducing Knapsack to 3-Price Selling • <B, pm, ai+wi> • <S, pl, wi> • <B, pl, wi> • <S, pm, ai> • <B, ph, ai+bi>. Let σibe the sequence Let α = (σ1,σ2,…,σn).
Reducing Knapsack to 3-Price Selling Canonical Optimum • <B, pm, ai+wi> • <S, pl, wi> • <B, pl, wi> • <S, pm, ai> • <B, ph, ai+bi>. Let σibe the sequence Let α = (σ1,σ2,…,σn). High price Alg. OrderVol. Med. price Step Alg. Sale Vol.
Reducing Knapsack to 3-Price Selling Canonical Optimum • <B, pm, ai+wi> • <S, pl, wi> • <B, pl, wi> • <S, pm, ai> • <B, ph, ai+bi>. Let σibe the sequence • At start place high sell. Let α = (σ1,σ2,…,σn). High price Alg. OrderVol. Med. price Step Alg. Sale Vol.
Reducing Knapsack to 3-Price Selling Canonical Optimum • <B, pm, ai+wi> • <S, pl, wi> • <B, pl, wi> • <S, pm, ai> • <B, ph, ai+bi>. Let σibe the sequence • At start place high sell. • After high sales, medium sell volumes 0 and ai+wi are tight. More is not optimal. Let α = (σ1,σ2,…,σn). High price Alg. OrderVol. Med. price Step Alg. Sale Vol.
Reducing Knapsack to 3-Price Selling Let ω be the sequence Canonical Optimum • <S, pl, iwi-C> • <B,pm, pm(iwi)>. • With initial high sale, books at start of ωjust have low buys. This is maintained. Let σ = (α, ω). Let i(l) be revenue after σiwith l fewer initial low buys. n n(l)= pm2(iwi)+pl(C-l) : l≤C pm2(iwi)-pm(l-C) : l≥C C l
Reducing Knapsack to 3-Price Selling High price Alg. OrderVol. Med. price σi Step Alg. Sale Vol. i C
Reducing Knapsack to 3-Price Selling High price Alg. OrderVol. Med. price σi Step Alg. Sale Vol. i-1 • Inserting a medium sell decreases later low buys by wiand increases revenue by (k) vi. • iS if medium after σi . i (k)vi wi C
Reducing Knapsack to 3-Price Selling • At beginning of σ0,l=0. • Can set pm, pl to ensure that should not shift by more than C. • Can set ai, bi to ensure that medium insertion of ai+wi provides (k) vi revenue but more is not profitable. • Knapsack solution leads to stated 3-price solution. • Canonical form guarantees optimal solution in form that can be converted to a Knapsack solution.
Conclusions • Prove optimal competitive ratio for reservation price algorithm for online selling of e log(R), R = pmax/pmin. • Optimal selling offline is NP-Hard. • PTAS for offline selling when number of prices is constant. • Limit order markets are a basic market mechanism with many open problems. Online / Offline / Probabilistic Buy / Sell/ Both Exact volume / Volume constraint
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 SELL 1 $7 BUY 1 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 3 $7 SELL 1 $7 BUY 1 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Limit Order Markets • Trading one commodity • Order • BUY/SELL • Volume • Price • Lowest (SELL) • Highest (BUY) • Buy book / Sell book • Matching algorithm • Match new orderwith existing orders. • Remaining volumegoes on a book. SELL 10 $10 SELL 1 $7 SELL 3 $7 BUY 1 $6 BUY 1 $3 BUY 2 $2 BUY 5 $1
Offline Selling Main Observations • Inserting sell orders affects the possible revenue gained later in the sequence. In fact, it can only lower it. • Inserting a sell order of volume V can cause at most volume V change in the books later in the sequence. Thus, the sales change by at most volume V.
Selling in Limit Order Markets Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> <B, 1, $4> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> <B, 1, $4> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> <B, 1, $4> SALE: $3 Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> <B, 1, $4> SALE: $3 <S, 2, $5> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> <B, 1, $4> SALE: $3 <S, 2, $5> <B, 1, $5> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets <B, 2, $1> <S, 1, $3> <B, 1, $4> SALE: $3 <S, 2, $5> <B, 1, $5> SALE: $5 Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets Volume <B, 2, $1> <S, 1, $3> <B, 1, $4> <S, 2, $5> <B, 1, $5> 1 -1 1 2 3 4 5 Price <S, 2, $1> <B, 2, $1> <S, 1, $3> <S, 1, $3> <B, 1, $4> <S, 1, $5> <S, 2, $5> <B, 1, $5> Volume 1 -1 1 2 3 4 5 Price
Selling in Limit Order Markets Volume <B, 2, $1> <S, 1, $3> <B, 1, $4> <S, 2, $5> <B, 1, $5> 1 -1 1 2 3 4 5 Price <S, 2, $1> <B, 2, $1> <S, 1, $3> <S, 1, $3> <B, 1, $4> <S, 1, $5> <S, 2, $5> <B, 1, $5> Volume 1 -1 1 2 3 4 5 Price