Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Coinbase Pro exchange adapter to master #134

Merged
merged 11 commits into from
Feb 6, 2021
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BX-bot

[![Build Status](https://travis-ci.com/gazbert/bxbot.svg?branch=master)](https://travis-ci.com/gazbert/bxbot)
[![Build Status](https://travis-ci.com/gazbert/bxbot.svg?branch=coinbase-pro)](https://travis-ci.com/gazbert/bxbot)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=gazbert_bxbot&metric=alert_status)](https://sonarcloud.io/dashboard?id=gazbert_bxbot)
[![Join the chat at https://gitter.im/BX-bot/Lobby](https://badges.gitter.im/BX-bot/Lobby.svg)](https://gitter.im/BX-bot/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand All @@ -18,7 +18,8 @@ except for the trading strategies - you'll need to write those yourself! A simpl
Trading API - take a look [here](https://github.com/ta4j/ta4j) for more ideas.

Exchange Adapters for using [Bitstamp](https://www.bitstamp.net), [Bitfinex](https://www.bitfinex.com),
[itBit](https://www.itbit.com/), [Kraken](https://www.kraken.com), and [Gemini](https://gemini.com/) are included.
[itBit](https://www.itbit.com/), [Kraken](https://www.kraken.com), [Gemini](https://gemini.com/),
and [Coinbase Pro](https://pro.coinbase.com/) are included.
Feel free to improve these or contribute new adapters to the project; that would be
[shiny!](https://en.wikipedia.org/wiki/Firefly_(TV_series))

Expand Down
3 changes: 1 addition & 2 deletions bxbot-exchanges/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ jacocoTestCoverageVerification {
excludes = [
'com.gazbert.bxbot.exchanges.BitfinexExchangeAdapter*',
'com.gazbert.bxbot.exchanges.BitstampExchangeAdapter*',
'com.gazbert.bxbot.exchanges.GdaxExchangeAdapter*',
'com.gazbert.bxbot.exchanges.GeminiExchangeAdapter*',
'com.gazbert.bxbot.exchanges.ItBitExchangeAdapter*',
'com.gazbert.bxbot.exchanges.KrakenExchangeAdapter*',
'com.gazbert.bxbot.exchanges.OkCoinExchangeAdapter*',
'com.gazbert.bxbot.exchanges.TestExchangeAdapter*',
'com.gazbert.bxbot.exchanges.AbstractExchangeAdapter*',
'com.gazbert.bxbot.exchanges.CoinbaseProExchangeAdapter*',
]
limit {
counter = 'LINE'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Gareth Jon Lynch
* Copyright (c) 2021 Gareth Jon Lynch
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
Expand Down Expand Up @@ -47,15 +47,11 @@
import org.junit.Test;

/**
* Basic integration testing with GDAX exchange.
*
* <p>DO NOT USE: See https://github.com/gazbert/bxbot/pull/120
* Basic integration testing with Coinbase Pro exchange.
*
* @author gazbert
* @deprecated #120 : GDAX exchange has been superseded by Coinbase Pro: https://pro.coinbase.com/
*/
@Deprecated(forRemoval = true)
public class GdaxIT {
public class CoinbaseProIT {

private static final String MARKET_ID = "BTC-GBP";
private static final BigDecimal BUY_ORDER_PRICE = new BigDecimal("450.176");
Expand Down Expand Up @@ -92,6 +88,7 @@ public void setupForEachTest() {
otherConfig = createMock(OtherConfig.class);
expect(otherConfig.getItem("buy-fee")).andReturn("0.25");
expect(otherConfig.getItem("sell-fee")).andReturn("0.25");
expect(otherConfig.getItem("time-server-bias")).andReturn("1");

exchangeConfig = createMock(ExchangeConfig.class);
expect(exchangeConfig.getAuthenticationConfig()).andReturn(authenticationConfig);
Expand All @@ -103,7 +100,7 @@ public void setupForEachTest() {
public void testPublicApiCalls() throws Exception {
replay(authenticationConfig, networkConfig, otherConfig, exchangeConfig);

final ExchangeAdapter exchangeAdapter = new GdaxExchangeAdapter();
final ExchangeAdapter exchangeAdapter = new CoinbaseProExchangeAdapter();
exchangeAdapter.init(exchangeConfig);

assertNotNull(exchangeAdapter.getLatestMarketPrice(MARKET_ID));
Expand All @@ -120,7 +117,7 @@ public void testPublicApiCalls() throws Exception {
assertNotNull(ticker.getLow());
assertNotNull(ticker.getOpen());
assertNotNull(ticker.getVolume());
assertNull(ticker.getVwap()); // not provided by GDAX
assertNull(ticker.getVwap()); // not provided by Coinbase Pro
assertNotNull(ticker.getTimestamp());

verify(authenticationConfig, networkConfig, otherConfig, exchangeConfig);
Expand All @@ -134,7 +131,7 @@ public void testPublicApiCalls() throws Exception {
public void testAuthenticatedApiCalls() throws Exception {
replay(authenticationConfig, networkConfig, otherConfig, exchangeConfig);

final ExchangeAdapter exchangeAdapter = new GdaxExchangeAdapter();
final ExchangeAdapter exchangeAdapter = new CoinbaseProExchangeAdapter();
exchangeAdapter.init(exchangeConfig);

final BalanceInfo balanceInfo = exchangeAdapter.getBalanceInfo();
Expand Down

This file was deleted.

Loading