The latest Kafka features introduced in Kafka 0.11 and 1.0 make (at least!) possible to start trading using Kafka. Let's see how..
Video: https://www.youtube.com/watch?v=30WGjmJ8hvA
1 of 30
More Related Content
Big data spain 2017 - I?igo Gonzalez: Trading at market speed with the latest kafka features
2. ? Didn’t like databases, stats
? Very critical about so-called ‘big-data’
stacks. Tell me why later.
? Sysadmin for more than 20 years.
? Data & ML Product @One2One
? Data Science Awards 2016: Best data
Engineer.??igo González
@exocert
$> whoami
3. Disclaimer
?VERY HIGH RISK
? Don’t risk money you cannot
afford to loose.
? You’ll be trading high volatility
markets. Easily manipulated, too.
? Software bugs might make you
loose money.
6/6Inversión de muy alto riesgo.
Ud. Puede perder hasta la camisa por un
error en su código o por situaciones que
están fuera de su control.
Tenga miedito. Es más seguro.
This talk reflect my views and opinion, not my employer’s.
4. Automated trading (late 80’s)
The ability of trading in a market without continuous human
intervention.
You need:
Something that watches the market
Something able to execute orders based on your instructions.
5. High Frecuency trading
Automated trading
At milisecond speed
Able to trade multiple exchanges at once
*VERY* expensive to do:
Software licenses for CEPs started at $10,000
for cpu core.
Now it’s different
6. HOW to make money
trading cryptocurrencies?
(if you don’t have too many bugs)
10. The
orderbook is a
queue
Think about a queue in a staircase.
Every step is a bid/ask Price
On every step you can have one or more orders in
a queue.
ORDERS are executed on a FIRST-COME-FIRST-
SERVE basis.
11. Orderbook
and Liquidity
There is a STRONG incentive to be early in the
orderbook…
… because you’re the first in the line to execute
your orders.
BTW: Some markets have 0% trading fee for
market MAKERS.
12. Strategy
?Be early in the orderbook: send
orders ASAP.
?Be a Market maker (low/0% fees)
28. Finally see if the orderbook spot is occupied
? Make a Price_Candidates topics
? Put there the prices you might want to trade.
? I mean, the prices your _automated_ strategy believes it’s ok to trade.
? Join that with the data values you have in the orderbook.
? Those are the prices you DO NOT want to trade
? Why? because someone else has an order there.
create table xUSDBTC (price varchar, amount double, count double) with
(KEY='price', kafka_topic=‘ob_USDBTC', value_format='json’);
Create stream do_not_trade_here as
select x.Price from xUSDBTC x
left join Price_candidates pc on x.Price = pc.Price ;
29. The big picture:
What we need in
the real world?
Get
market
data
Store
market
data
Replay
market
data
Test
strategy
Watch
fror entry
signals
Watch for
exit
signals
Execute
trades
Manage
Risk
Predict
orderbok
changes