How to trade on the dYdX rollup
Dear Bankless Nation,
We said yesterday it’s Coinbase week…but it’s also Layer 2 week!
We’re dedicating the next few days so we can level up on all things Layer 2 and some of the cool things we can do today.
So today we’re diving into dYdX and their recent StarkWare integration. The scaling upgrade opens up a new world for traders—like zero gas costs, significantly lower trading fees, and even lower minimum trade sizes.
While it’s still in the early days for these scaling solutions, they’re already showing promise.
In just one week, dYdX integrated perpetual swaps for five major assets (ETH, BTC, LINK, AAVE, UNI), surpassed $70M in weekly volume, and $15M in open interest.
All while traders have paid $0 in gas fees.
Yup…this is game changing stuff.
Let’s explore the future of DeFi.
P.S. Watch out recent show w/ the founders of dYdX and Starkware to learn more.
Watch Episode 42 of State of the Nation 🔥
📺 Watch State of the Nation #42: Ethereum Devs Building DeFi | Preston Van Loon & Will Villanueva
We premiere State of the Nation on YouTube every Tuesday at 2pm EST—join us!
How to trade on the dYdX rollup
dYdX launched an alpha for perpetual trading on Layer 2 (L2) back in February. After extensive testing, it’s finally now live for the public.
Trading on dYdX’s L2 enables gas free trading while maintaining the same security guarantees of Ethereum we all know and love. Additionally, users can now trade perpetuals on dYdX with up to 25x leverage, cross margin, and lower fees than before.
There’s plenty more trading pairs in the pipeline but current markets on L2 include ETH, BTC, UNI, AAVE, and LINK. Notably, dYdX’s trading platform is also mobile compatible, allowing you to trade on-the-go via web3 wallets such as Metamask and imToken.
In this tactic, we’ll cover how to set up your account, deposit USDC, and complete your first trade on dYdX’s Layer 2 perpetual product.
- Goal: Get started trading perpetuals on Layer 2
- Skill: Beginner
- Effort: 10 Minutes
- ROI: No Gas Fees on trades!
🚨 Disclaimer: Leverage trading is risky and not recommended for beginner traders. Please rationally judge your investment ability and make decisions prudently once you’re well informed about how Perpetuals work. dYdX Perpetual Markets are not available in the US.
Add a 10% discount on trading fees to your wallet!
Don’t know how to add the code? Watch this video 👇
The Journey to Layer 2
dYdX is a leading decentralized exchange focused on expanding perpetual markets within DeFi with the goal to give traders the best in class tools to help them better manage risk across a variety of assets.
dYdX’s Layer 2 was launched in collaboration with StarkWare. For anyone unfamiliar, StarkWare zkSTARKS technology is a form of ZK-Rollups that significantly increases trade settlement capacity, while still basing its security on the underlying Ethereum blockchain.
For those new to ZK-rollups, they’re a type of Layer 2 scaling solution which bundle, or “rollup,” transactions into a single batch which is then posted to the Ethereum blockchain alongside a proof attesting to the validity of the bundled transactions.
After conducting extensive due diligence on the Layer 2 ecosystem in 2020, dYdX chose to build with StarkWare as the solution was both already battle-tested in production, provided the best trading experience for our users, and was able to be live in the shortest amount of time.
Now, after months of testing, dYdX’s L2 launched on mainnet, providing traders with near-instant settlement and gas free trades. This is a huge step forward for traders dealing with the current gas fee environment that are eating into profits.
As such, let’s dig deeper into what this launch provides and how you can capitalize on the opportunity.
What this means for traders
Here are some highlights on what the StarkWare integration enables for traders:
The massive improvement in scalability allows dYdX to pass on a significant amount of savings to traders through reduced trading fees on all fronts. As mentioned, the best part here is that you no longer have to pay gas fees while trading—this means more profits for traders!
Instant Trade Settlement
The combination of StarkWare’s Layer 2 and dYdX’s off-chain matching engine allows all trades to be executed virtually instantly. It’s feels like your trading on a centralized exchange!
Reduced Minimum Trade Sizes
Given the significant costs reductions, there’s now decreased minimum trade sizes, allowing traders to trade on dYdX with less capital than ever before. More on minimum trade sizes can be found here.
As mentioned, not all transaction details are published on-chain with ZK-Rollups. Instead, it’s just the balance changes. As a result, privacy is massively improved as details surrounding proprietary trading strategies or trading activity are kept under-wraps.
Cross margin allows users to trade on multiple Perpetual markets under one margin account. This dramatically increases capital efficiency and a much simpler trading experience for everyone. Taking this a step further, traders will be able to convert most ERC-20 assets to USDC collateral through the 0x API, and then trade all of the markets dYdX offers in that same account.
Higher Leverage & Lower Liquidation Penalties
While not mentioned in this tactic, dYdX’s Starkware integration features improved price oracles. As a result, liquidations now occur much faster and more safely, meaning traders have access to higher maximum leverage as well as lower penalties if they’re ever liquidated.
Perpetuals on dYdX are cross-margined in USDC. That means after depositing USDC into the protocol, users can trade any asset that is listed from a single pool of deposited collateral.
Markets available to trade on Layer 2 today include:
- ETH-USD (up to 25x leverage)
- BTC-USD (up to 25x leverage)
- LINK-USD (up to 10x leverage)
- AAVE-USD (up to 10x leverage)
- UNI-USD (up to 10x leverage)
In the near future, dYdX will be listing more markets with the goal of becoming on par with centralized exchanges in terms of the number of perpetuals offered.
We also re-built our UI from the ground-up, focusing on what traders are most interested in as well as ensuring that our product experience is just as good on mobile.
How to use the dYdX rollup
Using the dYdX rollup involves a few steps. The first is migrating capital from Ethereum main net to the StarkWare ZK-Rollup. Here’s how:
Don’t forget to add the Bankless 10% off trading fees discount to your wallet!
- The next step is generating a stark key. This step creates a unique private key that is generated using your Ethereum address’ signature. As a result, this key is unique to you and can be regenerated as long as you have access to your Ethereum wallet!
- Next you’ll need to create an account. Here you can create a username and connect an email address for future dYdX updates and account notifications. We’d like to note that creating an account will ask for an additional signature (no on-chain transaction).
- After you’ve created your account, it’s time to enable Layer 2. This step registers your account on-chain and a one time on-chain transaction is needed to onboard onto the rollup.
- Finally, it’s time to deposit USDC. Remember that you’ll need to approve the USDC contract as well as deposit it into dYdX. This step will create two additional on-chain transactions.
Once your deposit is confirmed (10 block confirmations), your USDC will be in your account on Layer 2 and you’re ready to trade. Here’s what you need to know:
Trading on the dYdX rollup
- Once your USDC is deposited, you can now select a market you’d like to trade in the left side panel.
- Determine if you want to Buy (go long) or Sell (go short). dYdX has a variety of order types but for this tactic we will focus on market orders since its the easiest.
To make a market order, select “market” and choose the amount you would like to Buy or Sell.
You can also use the leverage slider to determine how much leverage you want to use, which will then fill-in the trade box for you. Before you place your trade, the “Account” box will show your buying power, equity, margin usage, and account leverage after placing the trade. Additionally, the page will pre-populate what your position and leverage for that market will be in the Position box.
- Once that’s all done, you can complete your trade by signing the transaction. Since you’re on L2, transaction settlement should be near-instant and will cost you zero gas fees!
Closing out your position
- Closing a position in super simple. All you have to do is click “close position” in the position box and you’ll be prompted to close out.
6. In the trade box, confirm the details of the trade and click close position once more.
🧐 Portfolio Overview: If you’d like to view your trade and transfers history, open positions, and overall portfolio, just head to the Portfolio page! You’ll get a full scope on all of your current and past positions.
Congratulations, if you made it this far you are ready to start trading on dYdX. The new StarkWare integration opens up a world of new possibilities when trading perpetual swaps and other derivatives.
Whether it’s reducing costs across the board and passing it on to traders, better privacy, opening up the minimum trade size and more, it’s becoming clear that Layer 2’s offer a viable scaling solution for Ethereum today.
Welcome to the future of DeFi.
- Trade perpetual swaps on dYdX’s Layer 2 (at your own risk!!)
- Explore dYdX’s Starkware integration