What Is dYdX?
A Step-by-Step Guide to the Leading Decentralized Exchange
By: Rahul Nambiampurath •DeFi Explainers
DYdX is a decentralized exchange (DEX) hosted on Ethereum that enables the swap of at least 36 cryptocurrencies without know-your-customer (KYC) identity verification. The exchange is also one of the rare platforms to offer perpetual margin trading, allowing traders to fund only a portion of the trade instead of the entire value of the trading position.
But is dYdX truly decentralized? In the DeFi spectrum, dYdX falls somewhere in the middle.
dYdX Origin and Purpose
Antonio Juliano, a former software engineer for Coinbase and Uber, started the dYdX project in mid-2017. His goal was to create an open-source, community-governed derivatives exchange. Although this was in a surging ICO bubble period, Juliano opted to raise funds through token sales.
Instead, dYdX received a $2M investment from the venture capital firm a16z. In subsequent rounds, the exchange raised $87M.
dYdX’s total-value-locked (TVL) and funding history. Source: DefiLlama
Up until August 2020, dYdX was hosted on Ethereum. This was problematic given Ethereum’s volatile gas fees that increase with traffic. To overcome this scalability problem, dYdX moved to StarkWare Layer 2 network, which provided a transaction boost and low transfer fees.
In August 2021, the exchange launched its native governance token DYDX and airdropped it to loyal users. The team also set up the dYdX Foundation to connect users and developers.
What Is dYdX?
dYdX’s main focus is to provide derivatives trading, in addition to spot market trading for cryptocurrencies. Thanks to limit and stop-loss orders, traders can customize their trading experience.
For instance, if a trader sets a stop-loss order at 5% under the coin’s price, the market position is automatically closed to prevent further losses.
At first glance, dYdX doesn’t look that different from a typical cryptocurrency exchange. The trading is supported by an asset’s order book, charting with indicators, and selected market positions, which can be spot-based or leveraged.
Spot-trading is buying or selling assets at their market prices. Margin trading amplifies one’s market position with borrowed funds. This means that the position is leveraged because it is boosted with extra capital for greater gains.
Likewise, there are greater losses involved if the market’s position goes against expectations. For this reason, margin trading is considered exceedingly risky. For example:
- A trader opens an Avalanche (AVAX) long position worth $1,000, which means the expectation is for the price of AVAX to go up. If the price goes up by 5%, the trader gets $50.
- But, if the same position is amplified with extra buying power, increased by “Margin Usage” percentage, the gains would increase as well. For a 200% margin boost, the gain would then be $100, because the open long position would’ve been increased to $2,000.
What Is DeFi Lending?
A Step-by-Step Guide to One of the Most Popular Practices in CryptoThe Defiant
Nevertheless, if the price of AVAX goes unexpectedly down, the loss is heavy, dipping beyond the initial investment. dYdX provides a way to maintain the funding of the positions with its cornerstone product — perpetual futures trading.
Instead of having to fund the full margin when the position expires, perpetual futures can keep funding either short or long positions with a fraction of the margin’s value. This is expressed as perpetual (perps) funding rate, updated on an hourly basis.
If the funding rate is in the positive percentage range, it means that longs are paying shorts. This indicates bullish momentum because the perpetual price is over the asset’s spot price. Vice-versa, if the funding rate is in the negative percentage range, it means shorts are paying longs, as a bearish momentum.
This exchange happens directly between traders, peer-to-peer. Therefore, traders with open positions for perpetual contracts either win or lose funds, providing opportunities to collect them. Typically, traders commit long positions for Bitcoin and Ethereum, as shown from the platform’s metrics dashboard.
StarkWare: dYdX’s Underlying Technology
On Nov. 1, 2021, dYdX abandoned Ethereum’s spot and margin trading services, leaving for faster trading pastures on StarkWare. This Layer 2 scalability solution uses ZeroKnowledge (ZK) rollups to speed up transactions and lower fees.
While this performance is beyond the capabilities of Ethereum’s main chain, dYdX still uses Ethereum to finalize transactions as added data blocks. STARK stands for Scalable Transparent Arguments of Knowledge.
How Does dYdX Provide Liquidity?
Anyone using a DEX vs. a centralized exchange (CEX) notices a performance difference. In a DEX, users themselves provide liquidity by depositing tokens into a liquidity pool, run by smart contracts. By tapping into them, users then swap tokens and trade.
Consequently, it could happen that some liquidity pools are not properly funded, creating a backlog of unfulfilled orders. In contrast, CEXs like Binance have deep liquidity that cover for all trades. Seeing this problem, dYdX is using a hybrid model in which on-chain transactions are paired with an off-chain matching engine.
In other words, while AMMs found in DEXs like Uniswap use probabilistic trade matching, dYdX uses deterministic matching and settlement. For that to happen, dYdX has its own API for market makers to plug into the platform’s order book to cover the trading spreads for a small cut.
DYDX is the platform’s governance and utility token. Out of 1B maximum DYDX, only 7% is in circulation, as of October 2022. DYDX token holders gain voting rights, proportional to their holdings. They can then vote on tweaking trading fees, partnerships, upgrades, and other protocol developments.
As a utility token, DYDX is used to pay trading fees and staking earn yields. This serves as a liquidity redundancy layer for extreme market conditions. Nonetheless, dYdX offers additional stability by staking USDC stablecoin in either the platform’s safety or liquidity pool. The resulting staking rewards generate DYDX tokens.
Every 28 days, traders also earn DYDX rewards proportional to paid fees, which are then divided by all fees paid by traders during that period.
Is dYdX Really Decentralized?
When the U.S. Treasury’s Office of Foreign Assets Control (OFAC) sanctioned Tornado Cash privacy protocol, dYdX was one of the first platforms to start blocking user accounts. This means that even if someone had never heard of Tornado Cash, but was sent funds through the coin mixer, they could have had their account blocked.
With that said, because dYdX is not in the custody of user funds, it cannot seize them. Furthermore, one should note the platform’s attempt to use biometric tracking to tie users’ wallet addresses to their real identities. The jumping point was dYdX’s referral reward program, by which users could get 25 USDC for bringing in traders who have deposited 500 USDC.
Nonetheless, the platform is still in the process of being decentralized. By the end of 2022, the V4 upgrade should take away the company’s control and turn it completely over to the community.
This series article is intended for general guidance and information purposes only for beginners participating in cryptocurrencies and DeFi. The contents of this article are not to be construed as legal, business, investment, or tax advice. You should consult with your advisors for all legal, business, investment, and tax implications and advice. The Defiant is not responsible for any lost funds. Please use your best judgment and practice due diligence before interacting with smart contracts.