Starkware x dydx in-depth dialogue: Layer2 and derivatives
On April 22, we co-hosted a live AMA with StarkWare's Ohad Barta and dYdX's Brendan Chou. Ohad and Brendan discuss the following:
Their background and experience entering the crypto industry
Why dYdX migrated to Layer 2
Reasons why dYdX chose StarkWare as a partner
How StarkEx Works and Different Data Availability Models
Centralized and decentralized parts of the chosen technical architecture
StarkNet and future plans and vision
Nuances on the Stark Key and how it is used in Layer2 systems
Oracle Performance on Layer 2
Comparison of ZK Rollup and other Layer2 technologies (such as Optimistic Rollups/ZkSync)
The relationship between spot and derivative products
The following is an edited transcript of the interview:
The following is an edited transcript of the interview:
David (dYdX): Thank you for your participation. I'm David Gogel. I am part of the growth team at dYdX. I'm so excited to have Ohad from StarkWare and Brendan from dYdX today. We will discuss some questions from the community, and we will discuss the technical implementation of dYdX StarkEx's cross-margin perpetual contract powered by StarkWare. Brendan, Ohad, can you guys share your background and how you got involved with dYdX and StarkWare respectively?
Brendan: My profession is a software engineer. I graduated from Princeton University and worked for large software companies such as Bloomberg and Google, where I learned some job skills, how to program, and how large companies work. At the same time I was looking for something different. I was Antonio's roommate in college and he went to Coinbase right out of college, so I always asked him to explain to me what Bitcoin is and how it works, but I never quite got it. I started working on more things at the height of 2017.
I know he is starting his own company. We got together every year for New Years with all the former roommates and we talked during that time and that's when I decided to join. I was in New York at the time, and I realized that if I could just step up and do this crazy crypto thing, it would definitely benefit me. That's how I got into the industry.
David (dYdX): Ohad, how did you join StarkWare
Ohad (StarkWare): I have known Eli Ben-Sasson, one of the co-founders of StarkWare, since 2011. I wrote part of the first edition of PCP Prover and Verifier for him, which are older versions of STARKS and SNARKs in use today. I then spent six years gaining programming experience in Israeli intelligence. Later I got my MSc in Cryptography with Professor Yuval Ishai, we had a thesis in Cryptography last year. Afterwards, I contacted Eli and asked him how things were going with StarkWare. After seeing how mainstream proof systems have become over the past six years, I decided to join Eli.
David (dYdX): A few weeks ago, dYdX publicly released cross-margin perpetual contracts on Layer 2. Brendan, can you provide more context on why dYdX decided to move to Layer 2, and the advantages of the new Layer 2 product over Layer 1 products?
Brendan (dYdX): there are many reasons. The most important part is the order execution part. Previously, this was an Ethereum transaction to settle every transaction on the chain. This also presents some challenges. First, it is not instant and can be preempted. This creates some uncertainty for everyone = you have to wait for a block to be mined for your transaction to go through.
Also, our own transactions cost a lot of gas. It's a waste of our money and it's not sustainable for us. We had to subject users to higher fees or higher minimum transaction amounts and things like that. As Ethereum scales or the number of users expands, this does no one any favors. So I think that's our main motivation, the order execution part.
Another issue we see at Layer 1 is the speed of getting oracle prices on-chain. When the price changes sharply and the gas cost rises, the price of the oracle machine is reported to Layer 1 much slower, which brings some additional risks to users. Therefore, we must punish liquidated users by providing lower leverage and a more aggressive liquidation system, which also costs a lot of Gas, is slow, and contributes less to the security of the entire system. So I think that's the main factor we're looking at, we're going to move to Layer 2 for more instant finality, which will lead to a better experience and lower fees.
David (dYdX): Why did you choose StarkWare as a partner to develop Layer2 systems?
Brendan (dYdX): What we want is rapid development and hope to release the product in a certain few months in the future. So we want to remove more risk and work with people who have been on mainnet for a while. StarkEx has been working with DeversiFi with a lot of success, getting great word of mouth from the people we talked to. So I think those are the main influencing factors.
David (dYdX): Ohad, can you briefly explain what is StarkEx and how does it work?
Ohad (StarkWare): StarkEx is an expansion solution provided by StarkWare for applications on Ethereum. It takes a sequence from a sequencer (dYdX in this case), runs them internally, and makes sure everything checks out and makes sense. Then, it moves the transaction to the Cairo program. Basically, a Cairo program can represent any statement (it is Turing complete). The Cairo compiler compiles Cairo programs, which are then converted into STARK proofs by our prover. We then send this on-chain proof to the validators for verification. If the verifier accepts the proof, the proof is valid. Therefore, we can achieve accurate instant settlement.
David (dYdX): Can you describe the different models of StarkEx and their trade-offs?
Ohad (StarkWare): For Validium, we don't publish them via state, this is because doing so is very expensive: even if it costs only a fraction of the actual execution of the transaction, it is still non-negligible and scales linearly with the number of changes . Instead, we say, "Okay, we have this trustworthy server council." That's the approach DeversiFi and Immutable have taken, with several respectable council members. In this approach, as a condition of signing off, committee members must demonstrate that they all know all relevant data that a user might use in the event of an operator failure. In ZK-Rollup, we publish new balances on-chain every time we update. Therefore, users have more trust in the system, but the cost is also higher.
David (dYdX): Brendan,dYdX's StarkEx implementation is ZK-Rollup, not Validium. Can you describe your thought process for why ZK-Rollup is a better model for dYdX?
Brendan (dYdX): Actually, we don't have any particularly strong thoughts about it. I think Ohad describes the tradeoffs well there. It just makes the data available to everyone, but at the cost of publishing it requires more gas to do so. So we decided to keep it on-chain for now and roll it up because we felt we could afford the gas. Currently, we are not passing the gas cost on to the user. So there is no gas fee during the transaction. Assuming the price of ETH continues to rise or the network usage increases, then we can in the future remove the part that publishes all the data to the chain, and then maybe bring in some additional committee members to verify that the data is stored in multiple different locations and can be used. Used by multiple different participants, so users do not lose track of the actual current balance on-chain. As Ohad mentioned, this is important. If they need to basically prove the position they have and get out of the system.
But that's just the way forward, because if it's too costly to do that, then, as I mentioned, if ultimately those costs have to be passed on to users, to the community, to other users, that's where we can put more data into Off-chain, saving more gas fees for everyone.
David (dYdX): With the transition to Layer 2, people can see less data in block explorers. Ohad, can you describe the data available to users on Layer1?
Ohad (StarkWare): The data that can be viewed on Layer1 is the balance of all users, including synthetic assets and funds index: , this information can know how much funds we really have when the last batch is received. The transactions themselves are not published on-chain, both to save costs and to keep the trading strategy private.
David (dYdX): As a user, how can I trust that the transaction data kept outside Layer1 is actually correct? What mechanisms are in place to ensure the validity of everything that happens off-chain?
Ohad (StarkWare): Before discussing StarkEx, I said that all of this is based on the Cairo program, which is the center of everything. So what happens is, the Cairo program will get the order of the transactions. In addition to the commitment to the new state output, it also adds any position balances that changed during the batch. And this output is linked to the proof. If you can't show me the transaction with on-chain data, then the proof won't be accepted.
David (dYdX): This answer is really super helpful! Ohad, can you provide an update on the status of StarkNet and its vision?
Ohad (StarkWare): Maybe I'll start with StarkNet, since we've only discussed it at StarkEx so far. StarkEx is cool. It does help you now, but not enough in the long run. The reason why it is not good enough in the long run is: currently StarkEx needs operators to operate, which is not good from a centralization point of view, technical and regulatory point of view. StarkNet means putting all Cairo programs and Prover/Verifiers at the center of StarkEx, rather than working with a sequencer that will only build a complete sidechain, where every Each block will be proven by comparison with Cairo, and then the proof is as we prove today, even using the same verification procedure as today.
Of course, this will take some time, so we do it in steps. Therefore, at the end of May, we will publish a demo on StarkNet's Ropsten that will allow writing custom contracts. Take the AMM contract as an example, but it does not yet allow Layer1 to Layer2 interaction. Then, a few months from there, we'll start scaling StarkNet to allow interactions between contracts and between Layer1 and Layer2.
Then, the next thing we do is the decentralization of the operator. So we will indeed have a full sidechain of miners and everything, not just a sequencer that sorts all the smart contracts submitted by users.
David (dYdX): Brendan, As part of the onboarding process on dYdX, users connect their Ethereum wallets and make transactions. But for the first time, users must create a Stark Key. Can you describe what Stark Key is and how it works on dYdX?
Brendan (dYdX): Basically, it's similar to an Ethereum private key. It's just a cryptographic method of verifying that everything you sign comes from your private key. You have to use a different private key or a different elliptic curve to sign something compatible with the STARK system. I don't have too many technical details. Ohad should know more about this than I do. But essentially it's just another key for everything you want to keep track of.
We don't want the user to have to remember yet another complete private key. They are used to protecting their Ethereum keys. We don't want them to have another thing to keep, and if they lose it, that's bad. We came up with a system that allows them to use their existing key to derive it. This is basically from hashing their fixed signature, as long as they have the Ethereum private key. So, as long as they have their Ethereum private key, they can never lose their Stark private key.
This is really useful because, as I mentioned, they don't have to keep track of two things. And similar to how you can't really forge someone's Ethereum signature or find a hash collision, their private Stark key is also very secure.
David (dYdX): Do I have to protect my Stark key like I protect my private key? If someone can get my Stark key, can they get access to my funds?
Brendan (dYdX): This is a very complicated question. Yes, you should absolutely keep it a secret. I was just thinking about the worst thing people could do, I think in this case they might sign the order on your behalf. However, if that's all they have, then even if they withdraw your funds to Layer 1, they cannot remove those funds from the contract. They still need your Ethereum keys to do this. Also, on our side, we also have API keys and secrets to prevent people from doing these things without explicit permission.
Also, if only your Stark key is compromised, on the dYdX side we still won't accept requests unless you also have an API key. An API key is another small set of private keys, which can also be derived from your Ethereum private key. So if you have Ethereum private keys, at least you can have those too. All three keys are derived from Ethereum private keys. So it would be bad if someone took your Stark private key, but there are still plenty of security mechanisms to keep someone from wreaking havoc in there.
David (dYdX):Ohad, can you describe which hardware or software wallets currently support Stark Keys?
Ohad (StarkWare): Currently, the Ledger wallet natively supports Stark Keys and StarkWare's apps, as well as several other wallets. I believe Authereum supports it, despite being deprecated recently. For any other wallet, we have a javascript library that requires the wallet to be signed with an ethereum key, and from that signature a stark key is derived, as Brendan mentioned. This is how MetaMask and all commonly used wallets currently work. We plan to add more wallets so that they support Stark Keys natively. This is the goal we have been pursuing. With more and more projects like yours going on, I think this will happen soon.
David (dYdX): After the flash crash of the cryptocurrency market last weekend, there was a lot of buzz. StarkWare published a blog post about the price of oracles on Layer 2, which seems to be a big problem on other DEXs. Brendan, How does the StarkEx implementation of dYdX use Oracle prices? How is it different from Layer1Oracles?
Brendan (dYdX): So right now we are only using Chainlink oracles. We are also communicating with several other oracle projects to see if some cooperation is needed. As I said dYdX is looking to grow fast, and to Chainlink’s credit, it’s able to provide us with a ton of different trading pairs and support for Layer2 keys or Stark keys.
Currently, we only work with one oracle project that sends us encrypted and signed prices. We are able to cryptographically tell them that they are from the signer or someone whose private key we trust. We then aggregate them and use the median value, which becomes the price for the Layer 2 oracle. All prices are timestamped and whatnot and the name of the asset. Aggregate them together, and come up with a median of some quorum, and that's how we do it on Layer2. This is very similar to the pattern of many oracle projects that you have seen on the Layer1 network.
Our approach is similar to aggregating all signatures in batches without requiring all transactions to be packaged on the Layer1 network, except that every oracle machine is not required to send transactions. They can go directly into the Layer 2 block and finally go to the chain when the entire block is packaged and released.
David (dYdX): Ohad, can you describe what happened over the weekend and how Layer2 oracles helped dYdX maintain pricing?
Ohad (StarkWare): Last weekend, the price of Ethereum fell by 20% in a short period of time. The biggest advantage of dYdX over other decentralized exchanges is that we constantly get all the prices from the Chainlink oracle, and can react to price changes in real time without having to wait until the chain accepts the transaction. After we get the price from Chainlink and spend it, we can send subsequent transactions through that price again without waiting for something to happen off-chain.
This is what makes dYdX work. We did more than 1000 liquidations in 1 hour, which is impossible on the Layer1 network, because many of our competitors are also sending transactions at this time. So, that's why less latency can improve system stability.
David (dYdX): Ohad, can you describe the current role of ZK validators? What are the future plans for decentralizing this technology stack?
Ohad (StarkWare): Of course, StarkWare is currently running a verification program. The verifier obtains the Cairo program from the StarkEx component, generates a proof, and then sends it on the chain. I'm sure that in StarkNet proofs will be decentralized in some way, but since this is the last step StarkNet will be doing next year, I can't really commit to how we're going to do it.
David (dYdX): From a user perspective, what is the risk to a demonstrator in centralized zero-knowledge proofs today? Can you censor my transaction? Is there any downtime for this proof? How does this affect the stability of the entire system?
Ohad (StarkWare): The verifier should be online in real time. We use the best services Amazon has to offer, and those services run 24/7. Even if something happens and they go down for a short period of time, it won't affect the system.
As for the censorship issue, this has nothing to do with the fact that the demonstrators are too centralized, but the fact that the ordering itself is centralized. Therefore, transactions may be subject to censorship. However, user withdrawals cannot be audited.
If you send a transaction through the system, and for some reason see that the system is ignoring you, you can submit a Layer1 request and withdraw it, or even trade your synthetic assets so that you don't have to pay a maintenance deposit for the synthetic assets you own. Using a series of such Layer1 transactions, you can completely shut down the system. And, if the operator chooses to also review those requests backed by Layer1 proofs, your user-reviewed system can now go to the Layer1 smart contract and tell him: "Look, my smart contract, it was time to withdraw the request a few days ago , but I'm still censored." And then: everything shuts down, and of course we've never had an interest in doing something like this.
David (dYdX): Brendan, how does the dYdX team think about maintaining non-custodial transactions on the Layer2 network? What tradeoffs did the team have to make relative to Layer1 networks?
Brendan (dYdX): As Ohad mentioned, now we are basically choosing the order of transactions, which is slightly different from Layer1 networks. Usually in a Layer1 network, miners will choose the person with the highest gas fee. It's a bit like we are the miners of each block. But as Ohad mentioned, there needs to be some safeguards that allow people to withdraw funds anyway, so you can't just censor all transactions.
People can agree to a transaction, send it back to the Layer 1 network, and we'll force it into a Layer 2 block. We must do the same if it is a request to submit a withdrawal. So as long as people can get their money back, we're going to have the same problem as the Layer1 network, which is still non-custodial in the sense that we can't steal funds, but at the moment, since everything is going into a more centralized Matching engine, we can choose not to allow certain traders on the system.
Therefore, we will continue to work on further thinking in terms of strategy, becoming more decentralized, especially in terms of order execution. I think the non-custodial nature is way ahead and more decentralized where order execution is tricky.
David (dYdX): Do you have any initial thoughts on decentralized order books and matching engines?
Brendan (dYdX): This is a difficult question, so I won't go into too much detail here. Usually, even in traditional finance, you see a lot of different kinds of trading systems. What we are using now is the order strategy. I know 0x and some other projects are using more of an RFQ system or request for quote system where you basically have someone give you a quote and then agree to it. This is a bit different from how orders work.
So it may be necessary to study this type of model more, and even Uniswap can do more AMM-type models to open up the situation. I think there are many different ways. I don't have anything particularly specific right now.
User: My question specifically concerns markets and how to add different assets. If I recall correctly, dYdX has Link, Uniswap, Solana and Sushi trading pairs. In the future, will dYdX find ways to involve the community in the choice of adding new items? Or is it continuing to be done in-house?
Brendan (dYdX): This is definitely something we want the community to get involved in, to give everyone more of a say. As an exchange, the most important goal is to allow people to trade what they want to trade. It's important to us to engage the community and give people a greater say in what they want to see. So that's definitely our top priority. I think maybe in the next few months, 2021, we want to give people more of a say in that.
David (dYdX): I would like to add that another benefit of migrating to Layer2 is that we can add more trading pairs faster. In the past 2 weeks, we added 4 new trading pairs. Our current goal is to add one to two trading pairs per week for the remainder of the year. By the end of the year, there are 30 to 50 perpetual contract trading pairs. The decision process around it is very focused on listing the tokens our users want to trade. Our assumption is that users want to trade top DeFi tokens and top Layer1 tokens. We always value the opinions of the community. If you have a specific trading pair you like, please feel free to share it with the administrator so as to provide us with a reference.
Brendan (dYdX): As for the other part of your question, it mainly depends on who is making the decisions now. It's basically the dYdX team's decision at the moment.
David (dYdX): There's been a lot of talk about different Layer 2 solutions, and recently zkSync released a statement about their vision for zkPorter that I think is very similar in some ways to StarkWare's Validium model. Ohad, what are your thoughts on zkSync? What is the vision for zkSync? How does it differ from StarkWare's goals?
Ohad (StarkWare): First of all, in order to make the zkPorter part clear, zkPorter is the idea of combining Validium and the ZK-Rollups method we discussed earlier. We called it "Volition" at StarkWare, and it was even discussed back in June 2020. We’re excited to see that some of our ideas are being adopted by others in the space, and will be live on many mainnets soon.
Overall, I think zkSync is somewhat close to what we've done from a technical point of view, they're another company offering proofs of general validity and scalability, at least from the next release, because Currently they only have transmission.
User: Sometimes find yourself with profit margins that sometimes exceed 100%. If the price is too high, I will not be able to close the position, because the closing operation will cause the margin to still exceed 100%. Is this intentional or a bug?
Brendan (dYdX): What we ultimately want is that as long as you are closing a position, it should allow it to pass through. There are multiple different validation steps throughout the process to allow this to happen, we basically don't want people opening positions above that limit, and even in some cases it could make the proof if we allowed it itself becomes invalid because we allow someone to take an invalid position.
But I think right now we might be overly sensitive to that, and we have a few places in the verification system where we need to stop. So I think we're asking people to go back to the original margin level now, but ultimately we do want to allow that. I think a couple of people have messaged us recently, so I think we might prioritize this. We do want to allow that to happen because especially I think people with large positions probably don't want to liquidate them all to get back below 100. Thank you for asking this question.
David (dYdX): Ohad, can you transfer funds between StarkWare's different solutions? Like, from DeversiFi to dYdX and back again?
Ohad (StarkWare): Assuming you mean some kind of untrusted or proven transfer, which we don't support yet. We intend to support it with StarkNet, which will provide application communication between contacts starting at the end of this year. In this way, these transactions will be easily realized.
David (dYdX): At some point, will users be able to move funds from one Layer2 application to another?
Ohad (StarkWare): If you consider a Layer2 application that StarkWare runs, then sure. I think, in the long run, we would also like to work with other Layer 2 solutions, but that's a long time frame.
David (dYdX): Ohad, can you describe at a high level some of the major tradeoffs between zk rollup and Optimistic rollup?
Ohad (StarkWare): Now a brief introduction to Optimistic Rollups, since we have only discussed zk rollups so far. In an "Optimistic Rollup", we make all transactions off-chain and then post the results on-chain. However, we don't issue proofs, so all transactions need to be checked and see if they find inconsistencies or instances of fraud, and if that's the case, they submit a fraud proof. For optimistic Rollups, this model has several disadvantages.
First, there is no finality, and it must be assumed that the user is monitoring the state, since it takes several hours for the user to dispute a state update. Intuitively, Optimistic Rollups make up for this by being cheap, because with them you don't need proofs.
But this is actually not true either, because for Optimistic Rollup, you have to submit all data on the chain, that is, all transactions that have been completed, when using ZK-Rollups, we can prove many, thousands of transactions with one proof Transactions (we will soon be able to attest to thousands of transactions in a batch for dYdX). So if you compare the amortized weight of a transaction in a proof to the cost of sending it on-chain with on-chain data, not only is zk-rollup more secure, it's also much less expensive.
For example, I think the disadvantage between StarkWare and Optimism is that optimism is easier to get started because it is EVM compatible. You'll still have to modify a few things when adding Optimism, but it's much less of a problem than removing Cairo. However, with the work on StarkNet, we hope that this shortcoming will no longer exist in the near future.
David (dYdX):Brendan can you describe your experience building in Cairo?
Brendan (dYdX): We didn't actually write the code for this in Cairo because StarkWare has more understanding and expertise in how it works. We've considered writing some Cairo contracts ourselves, but just for expediency, security and contractual correctness, we've basically worked with them to come up with a whole new logic system different from our L1, because we want Do similar cross-market margin system and so on. So basically working with them and coming up with the logic that needs to be coded.
And this time most of the contracts were written by StarkWare. So we worked with them to look at the current state of Cairo and give some feedback on how to improve it. But in this case, it's a StarkWare creation, so I can't comment too much.
David (dYdX):Ohad, what are your thoughts on StarkWare's strategy to get more projects on Cairo/Layer 2? StarkWare is working on a stable Cairo compiler, when will it be available?
Ohad (StarkWare): Currently, we are adding projects to StarkEx. We have enabled DeversiFi, dYdX, and Immutable since last June and hope to release several more over the rest of the year. We try to make joining StarkNet easy in a number of ways. Some of these might improve Cairo. A year ago, writing in Cairo was like assembly language, now it's more like writing C, maybe even simpler.
In addition, we also plan to compile from solidity to Cairo. We think this is just one of several things that make working with StarkNet easy, so that's yet to be determined.
User: I noticed that there are index prices, oracle prices, and mid-market prices. While there is documentation explaining the difference between the three, I'm still not entirely sure why an index price independent of the oracle price is needed. Do you have documentation or public information about the sources of information or oracles that these two price platforms get from different exchanges?
Brendan (dYdX): I'm not sure what's on the help page is exact, but essentially, we've discussed how oracle prices work better on Layer 2, but oracle quotes aren't yet accurate to the minute. As such, index prices are primarily hosted internally by dYdX, which serves two different purposes than oracle quotes, primarily because it is more efficient than oracle quotes.
The first is functions such as triggerable orders. So these are things like stop loss or take profit orders. So if you normally have a trailing stop or stop limit order, this will trigger the index price and not the oracle price. As I mentioned, that's simply because index prices behave much more efficiently. dYdX basically pulls prices from exchanges. Taking Bitcoin as an example, refer to six or seven spot exchanges such as Binances and Coinbase.
Another use of it is to determine the funding rate. The interest rate basically depends on whether the asset is trading above or below the index price. So the index price needs to be very precise because you're comparing the fast-moving order book to the fast-moving spot price on these exchanges. So things like index prices can be updated every second, every two seconds, but oracle prices usually don't update unless there's real volatility in the market.
If the price moves more than 25 pips, you may see the oracle's price be updated. But the index price is updated much more frequently than that, so it provides a better experience with stop limit orders, while also providing a more accurate funding rate. So, hopefully this is helpful, I think we plan to build the help section and make all of this information more accessible, as well as the exact exchange each trading pair is using.
User: liquidation depends on the price of the oracle, not the price of the index?
Brendan (dYdX):Yes
User: Why not just rely on the index price? Is it somehow protected against manipulation?
Brendan (dYdX): The oracle price is more secure. The index price is basically only maintained by dYdX itself. So basically, it's a service that tracks this price. I think it's a tradeoff if we're just liquidating based on that. Therefore, the index price is not included in the proof or anything. This is an off-chain activity that we track this way to provide a better experience.
For example, we can do everything by oracle price. The reason liquidations are not on the index price is that liquidations need to follow a specific set of rules laid out in a smart contract. We can't liquidate them even if they don't have high profit margins. All of these need to be included in the rollup proof itself.
User: Regarding dYdX offering two products, I would like to ask more academic questions about the decision that the average trader makes between using margin vs. using perpetual contracts, which I'm sure you guys have considered. I know that perpetual contracts are very popular in the cryptocurrency market, which is one of the reasons why it seems that you guys have actively turned to focus on perpetual contracts, which makes sense. One of the things I want to know is what effect does the perpetual market have on the spot market and vice versa. I imagine this has been researched and maybe it's no big deal to the average trader, they just want to make money. But I'm wondering, I imagine the market makers you're working with are in a market neutral position, for example, if they're short and at the same time they're buying spot on the other side. What type of research have you done on the spot market, researching or analyzing the difference between margin and perpetual and how do they affect each other?
Brendan (dYdX): I think your theory may be correct. I can get David to answer that later, but from my point of view, this is an open question. I don't know that we have any very solid ideas about macro trends. Personally, I might agree with some that if the market is over-leveraged, then the price crash will be bigger, which is true for the market.
David (dYdX):This is a great question and I have done some research on it. My point is that if you look at the history of cryptocurrency exchanges in the Mt. Gox era, you can see the rise of centralized exchanges. Then you really see the rise of leverage and margin trading on centralized exchanges with the rise of BitMEX and Bitfinex. Over the past two years, you can see the rise of spot trading on decentralized exchanges led by amms like Uniswap. And then our thesis is that decentralized derivatives exchanges are going to really take off.
Ultimately, if you look at both crypto and non-crypto markets, derivatives markets are orders of magnitude larger than spot markets. This is already very common in centralized exchanges. I checked the data at the beginning of this week, and the daily derivatives trading volume on centralized exchanges exceeds 300 billion, which is several times the spot trading volume.
A lot of price discovery actually happens in derivatives markets. This usually happens before the spot market, which is where a lot of retail and institutional trading takes place. So I think some people will pay attention to the derivatives market and the impact of derivatives prices on spot. I think another thing to watch out for is the amount of leverage used in the derivatives space. A sharp rise or fall in price often results in traders being liquidated or having to cover their short positions.
So I think that observing the amount of leverage in the derivatives field is usually a leading indicator of the market's late trend. And then I want to answer your question about the market makers, we have a lot of more sophisticated retail users and of course a lot of market makers looking at derivatives as a way to get a neutral position in the crypto market. Therefore, a popular trading strategy is to go long in the spot market and short in futures or perpetuals. Whether their underlying price rises or falls has no effect on your overall position.
Ultimately, you'll get a funding rate that ranges between 40% and 80% annualized depending on the market, which can be considered risk-free if you know how to manage collateral properly. So we see a lot of big players taking the other side of the popular bet and getting paid for it. Traders watch the funding rates on different exchanges and how the rates change dynamically with market movements. Many see it as a leading indicator of price action in the spot market.
User: You mentioned derivatives exchanges, and I'm looking at all the analysis done by Dune Analytics, and it shows that about 3.5% of ETH wallets actually interact with some kind of DeFi protocol. Therefore, there are actually a small number of individuals who have actually participated in Defi. So, right now, I see dYdX doing well in the numbers, attracting new users to try the platform itself, but there are also competitors. So how did dYdX seek to adapt? Or will you focus on your own thing and watch how it develops? What are your long-term plans?
Brendan (dYdX):I can talk about this question in general, but is there anything in particular that I can help answer or talk about?
User: With the launch of the new derivatives exchange, users will have more choices, so you need to be able to retain new customers who sign up for dYdX. So, have you considered how competitors launch their own platforms and how to retain users? Because the total number of users is fixed, the chips in the hands of users are limited. So, how can dYdX stay ahead of the competition?
Brendan (dYdX): That's a good question. I don't know if this applies to the general crypto market in particular. I think you are right. In a way, you are competing with other exchanges for a fixed pool of users. But in many ways, the number of Defi and crypto users has been growing, especially during bull markets. But I may give the same answer as other companies: if you want to acquire users, retain users, and find products suitable for the market, you must first find the market position, and secondly, surpass your competitors.
I know this is a bit of a dodgy answer, but I think it's a really high quality, reliable product, and offers features we haven't seen before. So we have the opportunity to be, the best non-custodial exchange in the world, and then work towards decentralization, which I think will be a bigger paradigm shift. But at the same time, the reason people use dYdX is that it's a great exchange.
We want to be the high-quality exchange that users expect. In the past few years, we have been thinking, "You guys are really suitable for Defi transactions", but decentralized exchanges have not been considered mainstream by users. So I think over the next few years we're going to basically have to improve to be as good as the established exchanges, even compared to the big centralized exchanges like Binance, Coinbase, FTX.
I think we have to treat them as competitors in general. As you mentioned, it's definitely a hot area right now, but I don't know what I can say than we have a better product, more reliable, that people prefer to use than other products.
User: What happened to Uniswap and Sushiswap in terms of code forks? My understanding is that dYdX is open source, correct?
Brendan (dYdX): Many of our things are open source, and many are not open source. For example, we just run the matching engine as a service on the backend, which is not open source. Things like smart contracts are open source. So I think in many ways, we do run a lot of services. I think in some aspects it can give us more competitive advantages than Uniswap, unlike in Uniswap, you can only create contracts, open source them and then release them.
Brendan (dYdX): I think this makes Uniswap easier to copy. However, I think we are running more proprietary backend systems and high throughput systems instead of just relying on people reading and writing to the state of the Layer1 blockchain. So, I think this is more valuable than pure open source software. This is how I feel about the Uniswap fork.
David (dYdX)dYdX is a decentralized derivatives trading platform developed based on the second layer of Ethereum. It adopts the design of "off-chain matching + on-chain settlement" to make funds and transactions more secure and transparent, while ensuring high performance and responsiveness speed. As the world's leading decentralized contract trading platform, dYdX has significant advantages: low transaction fees and no gas costs; extremely fast withdrawal processing efficiency, and can withdraw from Layer 2 without waiting; security and privacy In terms of performance, StarkWare's two-layer technology improves security and privacy through zero-knowledge proof; in terms of transaction processing, dYdX transactions can be executed immediately and confirmed on the blockchain within hours; in terms of margin utilization, dYdX can cross With margin, one account accesses positions on different trading pairs.
About dYdX
dYdX is a decentralized derivatives trading platform developed based on the second layer of Ethereum. It adopts the design of "off-chain matching + on-chain settlement" to make funds and transactions more secure and transparent, while ensuring high performance and responsiveness speed. As the world's leading decentralized contract trading platform, dYdX has significant advantages: low transaction fees and no gas costs; extremely fast withdrawal processing efficiency, and can withdraw from Layer 2 without waiting; security and privacy In terms of performance, StarkWare's two-layer technology improves security and privacy through zero-knowledge proof; in terms of transaction processing, dYdX transactions can be executed immediately and confirmed on the blockchain within hours; in terms of margin utilization, dYdX can cross With margin, one account accesses positions on different trading pairs.


