SlideShare a Scribd company logo
Distributed Crypto-Currency
Trading with Apache Pulsar
David Kjerrumgaard
Director of Solution Architecture
‱ Company wishes to automate a crypto-currency arbitrage discovery platform in order
to exploit the spreads between crypto-currency prices offered by brokers across
multiple crypto-currency exchanges across the globe.
‱ Currently, the company has multiple geographically distributed trading desks (North
America, Europe, and Asia). Due to ïŹnancial regulations, each trading desk has
accounts within its geographical region only and cannot execute trades outside of its
region.
‱ To overcome this restriction, the solution must provide the capability to perform a trade
in one region on behalf of a user in another region.
‱ In order to minimize risk, the company does not want to retain any open (long or short)
positions. Therefore all arbitrage trades must result in a net zero position, i.e. every
trade must be cleared.
The Business Use Case
‱ In order to accommodate this, the platform will need to support:
‱ Geo-replication of trade & quote information ingested from 50+ exchanges.
‱ The ability to send large, crypto-currency payloads between trading desks in order
to successfully complete the purchase of a security in one region and the selling
of the same security in another.
‱ Since we are sending actual crypto-currency payloads security and zero-message
loss is a MUST.
‱ Given the volatility of the crypto-currency prices, sub-second message latency is
critical to identify and exploit any market inefïŹciencies. All opportunities must be
identiïŹed, acted upon, and trades completed before the price moves. Failure to do
so could result in trading losses.
Business Use Case Requirements
‱ Intelligent platform for fast-moving data
‱ Built with open source technology
proven at scale at Twitter, Yahoo,
Salesforce

‱ Founded by a team of data processing
veterans from Twitter, Yahoo, Google,


What is Streamlio
Interfaces
APIs Libraries & Connectivity
Intelligent platform for fast data
Real-time processing
Messaging & queuing
Stream storage
ConnectorsClientData SourceStormKafka Functional
Management
Resource Management
Metadata
Security
Monitoring
Management UI
Powered by
Powered by
Powered by
Apache Pulsar
fast, durable, flexible pub/sub messaging
What is Apache Pulsar?
7
Ordering
Guaranteed ordering
Multi-tenancy
A single cluster can
support many tenants
and use cases
High throughput
Can reach 1.8 M
messages/s in a single
partition
Durability
Data replicated and
synced to disk
Geo-replication
Out of box support for
geographically
distributed applications
Deployed globally in
10+ data centers with
full replication and has
processed more than
100 trillion messages
to date.
Delivery Guarantees
At least once, at most once
and effectively once
Low Latency
Low publish latency of 5ms
at 99 pct
Highly scalable
Can support millions of
topics
‱ Each of the three trading desks ingests real-time trade and quote
information from all of the exchanges within their respective regions and
publish them into a shared, geo-replicated Pulsar topic.
‱ Trade & Quote information published in one region is available in another
‱ Apache Pulsar provides built-in WebSocket clients for all of its topics,
which are used to drive the trading dashboards used by the traders.
‱ When an arbitrage opportunity is identiïŹed, it will be published to the
arbitrage topic for further evaluation.
The Solution Architecture
Single Region Perspective
Global Perspective
https://streamer.cryptocompare.com/
Regional Data Ingestion
‱ Subscribes to the Cryptocompare API.
‱ You can subscribe to multiple feeds in a single
request, but API throttles requests to 1000 /
minute.
‱ Subscription requests have the following
format:
‱ {FeedType}~{ExchangeName}~{FromCurrencySymbol}~{ToCurrencySymbol}
‱ Publishes the received events to a WebSocket
on port 4019, which NiFi subscribes to.
Crypto Currency Data Feed
The Demo
‱ Amount of effort to produce the demo was approximately 2 weeks, with the bulk of the time spent
on the Apache NiFi processors. Source code for the Apache NiFi Processors (will be contributed
back to the Apache project) can be found here:
‱ https://github.com/openconnectors/niïŹ-pulsar-bundle
‱ https://github.com/openconnectors/niïŹ-pulsar-client-services
‱ Infrastructure is Google Cloud Compute, managed by Kubernetes. Helm Charts can be found here:
‱ https://storage.googleapis.com/streamlio/charts
‱ Docker images are currently available in DockerHub here:
‱ https://hub.docker.com/r/streamlio/niïŹ/
‱ https://hub.docker.com/r/streamlio/crypto-currency/
‱ Phase 2 of the demo will add automated trading using Machine Learning automated by Apache
Heron.
Final Comments
Question & Answers
Curious to Learn More?
‱ Apache Pulsar : http://pulsar.incubator.apache.org

