This article was first published on Loopring Protocol - Medium
We wanted to go over some of the new features, and give a bit more detail on the technical aspects.
More Efficient Ring Settlement
Orders can be filled a lot more efficiently than in Loopring 1.X.
Loopring 1.X was limited to a single ring per transaction. In Loopring 2.0 multiple rings can be submitted in a single transaction. This allows Loopring 2.0 to settle rings a lot more efficiently:
- Orders can be used in multiple rings but the order data only needs to be sent once (saving on expensive calldata)
- Expensive token transfers are merged so we need to do less of them
- We can batch state queries and updates. Every external contract call costs gas, so doing less of them reduces cost.
- Updating the trade history (i.e. how much orders are filled) only needs to be done once, no matter how many times the orders are used in the rings. This saves a lot on expensive SSTOREs
We also introduced a contract for holding fees. The fee that is paid by the order owner can be shared between multiple parties (wallet, miner and burn rate). This would take expensive separate token transfers to send fees to each party every time. By sending the fees to a contract where each party can withdraw the fees, we further reduce the number of token transfers we need to do.
On top of this we compress the data that needs to be sent to the smart contract (calldata) by packing the data together and reusing data between orders....
To keep reading, please go to the original article at:
Loopring Protocol - Medium