Slide 1

Slide 1 text

Cryptocurrency algo-trading testing in Scala by Bruno Bonanno

Slide 2

Slide 2 text

A set of green tests doesn’t necessarily means that the software does what is supposed to.

Slide 3

Slide 3 text

Hello! I’m Bruno Bonanno Passionate developer, open source contributor, TDD evangelist and creator of mockito-scala.

Slide 4

Slide 4 text

Agenda Market book Introduction to an order book & OMS Our demouse case Challenges Live coding Q&A

Slide 5

Slide 5 text

Market book BIDS ASKS

Slide 6

Slide 6 text

Introduction to an OMS Order Management System Exchange 1 WS API Exchange n REST API Exchange 1 REST API Exchange n FIX API . . . . . . Orders Orders Market Reports Market Data

Slide 7

Slide 7 text

OMS-123: Making money with arbitrage ASK: 1 BTC = 7900 USD Get 1.27 BTC ASK: 1 ETH = 0.03 BTC Get 42.33 ETH BID: 1 ETH = 250 USD Get 10582.5 USD Start with 10000 USD

Slide 8

Slide 8 text

Challenges ● Integration: Different APIs ● Exchange reference data: min quantity, price rounding… ● Trading logic: Do not buy 100000 BTC, Fills / Partial fills / Rejection… ● External problems: Network failures, Market shutting down...

Slide 9

Slide 9 text

Glossary ● Ask: Price at which we buy ● Bid: Price at which we sell ● Order: What we want to execute in the market (bid/ask, quantity, currency pair, etc) ● Market Report: What the market actually executed out of our Order (execution confirmation, rejection, etc)

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Q&A

Slide 12

Slide 12 text

https://github.com/bbonanno/crypto-algo-trading-demo-test Thank you!