‱ Apache DistributedLog : http://bookkeeper.apache.org/distributedlog

‱ Apache BookKeeper : http://bookkeeper.apache.org 

‱ Follow Us @apache_pulsar @asfbookkeeper @distributedlog
16
Curious to learn more about Streamlio?
‱ Streamlio: https://streaml.io
‱ Sandbox Preview: https://streaml.io/docs/getting-started
‱ Learn slack channel: https://learn-streamlio.slack.com
17
Appendix
NiFi Flow
NiFi Flow Cont.

More Related Content

PDF
PortoTechHub - Hail Hydrate! From Stream to Lake with Apache Pulsar and Friends
PDF
Pulsar summit asia 2021: Designing Pulsar for Isolation
PDF
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
PDF
Scenic City Summit (2021): Real-Time Streaming in any and all clouds, hybrid...
PDF
[March sn meetup] apache pulsar + apache nifi for cloud data lake
PDF
Real time cloud native open source streaming of any data to apache solr
PDF
StreamNative FLiP into scylladb - scylla summit 2022
PDF
Big data conference europe real-time streaming in any and all clouds, hybri...
PortoTechHub - Hail Hydrate! From Stream to Lake with Apache Pulsar and Friends
Pulsar summit asia 2021: Designing Pulsar for Isolation
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Scenic City Summit (2021): Real-Time Streaming in any and all clouds, hybrid...
[March sn meetup] apache pulsar + apache nifi for cloud data lake
Real time cloud native open source streaming of any data to apache solr
StreamNative FLiP into scylladb - scylla summit 2022
Big data conference europe real-time streaming in any and all clouds, hybri...

What's hot (20)

