mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Remove filter for offerbook teaser tables
This commit is contained in:
parent
e847a863c9
commit
ee55aa3e09
1 changed files with 0 additions and 24 deletions
|
@ -297,8 +297,6 @@ class OfferBookChartViewModel extends ActivatableViewModel {
|
|||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
allBuyOffers = filterOffersWithRelevantPrices(allBuyOffers);
|
||||
|
||||
final Optional<Offer> highestBuyPriceOffer = allBuyOffers.stream()
|
||||
.filter(o -> o.getPrice() != null)
|
||||
.max(Comparator.comparingLong(o -> o.getPrice().getValue()));
|
||||
|
@ -339,8 +337,6 @@ class OfferBookChartViewModel extends ActivatableViewModel {
|
|||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
allSellOffers = filterOffersWithRelevantPrices(allSellOffers);
|
||||
|
||||
final Optional<Offer> highestSellPriceOffer = allSellOffers.stream()
|
||||
.filter(o -> o.getPrice() != null)
|
||||
.max(Comparator.comparingLong(o -> o.getPrice().getValue()));
|
||||
|
@ -362,26 +358,6 @@ class OfferBookChartViewModel extends ActivatableViewModel {
|
|||
buildChartAndTableEntries(allSellOffers, OfferPayload.Direction.SELL, sellData, topSellOfferList);
|
||||
}
|
||||
|
||||
// If there are more then 3 offers we ignore the offers which are further than 30% from the best price
|
||||
private List<Offer> filterOffersWithRelevantPrices(List<Offer> offers) {
|
||||
if (offers.size() > 3) {
|
||||
Price bestPrice = offers.get(0).getPrice();
|
||||
if (bestPrice != null) {
|
||||
long bestPriceAsLong = bestPrice.getValue();
|
||||
return offers.stream()
|
||||
.filter(e -> {
|
||||
if (e.getPrice() == null)
|
||||
return false;
|
||||
|
||||
double ratio = (double) e.getPrice().getValue() / (double) bestPriceAsLong;
|
||||
return Math.abs(1 - ratio) < 0.3;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return offers;
|
||||
}
|
||||
|
||||
private void buildChartAndTableEntries(List<Offer> sortedList, OfferPayload.Direction direction, List<XYChart.Data> data, ObservableList<OfferListItem> offerTableList) {
|
||||
data.clear();
|
||||
double accumulatedAmount = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue