All Projects → bitrich-info → Xchange Stream

bitrich-info / Xchange Stream

Licence: apache-2.0
XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol. It is build on top of of XChange library providing new interfaces for streaming API. User can subscribe for live updates via reactive streams of RxJava library.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Xchange Stream

Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (+59.95%)
Mutual labels:  bitcoin, websocket
Python Kucoin
Kucoin REST and Websocket API python implementation
Stars: ✭ 165 (-58.96%)
Mutual labels:  bitcoin, websocket
Mercure
Server-sent live updates: protocol and reference implementation
Stars: ✭ 2,608 (+548.76%)
Mutual labels:  streaming-api, websocket
Miningcore
Miningcore is a high-performance Mining-Pool Engine that runs on Linux and Windows and supports a variety of crypto-currencies.
Stars: ✭ 378 (-5.97%)
Mutual labels:  bitcoin
Mempool
An open-source explorer developed for the Bitcoin community, focusing on the emerging transaction fee market to help our transition into a multi-layer ecosystem.
Stars: ✭ 374 (-6.97%)
Mutual labels:  bitcoin
Java Slack Sdk
Slack Developer Kit (including Bolt for Java) for any JVM language
Stars: ✭ 393 (-2.24%)
Mutual labels:  websocket
Spring Samples For All
spring、spring-boot、spring-cloud 常用整合用例
Stars: ✭ 401 (-0.25%)
Mutual labels:  websocket
Unchained
My personal study of blockchain related technology.
Stars: ✭ 379 (-5.72%)
Mutual labels:  bitcoin
Grpc Websocket Proxy
A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets
Stars: ✭ 395 (-1.74%)
Mutual labels:  websocket
Node Media Server
A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
Stars: ✭ 4,433 (+1002.74%)
Mutual labels:  websocket
Crypto Whale Watching App
Python Dash app that tracks whale activity in cryptocurrency markets.
Stars: ✭ 389 (-3.23%)
Mutual labels:  bitcoin
Bitcoin Core
A modern Bitcoin Core REST and RPC client.
Stars: ✭ 379 (-5.72%)
Mutual labels:  bitcoin
Wormhole
Wormhole — it's better EventEmitter for communication between tabs with supporting Master/Slave.
Stars: ✭ 393 (-2.24%)
Mutual labels:  websocket
Echo
High performance, minimalist Go web framework
Stars: ✭ 21,297 (+5197.76%)
Mutual labels:  websocket
Huobi python
Python SDK for Huobi Spot API
Stars: ✭ 391 (-2.74%)
Mutual labels:  websocket
Crypto Bar
📈 A menu bar app that updates cryptocurrencies prices in real-time
Stars: ✭ 379 (-5.72%)
Mutual labels:  bitcoin
Socket.io Unity
socket.io client for Unity, power game client with node.js back-end
Stars: ✭ 396 (-1.49%)
Mutual labels:  websocket
Ws
Tiny WebSocket library for Go.
Stars: ✭ 4,267 (+961.44%)
Mutual labels:  websocket
Cryptocurrency
Overview of top cryptocurrencies
Stars: ✭ 385 (-4.23%)
Mutual labels:  bitcoin
Vue Crud X
Vue+Express Cookbook & CRUD Component (with Vite and Web Components)
Stars: ✭ 393 (-2.24%)
Mutual labels:  websocket

ARCHIVED

This project has now been merged into the XChange library. There will be no further releases and pull requests will not be accepted. Please use XChange from 5.0.0-SNAPSHOT onwards, which is, for now, 100% compatible.

XChange-stream

XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol.

It is build on top of the XChange library providing new interfaces for the exchanges' streaming APIs. Users can subscribe for live updates via reactive streams of RxJava library.

Why use it?

  • Easy to use - no need to hack WebSocket and other backends.
  • Consistent & simple API across all implemented exchanges.
  • Extends well-known & active Java library XChange.
  • Reactive streams are fun to work with.
  • Modular extensibility.

Getting started

Include in your project

Xchange-stream is on Maven Central. You will need xchange-stream-core dependency and xchange-XYZ where XYZ is supported exchange (eg. xchange-bitstamp). Add the following into your pom.xml.

Maven

<dependency>
    <groupId>info.bitrich.xchange-stream</groupId>
    <artifactId>xchange-stream-core</artifactId>
    <version>x.y.z</version>
</dependency>

<dependency>
    <groupId>info.bitrich.xchange-stream</groupId>
    <artifactId>xchange-XYZ</artifactId>
    <version>x.y.z</version>
</dependency>

Maven Central

For snapshots version (built from develop branch), add the following repository to your pom.xml file.

<repository>
  <id>sonatype-oss-snapshot</id>
  <snapshots/>
  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

Versioning

XChange-stream follows major and minor version from XChange library. So version 4.2.x is based on latest 4.2. release of XChange.

Example

Use the same library as XChange but instead of ExchangeFactory use StreamingExchangeFactory that creates StreamingExchange instead of Exchange. Then you can call getStreamingMarketDataService to subscribe to trade data.

StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(BitstampStreamingExchange.class.getName());

// Connect to the Exchange WebSocket API. Blocking wait for the connection.
exchange.connect().blockingAwait();

// Subscribe to live trades update.
exchange.getStreamingMarketDataService()
        .getTrades(CurrencyPair.BTC_USD)
        .subscribe(trade -> {
            LOG.info("Incoming trade: {}", trade);
        }, throwable -> {
            LOG.error("Error in subscribing trades.", throwable);
        });

// Subscribe order book data with the reference to the subscription.
Disposable subscription = exchange.getStreamingMarketDataService()
                                  .getOrderBook(CurrencyPair.BTC_USD)
                                  .subscribe(orderBook -> {
                                       // Do something
                                  });

// Unsubscribe from data order book.
subscription.dispose();

// Disconnect from exchange (non-blocking)
exchange.disconnect().subscribe(() -> LOG.info("Disconnected from the Exchange"));

More information about reactive streams can be found at RxJava wiki.

What is supported

Listening for live updates of:

Exchange order books trades (public) tickers balances trades (user) open orders notes
Bankera ✔️ ✔️ 🚧 Ticker support could be implemented using the trades and order book streams, even though the exchange doesn't explicitly return a ticker stream.
Binance ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Bitfinex ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Bitflyer ✔️ ✔️ ✔️
BitMEX ✔️ ✔️ ✔️ 🚧 🚧 🚧 We are short of maintainers able to review pull requests and provide support for Bitmex, so there is a backlog of pull requests and support is likely broken. Can you help? See #180 for reference if attempting to add private channel support.
Bitstamp ✔️ ✔️
CEX.IO ✔️ New support, not widely tested
Coinbase Pro ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Coinmate ✔️ ✔️ ✔️ ✔️ ✔️
Gemini ✔️ ✔️ 🚧 🚧 🚧
Kraken ✔️ ✔️ ✔️ ✔️ ✔️
LGO ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
OKCoin ✔️ ✔️ ✔️
OKEx ✔️ ✔️ ✔️ See #180 for reference if attempting to add private channel support.
Poloniex ✔️ ✔️ ✔️
  • ✔️ - implemented
  • 🚧 - missing but can be implemented
  • ❌ - not supported by the exchange
  • ❓ - exchange support level not known (please fill in)

If you missing a specific exchange implementation, feel free to propose a pull request or open an issue with some sweet BTC bounty.

Open Source Projects Using XChange-Stream

This is an, not so complete, list of projects that use XChange-Stream, feel free to add your project below.

License

Copyright 2017 Zdenek Dolezal, Michal Oprendek

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].