PDF
DBCC 2021 - FLiP Stack for Cloud Data Lakes
PDF
Architecting for Scale
PDF
Apache Deep Learning 201 - Philly Open Source
PDF
Automation + dev ops summit hail hydrate! from stream to lake
PDF
Osacon 2021 hello hydrate! from stream to clickhouse with apache pulsar and...
PDF
Music city data Hail Hydrate! from stream to lake
PDF
Using FLiP with influxdb for EdgeAI IoT at Scale
PDF
Cloud lunch and learn real-time streaming in azure
PDF
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
PDF
Data science online camp using the flipn stack for edge ai (flink, nifi, pu...
PDF
Codeless pipelines with pulsar and flink
PDF
Python web conference 2022 apache pulsar development 101 with python (f li-...
PDF
Axway amplify api management platform
PDF
Open Source Bristol 30 March 2022
PDF
Ai dev world utilizing apache pulsar, apache ni fi and minifi for edgeai io...
PDF
Hail hydrate! from stream to lake using open source
PDF
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
PPTX
Matt Franklin - Apache Software (Geekfest)
PDF
Select Star: Flink SQL for Pulsar Folks - Pulsar Summit NA 2021
PDF
fluentd -- the missing log collector
DBCC 2021 - FLiP Stack for Cloud Data Lakes
Architecting for Scale
Apache Deep Learning 201 - Philly Open Source
Automation + dev ops summit hail hydrate! from stream to lake
Osacon 2021 hello hydrate! from stream to clickhouse with apache pulsar and...
Music city data Hail Hydrate! from stream to lake
Using FLiP with influxdb for EdgeAI IoT at Scale
Cloud lunch and learn real-time streaming in azure
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Data science online camp using the flipn stack for edge ai (flink, nifi, pu...
Codeless pipelines with pulsar and flink
Python web conference 2022 apache pulsar development 101 with python (f li-...
Axway amplify api management platform
Open Source Bristol 30 March 2022
Ai dev world utilizing apache pulsar, apache ni fi and minifi for edgeai io...
Hail hydrate! from stream to lake using open source
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Matt Franklin - Apache Software (Geekfest)
Select Star: Flink SQL for Pulsar Folks - Pulsar Summit NA 2021
fluentd -- the missing log collector
Ad

Similar to Distributed Crypto-Currency Trading with Apache Pulsar (20)

PDF
Best Practices for Scaling an InfluxEnterprise Cluster
PPTX
Detailed OpenSea Clone Script for startup business ideas
PPTX
Algorithmic Trading
PDF
Running microservices successfully | Bastian Hofmann | CODEiD
PPT
Exactpro Systems High Level Overview January 2014
PDF
ow Long Does It Take to Build a Crypto Arbitrage Bot The Ultimate Technical B...
PDF
ow Long Does It Take to Build a Crypto Arbitrage Bot The Ultimate Technical B...
PPT
presentation slides
PDF
Centralized Exchange Development: The Essential Software for Effortless Digit...
PDF
Algorand Technical Workshop 2021
PDF
Combating Mobile Device Theft with Blockchain
PDF
Jupiter Clone Script - Launch a Scalable DEX Aggregator Like Jupiter Without...
DOCX
How to Create Your NFT Marketplace with an OpenSea Clone Script.docx
PPTX
How to Build Crypto Derivative Exchanges from Scratch.pptx
PDF
Launch a Next-Gen Crypto Margin Trading Exchange with Debut Infotech
PPTX
Event Detection Pipelines with Apache Kafka
PDF
Top 10 Crypto Exchange Clone Scripts to Build Your Platform in 2025
PDF
1 inch Exchange clone script development
PDF
Best Practices for Streaming Connected Car Data with MQTT & Kafka
PDF
Uniswap Clone Script - Instantly launch your DeFi Exchange like Uniswap
Best Practices for Scaling an InfluxEnterprise Cluster
Detailed OpenSea Clone Script for startup business ideas
Algorithmic Trading
Running microservices successfully | Bastian Hofmann | CODEiD
Exactpro Systems High Level Overview January 2014
ow Long Does It Take to Build a Crypto Arbitrage Bot The Ultimate Technical B...
ow Long Does It Take to Build a Crypto Arbitrage Bot The Ultimate Technical B...
presentation slides
Centralized Exchange Development: The Essential Software for Effortless Digit...
Algorand Technical Workshop 2021
Combating Mobile Device Theft with Blockchain
Jupiter Clone Script - Launch a Scalable DEX Aggregator Like Jupiter Without...
How to Create Your NFT Marketplace with an OpenSea Clone Script.docx
How to Build Crypto Derivative Exchanges from Scratch.pptx
Launch a Next-Gen Crypto Margin Trading Exchange with Debut Infotech
Event Detection Pipelines with Apache Kafka
Top 10 Crypto Exchange Clone Scripts to Build Your Platform in 2025
1 inch Exchange clone script development
Best Practices for Streaming Connected Car Data with MQTT & Kafka
Uniswap Clone Script - Instantly launch your DeFi Exchange like Uniswap
Ad

More from Streamlio (13)

PDF
Infinite Topic Backlogs with Apache Pulsar
PDF
Apache Pulsar Overview
PDF
Streamlio and IoT analytics with Apache Pulsar
PDF
Strata London 2018: Multi-everything with Apache Pulsar
PDF
Self Regulating Streaming - Data Platforms Conference 2018
PDF
Introduction to Apache BookKeeper Distributed Storage
PDF
Event Data Processing with Streamlio
PDF
Stream-Native Processing with Pulsar Functions
PDF
Building data-driven microservices
PDF
Evaluating Streaming Data Solutions
PDF
Autopiloting Realtime Processing in Heron
PDF
Introduction to Apache Heron
PDF
Messaging, storage, or both? The real time story of Pulsar and Apache Distri...
Infinite Topic Backlogs with Apache Pulsar
Apache Pulsar Overview
Streamlio and IoT analytics with Apache Pulsar
Strata London 2018: Multi-everything with Apache Pulsar
Self Regulating Streaming - Data Platforms Conference 2018
Introduction to Apache BookKeeper Distributed Storage
Event Data Processing with Streamlio
Stream-Native Processing with Pulsar Functions
Building data-driven microservices
Evaluating Streaming Data Solutions
Autopiloting Realtime Processing in Heron
Introduction to Apache Heron
Messaging, storage, or both? The real time story of Pulsar and Apache Distri...

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
AI in Product Development-omnex systems
PPTX
ai tools demonstartion for schools and inter college
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Transform Your Business with a Software ERP System
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
Internet Downloader Manager (IDM) Crack 6.42 Build 41
AI in Product Development-omnex systems
ai tools demonstartion for schools and inter college
Softaken Excel to vCard Converter Software.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms I-SECS-1021-03
How Creative Agencies Leverage Project Management Software.pdf
Online Work Permit System for Fast Permit Processing
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms II-SECS-1021-03
ManageIQ - Sprint 268 Review - Slide Deck
Navsoft: AI-Powered Business Solutions & Custom Software Development
Transform Your Business with a Software ERP System
2025 Textile ERP Trends: SAP, Odoo & Oracle
Understanding Forklifts - TECH EHS Solution
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025

Distributed Crypto-Currency Trading with Apache Pulsar

  • 1. Distributed Crypto-Currency Trading with Apache Pulsar David Kjerrumgaard Director of Solution Architecture
  • 2. ‱ Company wishes to automate a crypto-currency arbitrage discovery platform in order to exploit the spreads between crypto-currency prices offered by brokers across multiple crypto-currency exchanges across the globe. ‱ Currently, the company has multiple geographically distributed trading desks (North America, Europe, and Asia). Due to ïŹnancial regulations, each trading desk has accounts within its geographical region only and cannot execute trades outside of its region. ‱ To overcome this restriction, the solution must provide the capability to perform a trade in one region on behalf of a user in another region. ‱ In order to minimize risk, the company does not want to retain any open (long or short) positions. Therefore all arbitrage trades must result in a net zero position, i.e. every trade must be cleared. The Business Use Case
  • 3. ‱ In order to accommodate this, the platform will need to support: ‱ Geo-replication of trade & quote information ingested from 50+ exchanges. ‱ The ability to send large, crypto-currency payloads between trading desks in order to successfully complete the purchase of a security in one region and the selling of the same security in another. ‱ Since we are sending actual crypto-currency payloads security and zero-message loss is a MUST. ‱ Given the volatility of the crypto-currency prices, sub-second message latency is critical to identify and exploit any market inefïŹciencies. All opportunities must be identiïŹed, acted upon, and trades completed before the price moves. Failure to do so could result in trading losses. Business Use Case Requirements
  • 4. ‱ Intelligent platform for fast-moving data ‱ Built with open source technology proven at scale at Twitter, Yahoo, Salesforce
 ‱ Founded by a team of data processing veterans from Twitter, Yahoo, Google, 
 What is Streamlio
  • 5. Interfaces APIs Libraries & Connectivity Intelligent platform for fast data Real-time processing Messaging & queuing Stream storage ConnectorsClientData SourceStormKafka Functional Management Resource Management Metadata Security Monitoring Management UI Powered by Powered by Powered by
  • 6. Apache Pulsar fast, durable, flexible pub/sub messaging
  • 7. What is Apache Pulsar? 7 Ordering Guaranteed ordering Multi-tenancy A single cluster can support many tenants and use cases High throughput Can reach 1.8 M messages/s in a single partition Durability Data replicated and synced to disk Geo-replication Out of box support for geographically distributed applications Deployed globally in 10+ data centers with full replication and has processed more than 100 trillion messages to date. Delivery Guarantees At least once, at most once and effectively once Low Latency Low publish latency of 5ms at 99 pct Highly scalable Can support millions of topics
  • 8. ‱ Each of the three trading desks ingests real-time trade and quote information from all of the exchanges within their respective regions and publish them into a shared, geo-replicated Pulsar topic. ‱ Trade & Quote information published in one region is available in another ‱ Apache Pulsar provides built-in WebSocket clients for all of its topics, which are used to drive the trading dashboards used by the traders. ‱ When an arbitrage opportunity is identiïŹed, it will be published to the arbitrage topic for further evaluation. The Solution Architecture
  • 12. ‱ Subscribes to the Cryptocompare API. ‱ You can subscribe to multiple feeds in a single request, but API throttles requests to 1000 / minute. ‱ Subscription requests have the following format: ‱ {FeedType}~{ExchangeName}~{FromCurrencySymbol}~{ToCurrencySymbol} ‱ Publishes the received events to a WebSocket on port 4019, which NiFi subscribes to. Crypto Currency Data Feed
  • 14. ‱ Amount of effort to produce the demo was approximately 2 weeks, with the bulk of the time spent on the Apache NiFi processors. Source code for the Apache NiFi Processors (will be contributed back to the Apache project) can be found here: ‱ https://github.com/openconnectors/niïŹ-pulsar-bundle ‱ https://github.com/openconnectors/niïŹ-pulsar-client-services ‱ Infrastructure is Google Cloud Compute, managed by Kubernetes. Helm Charts can be found here: ‱ https://storage.googleapis.com/streamlio/charts ‱ Docker images are currently available in DockerHub here: ‱ https://hub.docker.com/r/streamlio/niïŹ/ ‱ https://hub.docker.com/r/streamlio/crypto-currency/ ‱ Phase 2 of the demo will add automated trading using Machine Learning automated by Apache Heron. Final Comments
  • 16. Curious to Learn More? ‱ Apache Pulsar : http://pulsar.incubator.apache.org ‱ Apache DistributedLog : http://bookkeeper.apache.org/distributedlog ‱ Apache BookKeeper : http://bookkeeper.apache.org ‱ Follow Us @apache_pulsar @asfbookkeeper @distributedlog 16
  • 17. Curious to learn more about Streamlio? ‱ Streamlio: https://streaml.io ‱ Sandbox Preview: https://streaml.io/docs/getting-started ‱ Learn slack channel: https://learn-streamlio.slack.com 17