Skip to content

Commit

Permalink
increased order book limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor committed Oct 18, 2023
1 parent 87992db commit 1cf7ef5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/app/components/OrderBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ export function OrderBook() {
return (
<div className="p-2 text-sx text-primary-content">
<div className="sized-columns">
<div className="">
<span className="text-secondary-content text-sm font-bold uppercase">
Orderbook
</span>
</div>
<div className="sized-columns mx-2 col-span-4 text-sm text-secondary-content">
<div className="text-start">
Order
Expand All @@ -134,7 +139,8 @@ export function OrderBook() {
<br />({token1Symbol})
</div>
</div>

</div>
<div className="sized-columns mx-2 col-span-4 text-sm">
{sells.map((props, index) => (
<OrderBookRow key={"sell-" + index} {...props} />
))}
Expand Down
5 changes: 2 additions & 3 deletions src/app/redux/orderBookSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function toOrderBookRowProps(
adexRows.reverse();
barColor = "hsl(var(--erc))";
}
adexRows = adexRows.slice(0, 8); // Limit to 8 rows
adexRows = adexRows.slice(0, 11); // Limit to 8 rows

let total = 0;
let maxTotal = 0;
Expand All @@ -70,7 +70,7 @@ export function toOrderBookRowProps(
}

// If there are fewer than 8 orders, fill the remaining rows with empty values
while (props.length < 8) {
while (props.length < 11) {
props.push({ absentOrders: "\u00A0" });
}

Expand Down Expand Up @@ -101,7 +101,6 @@ export const orderBookSlice = createSlice({
adexState.currentPairOrderbook.buys,
"buy"
);

let bestSell = sells[sells.length - 1]?.price || null;
let bestBuy = buys[0]?.price || null;

Expand Down

0 comments on commit 1cf7ef5

Please sign in to comment.