Skip to content

yavuztas/cap-source

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAP - Crypto API

A PoC for an example financial data stream service. It's based on public cryptocurrency data.

cap-source

This project is the upstream part of the tick data stream.

Overview

  • Using Binance Public API (websocket) to listen to ticker stream of configurable symbols.
  • FeedSupplier stores the raw data into a RingBuffer (a naive implementation by utilizing a fixed size ArrayList)
  • Incoming data is consumed and encoded by FeedConsumers (only basic encoding (US_ASCII), doesn't compress) and is redirected to Registry.
  • Registry makes a TCP fan-out to the connected RegistryClients via FeedDataStream (per client instance) which uses Vertx's Pipe for TCP write backpressure (in case of slow clients).
  • A unit test demonstrates also client connection which can be found in RegistrySpec

How To Run

For possible configurations, application.yml

app:
  vertx:
    event-loop-pool-size: 8
  registry:
    host: localhost
    port: 7000
    tcp_server_thread_pool: 4

source:
  binance:
    buffer-size: 1024
    symbols: btcusdt,ethusdt

Via Gradle:

# profile local or dev enables console logging
./gradlew bootRun --args='--spring.profiles.active=local'

3rd Party Projects/Libraries

Many thanks to these awesome projects:

Otherwise, it wouldn't be possible to make this project, at least in a reasonable time :)

About

CAP - Crypto API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published