Loopring’s New Relayer Added AMM Support

Daniel Wang
Loopring Protocol
Published in
2 min readOct 14, 2020

On October 9th, our team successfully submitted zkRollup AMM join, swap, and exit transactions on Ethereum’s Goerli network.

A few example transactions:

About Loopring’s AMM Design

An AMM swap circuit is now part of Loopring 3.6. The circuit implemented the Balancer curve:

Where

  • t ranges over the tokens in the pool;
  • Bt is the balance of the token in the pool;
  • Wt is 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. More all about Loopring 3.6 here.

As part of a native zkRollup implementation, Loopring’s AMM swap transactions will be super-efficient. We’ll share more details later.

Next Steps

  1. We are optimizing our smart contracts to minimize the gas cost per pool join/exit transaction. This is likely to finish within a week.
  2. We’ll improve test coverage to make sure liquidity providers can withdraw money in all scenarios, including exchange shutdown.
  3. 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.

TwitterDiscordRedditTelegramGitHubDocs YouTube

--

--