Offchain Labs
Published in

Offchain Labs

Arbiswap: our port of Uniswap V2 on Arbitrum Rollup

tl;dr: An easy port. 55x cost reduction with more to come. Try it today!

Earlier this month, we announced the new Arbitrum Rollup testnet, a full-featured Optimistic Rollup that allows anyone to instantly deploy L2 contracts. Today, we’re showcasing just how awesome Arbitrum is by porting one of Ethereum’s most popular dapps. Enter Arbiswap: Uniswap V2 running on Arbitrum Rollup’s testnet.

Go ahead and try out Arbiswap. For convenience, we’ve included a faucet that will send you tokens directly on the Arbitrum chain, but if you already have ETH or some ERC-20 tokens on Kovan, you can also use Arbiswap with those. Once you’ve completed a swap, head over to the Arbitrum Rollup block explorer to view your transaction and learn about its gas usage.

Scaling Benchmarks

Swapping tokens on Layer 1 Uniswap costs about 109,500 gas; at 10 million gas per block and roughly 1 block per 13 seconds. This means Ethereum layer 1 can handle, at absolute most, 7 Uniswap-swaps per second.

Enter Arbiswap: with the Arbiswap Rollup chain at full-capacity, the Layer 1 gas cost reduces to 1965 gas per swap; this means L1 can handle up to 390 swaps per second, a 55x gain in gas efficiency for the base layer!

But we’re not done yet. In the next Arbitrum testnet release, we’ll add support for BLS signatures, and additional compression features, that will reduce the gas usage by an additional factor of two or so.

What’s included?

This is not a proof of concept, or something that looks like Uniswap. This is a complete, fully functional Uniswap V2 in all of its glory, running on rollup (plus some added glory since it’s in L2). We took the Uniswap codebase and ported it wholesale to Arbitrum.

Token bridge. A key component of any Rollup chain is the ability to transfer tokens from Ethereum into the Rollup chain and back again. If you can’t do this, Uniswap (or any DeFi app) will not be very useful as you won’t be able to use it to exchange Ether or any ERC20 token.

Arbitrum ships with a user-friendly token bridge that facilitates transferring assets between Ethereum and the Arbitrum Rollup chain. To make things even cooler, we integrated the token bridge directly into the Uniswap UI. In our demo, you’re able to exchange real (testnet) ETH on Uniswap, and in fact you can port any token you like onto our demo, and it will work. No fancy sleight of hand here. It just works!

Wallet support. We’re also excited to announce that we’ve added new wallet integrations. Arbiswap works with three wallets: Metamask, Fortmatic and Portis. We thank the teams at Magic and Portis for their support, and we’re actively working on adding support for other wallets as well. Stay tuned for upcoming announcements.

Your app next!

So the Arbiswap demo was cool, and you want to port your app to Arbitrum. But surely you have some questions.

How complicated is it to port my dapp to Arbitrum?

It’s not complicated at all! It’s as easy as changing your RPC endpoint to https://kovan2.arbitrum.io/rpc.

Do I need to rewrite large parts of my codebase?

No! You don’t need to make any changes to your code.

Where can I download the Arbitrum tooling?

You don’t need to download any new software to deploy contracts on Arbitrum. You don’t even need to recompile your contracts.

Wait, I can use my existing Ethereum dev setup?

Yes! Arbitrum supports Solidity, Vyper, Yul and any EVM language as well as Ethereum developer tooling such as Truffle, Hardhat, ethers.js, and The Graph, and more.

What if I get stuck?

If you run into any issues, drop us a message on Discord. We’re here to help!

I wanna play with Arbiswap and start building on Arbitrum. Can I go now?

Definitely. We’re surprised you made it this far.

Arbiswap: https://swap.arbitrum.io/
Developer docs: https://developer.offchainlabs.com/docs/Rollup_basics/
Testnet landing page: https://arbitrum.io/testnet/
Block explorer: https://explorer.offchainlabs.com/#/
Community: https://discord.gg/ZpZuw7p

Arbiswap is a demo made by Offchain Labs built with Uniswap’s open source code, but not affiliated with Uniswap, the company. We welcome the Uniswap community to try Arbiswap and launch an instance of Uniswap on Arbitrum’s upcoming mainnet.

--

--

Creating Arbitrum, an Ethereum scaling solution

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store