This project provides a Java client library for the Bitfinex WebSocket API (v2). Public and private channels (candles, ticks, executed trades, (raw) orderbooks, orders, and wallets) are implemented.
In contrast to other implementations, this project uses the WSS (web socket secure) streaming API of Bitfinex. Most other projects are poll the REST-API periodically, which leads to delays in data processing. In this implementation, you can register callback methods on ticks, candles or orders. The callbacks are executed, as soon as new data is received from Bitfinex (see the examples section for more details).
Warning: Trading carries significant financial risk; you could lose a lot of money. If you are planning to use this software to trade, you should perform many tests and simulations first. This software is provided 'as is' and released under the Apache 2.0 license.
You will find some examples here.
Add these lines to your
<dependency> <groupId>com.github.jnidzwetzki</groupId> <artifactId>bitfinex-v2-wss-api</artifactId> <version>0.7.5</version> </dependency>
Add these lines to your
You will find the changelog of the project here.
The old order flags are deprecated by Bitfinex and replaced by the new 'WSv2 order flag'. This change is adapted in this version. Methods like
BitfinexOrderBuilder.setReduce() are replaced by
Major refactoring has been made around the library. Library is operating in non-blocking manner fully from this version. User may register handlers to listen on upcoming server events through exposed callbacks API. Review Low-level channel subscriptions section of Examples for more details.
BitfinexCurrencyPair is no longer auto-registering currency pairs in JVM. User should call BitfinexCurrencyPair#registerDefaults() explicitily if one wishes to use them.
BitfinexCurrencyPair now supports dynamic currency creation. Therefore, the old enum consts are removed.
# Old (version <= 0.6.8) BitfinexCurrencyPair.BTC_USD # New (version > 0.6.8) BitfinexCurrencyPair.of("BTC","USD")
BitfinexTick was renamed to
BitfinexCandle and a new class for ticks was introduced.
Starting with version 0.6.3 the value for uninitialized BigDecimal values was unified to null (in version 0.6.2 sometimes -1 and sometimes null was used).
Since version 0.6.2, the double data type is replaced by the BigDecimal data type for increased precision.
Since version 0.6.1, the Wallets are new managed by the Wallet manager.
With version 0.6.0 the ta4j dependency was removed.