From 948da8469f1c2a957ba3bba18cbf5bf1b81a476e Mon Sep 17 00:00:00 2001 From: Justin Silver Date: Fri, 12 Jan 2024 10:45:32 -0800 Subject: [PATCH] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index de69469..1b4b8bb 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,15 @@ ![swob](https://github.com/PaintSwap/samwitch-orderbook/assets/84033732/977c060f-e6e7-418f-9d44-1012599f41c6) -This efficient order book utilises the BokkyPooBahsRedBlackTreeLibrary library for sorting prices allowing O(log n) for tree segment insertion, traversal and deleting. It supports batch orders and batch cancelling, ERC2981 royalties, a dev and burn fee on each trade. +This efficient order book utilises the BokkyPooBahsRedBlackTreeLibrary library for sorting prices allowing O(log n) for tree segment insertion, traversal, and deletion. It supports batch orders and batch cancelling, ERC2981 royalties, and a dev and burn fee on each trade. -It is kept gas efficient by packing dataq in many areas: +It is kept gas efficient by packing data in many areas: -- 4 orders (uint24 quantity + uint40 order id) into a 256bit word giving a 4x improvement compared to using 1 storage slot per order. +- Four orders (uint24 quantity + uint40 order id) into a 256bit word giving a 4x improvement compared to using 1 storage slot per order. - When taking from the order book no tokens/nfts are transferred. Instead the orderId is stored in a claimable array - The tokens claimable are packed with 3 orders per storage slot -The order book is kept healthy by requiring a minimum quantity that can be added, partial quantities can still be taken from the order book. Cancelling orders shifts all at the price level to remove gaps. +The order book is kept healthy by requiring a minimum quantity that can be added - partial quantities can still be taken from the order book. Cancelling orders shifts all entries at that price level to remove gaps. Constraints: @@ -20,7 +20,7 @@ Constraints: - The maximum number of orders in the book that can ever be added is limited to 1 trillion - The maximum number of orders that can be added to a specific price level is between 4.2 - 16 billion -While this OrderBook was created for ERC1155 NFTs it could be adapted for ERC20s +While this order book was created for ERC1155 NFTs it could be adapted for ERC20 tokens. Note: Not suitable for production until more tests are added with more code coverage. @@ -30,7 +30,7 @@ Potential improvements: - Range delete of the red-black tree using split/join - The tree, either pack red & numDeletedInSegment or reduce number of decimals for the price and use uint64 instead. -To start copy the .env.sample file to .env and fill in PRIVATE_KEY at minimum, starts with 0x +To start copy the `.env.sample` file to `.env` and fill in `PRIVATE_KEY` at a minimum (starts with `0x`). ```shell yarn install