Skip to content

Commit

Permalink
fix: hide invalid orders
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Dec 2, 2024
1 parent b4144d4 commit 04aca60
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/PoolOrderBook.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default {
} else {
groupBase = 10 ** selectedPower;
}
return groupOrdersByPrice(this.sellOrderList, groupBase).reverse();
const filteredList = this.sellOrderList.filter((order) => order.coin0Price >= this.midPrice);
return groupOrdersByPrice(filteredList, groupBase).reverse();
},
buyBook() {
const selectedPower = this.priceGroupPowerList[this.selectedPriceGroupIndex];
Expand All @@ -81,7 +82,8 @@ export default {
} else {
groupBase = 10 ** selectedPower;
}
return groupOrdersByPrice(this.buyOrderList, groupBase);
const filteredList = this.buyOrderList.filter((order) => order.coin0Price <= this.midPrice);
return groupOrdersByPrice(filteredList, groupBase);
},
sellBookMaxAmount() {
return this.sellBook.reduce((limit, item) => Math.max(limit, item.amount), 0);
Expand Down

0 comments on commit 04aca60

Please sign in to comment.