CloudEx:)A)Financial)Application)in)the)Cloud Balaji)Prabhakar CS)349F)Lec 6@II
Accurate(Timing(is(Foundational(for(the(Financial(Industry Exchanges)and) Trading)Platforms • Ensure(“fairness”:(in;order(execution(of(transactions ( Conventional*exchanges :(Nasdaq,(NYSE,( • Enable(execution(of(“time;synced(smart(contracts” SGX,(LSE,(TSE,(HKSE,(Euronext,(Chicago(ME • Make(hybrid(and(cloud;only(models(possible Digital*currency*exchanges :((Coinbase,( Binance,((GDAX) Investment)Banks) • Sync(with(exchanges(as(reference(for(market(data(timestamps and)Hedge)Funds • Run(realistic(simulations(for(better(trading(algorithms (e.g.,(BofA,(Citi,(Goldman(Sachs,(JPMC,( • Regulatory(compliance:(MIFiD II(in(the(EU(and(CAT(in(the(US Morgan(Stanley,(UBS,(Wells(Fargo) • Accurately(timestamp(transactions(across(disparate( Payments)and) geographies(for(transaction(tracking/debugging Retail)Banking (e.g.,(Visa,(Mastercard,(Paypal,(eBay, • Recreate(network(dynamics(for(100s(of(apps Wells(Fargo,(HSBC,(Sumitomo,(Barclays)(
Financial'Trading'Systems Fundamental'Operation'Performed'by'Exchange: Price'Discovery! S B E U Stock/Currency/Futures'Exchange L Y L E E R R S S Runs'on'top'of' Fundamental'Requirement'of' Exchange'Infrastructure Exchange'Infra: Provide'“Fair'Access”
Fairness(#1:((In-order(Execution(of(Transactions Market+ Market+ Participants Participants Gateways Gateways In(on-prem exchanges, links(from(Gateways(to(Matching( Engine(carefully(engineered(to( ensure(equal(transit(times This(is(not(possible(in(the(Cloud;( hence(more(challenging Matching+ Engine
Solution:)Create)“Time)Perimeter”)Using)Accurate)Clock)Sync Create)a)”Time)Perimeter”) by)synchronizing)the) Gateway)clocks)with)the) Matching)Engine Reordering) Buffer Resequence transactions)in)a) “reordering)buffer”) before)execution) Timestamp)transactions) at)Gateways)to)establish) precise)order)of)arrival
Fairness(#2:((Delivering(Market(Data(Simultaneously Market'data'is'currently' delivered'simultaneously'to' participants'by'multicasting Multicasting'is'not'easy'in' the'Cloud Market' Data
Solution:))Time)Perimeters)+)Hold3and3Release)Buffers) Timestamp'order'books'at' Create)Time)Perimeters) the'Matching'Engine'and' at)the)Gateways)… … …'release'them' simultaneously at' (geographically)' …)or)adjacent)to)the)) different'locations Market)Participants) (Gateways'or'MP'nodes) Market' Data
Motivation for CloudEx • Carefully2engineered networks are expensive to scale and maintain – Cloud2based solutions are elastic and typically easier to maintain • Research tool – Fully configurable end2to2end exchange • Teaching tool – Prototype system for learning about (i) infrastructure,C(ii) trading algorithms,C andC(iii)CmatchingCalgorithms
System(Design of CloudEx BigTable Storage Order / Trade Confirmations Portfolio(Matrix !"#$ %%&' ())( … Market(Data Matching Limit(Order(Books C0 $552 2 4 … Disseminator Engine C1 $100 6 1 … … … … … … Time(Perimeter Time(Perimeter Sequencer Gateway Gateway Gateway H/R H/R H/R G0 G1 G2 Trader Trader Trader C0 C1 C2
System(Design of CloudEx BigTable Storage Order / Trade Confirmations Portfolio(Matrix !"#$ %%&' ())( … Market(Data Matching Limit(Order(Books C0 $552 2 4 … Disseminator Engine C1 $100 6 1 … … … … … … Sequencer Gateway H/R G1 API :(submit_order( order ) API :(fetch_historical_data( time_range ) Trader API:( C1 fetch_limit_order_book( symbol ) fetch_trade_reports( symbol )
Order%Messages Appended%by%Gateway Format Bid/Ask Client Order% Symbol Action Shares Type Timestamp Price ID ID Examples AAPL Buy 100 Limit $210 1569290045000 C1 SAD651GH GOOG Buy 50 Market $1200 1569290048121 A2 3AS5SDF2 MSFT Sell 325 Limit $140 1569290053007 B2 A22S134H
Recommend
More recommend