On October 9th, our team successfully submitted zkRollup AMM join, swap, and exit transactions on Ethereum’s Goerli network.
A few example transactions:
- https://goerli.etherscan.io/tx/0x76ea064ba3e4c85940748da165baabdad9af7a81c54e76eeb33073d113a5c5bf: a pool join transaction (add liquidity).
- https://goerli.etherscan.io/tx/0x3a589a0cdd0ca43b27ea13f28acb1cb9b11f11f7d783c35e309e106dacc52f8d: a swap transaction.
- https://goerli.etherscan.io/tx/0x61c3c89f309b3610fc857fe25e32eac9c3941def5a07e3e8210ea324b0db7862: a pool exit transaction (remove liquidity).
About Loopring’s AMM Design
An AMM swap circuit is now part of Loopring 3.6. The circuit implemented the Balancer curve:
tranges over the tokens in the pool;
Btis the balance of the token in the pool;
Wtis the weight of the token, upgradable by the AMM pool’s managing contract.
Various AMM pools can be implemented differently in their own smart contracts; all pool join and exit transactions are on layer-2 using Loopring’s Transfer transactions. The pool’s smart contract verifies join/exit transactions data onchain and manages pool token issuance; Loopring only facilitates swap transaction settlement. Therefore, AMM pool contracts are not considered as part of the Loopring protocol.
Loopring 3.6 will match regular orderbook orders with AMM pools natively without the need for extra funds to do arbitrage. Orders can be filled partially with other orders and partially with AMM pools. It’s the relayer’s job to facilitate order routing for the best price and/or based on user preferences.
Loopring 3.6 can even do swaps between multiple AMM pools that support the same tokens.
As part of a native zkRollup implementation, Loopring’s AMM swap transactions will be super-efficient. We’ll share more details later.
- We are optimizing our smart contracts to minimize the gas cost per pool join/exit transaction. This is likely to finish within a week.
- We’ll improve test coverage to make sure liquidity providers can withdraw money in all scenarios, including exchange shutdown.
- We’ll perform stress testing to ensure the throughput and cost meets our expectation. Most importantly, such tests will likely identify issues in our relayer.
We plan to launch Loopring 3.6 on the Ethereum mainnet in December. The initial launch will not have a ZKP trusted setup. A trusted setup will begin once all known issues are fixed.
For a technical workshop video on our zkRollup AMM, you can see here.
Loopring is a protocol for scalable, secure exchanges & payments on Ethereum using zkRollup. You can sign up for our Monthly Update, learn more at Loopring.org, or check out an exchange/payment app at Loopring.io.