Layer 2 solutions are an exciting answer to the common question of “how can you participate in web3 without having to spend exorbitant fees?”. In this tutorial, we’ll go over one of the simplest steps you can take to start interacting with L2 chains: swapping tokens on Uniswap.
Main steps include:
Optimism is an EVM-compatible Optimistic Rollup chain that is designed to be a fast, simple, and secure scaling solution for Ethereum (we’ll give you the cliff’s notes version of some of those terms in a second). Essentially, Optimism is one solution to the question of “How do we get as many people into web3, without skyrocketing transaction fees?”, by using an L2 solution like Optimism, you’ll gain access to negligible gas fees, almost instant transactions, and a more accessible experience out of the box. Oh, and did we mention they’re becoming a DAO soon?
Similarly, Arbitrum One is a suite of Ethereum scaling solutions that enables low cost smart contracts while keeping the bulletproof security Ethereum is known for. They use a similar concept to Optimism in terms of how they process your transactions, with a few differences in the technicalities here and there.
Of course, this is just an oversimplification of how these platforms operate, and the value they offer to you as a user. But for now, suffice it to say they’re both efficient layer 2 solutions with Optimistic Rollups.
Woah, that was a mouthful, wasn’t it? Here are some key definitions to get you up to speed on the terminology:
To solve the problem of high transaction fees, the concept of a second-layer blockchain was invented to send your transactions through in a more data (and budget) friendly way. As long as the chain you’re using is EVM compatible, you can take advantage of all the perks of Ethereum, while paying a fraction of the gas costs.
The top dog in Ethereum Decentralized Exchanges (and expanding into several other chains), Uniswap is a DeFi protocol allowing the entire multi-coin ecosystem to function. In it, you can swap your tokens and coins, pool liquidity to boost the engine running web3, and much much more. Basically, if you want to interact with web3 through a token like ETH, MATIC, APE, etc; there’s a very good chance you’ll go through Uniswap first.
What separates this platform from centralized exchanges such as Binance and Coinbase is that the protocol is entirely run by immutable smart contracts on Ethereum, that is, they’re completely decentralized. There’s absolutely no one in between the ETH you want to swap, and the pool willing to grant you some USDC in exchange (Liquidity Providers, or LPs for short).
If you want to learn more about LPs, we recommend you read our quickstart guide on providing liquidity on Uniswap with Optimism/Arbitrum.
Arguably the biggest advantage of using Layer 2 solutions is the much lower bridging fees. While sending your tokens to other chains could cost you a pretty penny depending on the occasion, bridging your tokens from Ethereum to Optimism and Arbitrum can be much more budget friendly. So, knowing that your good old ETH will work perfectly on L2s, how about we bridge some of it over to whichever you choose? (the process is basically the same for both options)
First, go to chainlist.org, search Optimism and Arbitrum, and add them both to your Metamask wallet in order to switch chains easily.
Now enter app.hop.exchange and send some ETH over to Optimism or Arbitrum, you’ll notice the transaction fees are remarkably lower than bridging over to side chains like Polygon (Even though Hop also allows you to send funds over to MATIC for a much lower fee).
Give it a few minutes while the bridging transaction is validated, once submitted it should take no more than half an hour at most.
Done! Just switch your Network through Metamask and you’re ready to interact with the L2 you sent ETH to.
Picking up right where we left off, you’ve just switched your network to Optimism/Arbitrum. You can make sure by checking the upper right corner of the Metamask widget.
Head over to app.uniswap.org and connect your wallet if you haven't done so yet. It should automatically detect which network you’re interacting from.
Pick the token pair you’d like to swap between from the drop down menu and set the amount of ETH you’d like to exchange (make sure the swap is enabled in Uniswap’s interface, and that the token you're trading for is from a verified source).
If prompted to do so, grant Uniswap the permission to swap between your selected token pair.
After selecting your token pair, and allowing Uniswap to do the exchange, just click the swap button and confirm the transaction from your wallet
Congrats! You just got your feet wet in the L2 ecosystem by swapping tokens on Optimism/Arbitrum! Just add your new token to Metamask to keep track of your balances, or try your hand at providing liquidity on a pool you like.
Here’s the TL;DR version in case you want a refresher:
And just like that, you’re one step closer to becoming an experienced user of web3 by experimenting with some of the most interesting solutions coming up in our ecosystem.