-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate initial set of ExchangeRateProviders
Add support for a few exchanges to demonstrate and test the pricenode aggregate rates. The chose exchanges were selected because they each provide a varied list of fiat and altcoins, with a substantial overlap between them. This provides a robust initial set of datapoints and scenarios for aggregate rates.
- Loading branch information
Showing
11 changed files
with
456 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
pricenode/src/main/java/bisq/price/spot/providers/Binance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of Bisq. | ||
* | ||
* Bisq is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Bisq is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package bisq.price.spot.providers; | ||
|
||
import bisq.price.spot.ExchangeRate; | ||
import bisq.price.spot.ExchangeRateProvider; | ||
|
||
import org.knowm.xchange.binance.BinanceExchange; | ||
|
||
import org.springframework.core.annotation.Order; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.time.Duration; | ||
|
||
import java.util.Set; | ||
|
||
@Component | ||
@Order(5) | ||
public class Binance extends ExchangeRateProvider { | ||
|
||
public Binance() { | ||
super("BINANCE", "binance", Duration.ofMinutes(1)); | ||
} | ||
|
||
@Override | ||
public Set<ExchangeRate> doGet() { | ||
// Supported fiat: EUR, NGN, RUB, TRY, ZAR | ||
// Supported alts: BEAM, DASH, DCR, DOGE, ETC, ETH, LTC, NAV, PIVX, XMR, XZC, ZEC, ZEN | ||
return doGet(BinanceExchange.class); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
pricenode/src/main/java/bisq/price/spot/providers/Bitfinex.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of Bisq. | ||
* | ||
* Bisq is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Bisq is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package bisq.price.spot.providers; | ||
|
||
import bisq.price.spot.ExchangeRate; | ||
import bisq.price.spot.ExchangeRateProvider; | ||
|
||
import org.knowm.xchange.bitfinex.BitfinexExchange; | ||
|
||
import org.springframework.core.annotation.Order; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.time.Duration; | ||
|
||
import java.util.Set; | ||
|
||
@Component | ||
@Order(6) | ||
public class Bitfinex extends ExchangeRateProvider { | ||
|
||
public Bitfinex() { | ||
super("BITFINEX", "bitfinex", Duration.ofMinutes(1)); | ||
} | ||
|
||
@Override | ||
public Set<ExchangeRate> doGet() { | ||
// Supported fiat: EUR, GBP, JPY, USD | ||
// Supported alts: DAI, ETC, ETH, LTC, XMR, ZEC | ||
return doGet(BitfinexExchange.class); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
pricenode/src/main/java/bisq/price/spot/providers/Kraken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of Bisq. | ||
* | ||
* Bisq is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Bisq is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with Bisq. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package bisq.price.spot.providers; | ||
|
||
import bisq.price.spot.ExchangeRate; | ||
import bisq.price.spot.ExchangeRateProvider; | ||
|
||
import org.knowm.xchange.kraken.KrakenExchange; | ||
|
||
import org.springframework.core.annotation.Order; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.time.Duration; | ||
|
||
import java.util.Set; | ||
|
||
@Component | ||
@Order(7) | ||
public class Kraken extends ExchangeRateProvider { | ||
|
||
public Kraken() { | ||
super("KRAKEN", "kraken", Duration.ofMinutes(1)); | ||
} | ||
|
||
@Override | ||
public Set<ExchangeRate> doGet() { | ||
// Supported fiat: AUD, CAD, CHF, EUR, GBP, JPY, USD | ||
// Supported alts: DASH, DOGE, ETC, ETH, LTC, XMR, ZEC | ||
return doGet(KrakenExchange.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.