Reduce data sent to client in the <Orderbook /> Component. The component will fetch both sides of the Orderbook summary.
Orderbook Buy/Sell will be our first to include a page= and limit= query parameter. They also should optionally contain a valid Response Object for Infinite Scroll
Notes:
This should also add size filter for orderbook display. Size is the minimum amount a order can have to be displayed in the orderbook.
SIze filter comes before aggregation to limit small orders from being aggregated
The reduction in API responses and separation of Business/Presentation layers gets us ready for Infinite Queries (aka Infinite Scroll). This would be subsetting the responses with pagination and adding Infinite Scroll to the components.
Orderbook Display for Orderbook Component
Data from algodex-backend/orders.php?assetid=24891477 is currently aggregated in the frontend using this map function: https://github.com/algodex/algodex-react/blob/development/hooks/useAlgodex.js#L232 and displayed here in the Orderbook:
Reduce data sent to client in the
<Orderbook />
Component. The component will fetch both sides of the Orderbook summary.Orderbook Buy/Sell will be our first to include a page= and limit= query parameter. They also should optionally contain a valid Response Object for Infinite Scroll
Notes:
This should also add size filter for orderbook display. Size is the minimum amount a order can have to be displayed in the orderbook.
API Route
./public-api/orderbook.php?id={assetId}&type="buy"&page=0&limit=100&size=100
Example Response:
Stretch Goals:
The reduction in API responses and separation of Business/Presentation layers gets us ready for Infinite Queries (aka Infinite Scroll). This would be subsetting the responses with pagination and adding Infinite Scroll to the components.
React-Query Docs: https://react-query.tanstack.com/guides/infinite-queries Working Example: https://react-query.tanstack.com/examples/load-more-infinite-scroll