A Kotlin library for cryptocurrency trading.
Support public market feature (tickData, orderBook)
logo | name | ExchangeVendor | ver | doc |
---|---|---|---|---|
Binance | BINANCE | * | ws | |
Upbit | UPBIT | v1.0.3 | ws | |
Huobi Global | HUOBI_GLOBAL | * | ws | |
Huobi Korea | HUOBI_KOREA | * | ws | |
Huobi Japan | HUOBI_JAPAN | * | ws | |
Okex | OKEX | v3 | ws | |
Okex Korea | OKEX_KOREA | v3 | ws | |
UnicornX | UNICORNX | v3 | ws | |
Hubi | HUBI | * | ws | |
Bitmex | BITMEX | * | ws | |
Kraken | KRAKEN | 0.1.1 | ws | |
Bitmax | BITMAX | v1.2 | ws | |
Coineal | COINEAL | |||
Poloniex | POLONIEX | * | ws | |
Bitstamp | BITSTAMP | v2 | ws | |
Korbot EX | KOTBOTEX | v3 | ws | |
Coinall | COINALL | v3 | ws | |
Bhex | BHEX | v1 | ws | |
Bit-Z | BITZ | * | ws | |
closed | ws | |||
deprecated |
Exchange | ver | doc |
---|---|---|
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 1. Add jitpack repository
<dependency>
<groupId>com.github.namjug-kim.reactive-crypto</groupId>
<artifactId>reactive-crypto-{exchange-name}</artifactId>
<version>LATEST</version>
</dependency>
Step 2. Add the dependency
repositories {
...
maven { url 'https://jitpack.io' }
}
Step 1. Add jitpack repository
dependencies {
implementation 'com.github.namjug-kim.reactive-crypto:reactive-crypto-{exchange-name}:LATEST'
}
Step 2. Add the dependency
fun websocketTickDataExample() {
// create websocketClient for each crypto currency exchange
val websocketClient = ExchangeClientFactory.websocket(ExchangeVendor.BINANCE)
websocketClient.createTradeWebsocket(listOf(CurrencyPair(BTC, USDT)))
.doOnNext { log.info { "new tick data $it" } }
.subscribe()
}
fun httpLimitOrderExample() {
val orderPlaceResult = ExchangeClientFactory.http(ExchangeVendor.BINANCE)
.privateApi("accessKey", "secretKey")
.order()
.limitOrder(
CurrencyPair(Currency.BTC, Currency.KRW),
TradeSideType.BUY,
BigDecimal.valueOf(10000000.0),
BigDecimal.valueOf(10.0)
)
.block()
log.info { orderPlaceResult }
}
class SampleClass {
public void websocketTickDataExample() {
// create websocketClient for each crypto currency exchange
ExchangeWebsocketClient exchangeWebsocketClient = ExchangeClientFactory.websocket(ExchangeVendor.BINANCE);
List<CurrencyPair> targetPairs = Collections.singletonList(CurrencyPair.parse("BTC", "USDT"));
exchangeWebsocketClient.createTradeWebsocket(targetPairs)
.doOnNext(tickData -> log.info("new tick data {}", tickData))
.subscribe();
}
public void httpLimitOrderExample() {
OrderPlaceResult orderPlaceResult = ExchangeClientFactory.http(ExchangeVendor.BINANCE)
.privateApi("accessKey", "secretKey")
.order()
.limitOrder(
CurrencyPair(Currency.BTC, Currency.KRW),
TradeSideType.BUY,
BigDecimal.valueOf(10000000.0),
BigDecimal.valueOf(10.0)
)
.block();
log.info("{}", orderPlaceResult);
}
}
- Reactive Crypto is Open Source Software released under the Apache License 2.0