Skip to content

Commit

Permalink
CryptoYaMarketData: Create allTickersAsStream method
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Sep 1, 2023
1 parent 5dabd6c commit e422c1a
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/main/java/bisq/price/util/cryptoya/CryptoYaMarketData.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,33 @@ public OptionalDouble averagedArsBlueRateFromLast24Hours() {
}

private Stream<CryptoYaTicker> streamLatestAvailableMarkets(Long startingTime) {
return Stream.of(argenbtc, buenbit, ripio, ripioexchange, satoshitango,
cryptomkt, decrypto, latamex, bitso, letsbit, fiwind,
lemoncash, bitmonedero, belo, tiendacrypto, saldo,
kriptonmarket, calypso, bybit, binance)
.filter(Objects::nonNull)
return allTickersAsStream().filter(Objects::nonNull)
.filter(r -> r.getAsk() > 0)
.filter(rate -> rate.getTime() > startingTime);
}

private Stream<CryptoYaTicker> allTickersAsStream() {
return Stream.of(
argenbtc,
buenbit,
ripio,
ripioexchange,
satoshitango,
cryptomkt,
decrypto,
latamex,
bitso,
letsbit,
fiwind,
lemoncash,
bitmonedero,
belo,
tiendacrypto,
saldo,
kriptonmarket,
calypso,
bybit,
binance
);
}
}

0 comments on commit e422c1a

Please sign in to comment.