Anna (00:05): Welcome to Zero Knowledge. I'm your host Anna Rose. In this podcast, we will be exploring the latest in zero knowledge research and the decentralized web, as well as new paradigms that promise to change the way we interact and transact online. This week James and I are chatting with Antonio Juliano, founder and CEO of the dYdX project. We look at how dYdX are leveraging StarkWare's STARK technology stack to create a different kind of zero knowledge rollup from the zkRollups we have featured previously. We discuss how the dYdX system works, what went into their decision making around which L2 construction to go with, the goal of dYdX and how their new system aims to get them there. But before we start in, I want to let you know about an event that I'm running next week, May 19th. It's a joint zkSessions plus ZK Jobs Fair. zkSessions is a series of monthly events I've been doing since the beginning of this year. This particular zkSessions is all about zk languages, and it will feature short talks from the teams who are developing the domain-specific languages you need to build with zero knowledge proofs. So if you are a dev thinking of jumping into the zk space, but you're confused by all the options, this is definitely for you. Right after the zkSessions event, which should last about an hour and a half to two hours, we will be hosting the second ZK Jobs Fair. Again, it will be on gather.town and you are welcome to come by and just get to know the teams who are looking to hire new talent. With every ZK Jobs Fair I'm releasing a new ZK Jobs Board. Here you can see open positions for many of the best teams in the space. The Jobs Board is public. Be sure to check it out. And if you do send an application, just let them know that you found out about it through the ZK podcast. I also want to take a moment to thank this week's sponsor of the podcast, Least Authority. Least Authority is a leader in the security of distributed systems. They provide security consulting services, develop open source products and contribute to the advancement of learning and research in the field. In addition to their security reviews of innovative projects, such as Chia Network, Mina, Loopring and Filecoin. This May they will be releasing a white paper on ZKAPs or Zero-Knowledge Access Passes. ZKAPs, adapted from privacy pass, is an anonymous token-based authorization protocol that facilitates an online exchange of value while disconnecting the necessary payment data from the day-to-day usage service data of customers. They've implemented ZKAPs in private storage, which is a cloud storage service designed with privacy and security features to give you control over who has access to your data. Private storage will be launched just after the white paper release. Sign up for Least Authority's newsletter to be notified on the release of the ZKAPs white paper, private storage security audit reports, job openings, and more. Visit leastauthority.com/newsletter to join the mailing list. I've added the link to this in the show notes. So thanks again, Least authority. Now here's our episode all about dYdX. Anna (03:08): So this week, James and I are chatting with Antonio Juliano, who's the founder and CEO of dYdX. Welcome to the show, Antonio. Antonio (03:20): Thanks so much for having me. Anna (03:21): Hi James. James (03:23): Hi, Anna, how is it going? Anna (03:23): All good. I want to find out first, what is dYdX. Maybe give me the high level description of what that project is. Antonio (03:33): Yeah, absolutely. So dYdX is a decentralized exchange and we're really focused on advanced financial products and specifically derivatives right now. Our main product that we have on the platform is this thing called a "perpetual contract". And this is financially the product that was really popularized by BitMEX and now is extremely popular in the crypto space. It's the most popular product by volume in the entire space, it does more volume than everything else in crypto put together, on perpetuals. And that's kind of the main reason why we're so focused on it. Specifically what perpetuals are. They're a type of synthetic contract, which can give you price exposure to any asset. All you need is some collateral in the system, and then you can synthetically trade any product that you might want to trade. The main way they function is based on this core component called a "funding rate", which is a dynamic interest rate that's paid between longs and shorts. But anyways, the main reason they're so popular is because they can be traded with really high leverage. So this is where you see the a 100X leverage products of the world and so. And not everyone trades with that high leverage, but leverage itself is a really powerful concept because you can just come to an exchange with a certain amount of money, say a $100, and you can start trading as if you had multiples with that amount of money. So you could start coming to the exchange with a $100 and start trading as if you had a $1000 or potentially even more, based on how much leverage you're willing to take on. And that's the reason why these products are so popular is because they allow traders to trade us if they had more capital. Anna (05:08): Cool. Where does dYdX come from? Cause it's kinda neat. It looks like a bit of a function or something. What is it? Antonio (05:16): Yeah, absolutely. So this kind of belies my background a bit, but the first thing that I thought about, when I thought about starting a company that built derivatives, was derivatives in the mathematical sense rather than the financial one. So my first company, I guess, I thought about the name for months and I couldn't come up with anything, but somehow, some way or another, when I thought of derivatives, I just thought of dy/dx, as in differentiating something in math. And it also was four letters, kind of sounded like an exchange, like a DDEX or like a Binance or something like that, DidEx. So it seemed like the name fit. Anna (05:52): Nice. And also I think your logo shows that too. It has this special "D" Antonio (05:56): Yeah, it was like this special "D". It's like lowercase Delta in Greek or something. Anna (06:01): Nice. So are you a DEX? Antonio (06:03): Yeah, I guess it depends on your definition of DEX, but I would call us basically what's known as a hybrid exchange, which means we have some centralized components to the exchange and then some decentralized components to the exchange. Our centralized components, we run our order book and our order matching system in a central way, to run it on servers like a normal centralized exchange. But importantly, we run on smart contracts on the Ethereum blockchain. And this is where you get all of the non-custodial trading, all of the really big improvements in transparency that come with a decentralized exchange, but it all runs through this central order book and order matching system as well. James (06:41): So the smart contracts exist to make sure that the order matching system is behaving correctly and that all its actions are transparent? Antonio (06:48): Yeah, that's basically right. And also that we don't custody user funds, when they're trading on the platform. You can always just go directly to the smart contracts and trade or withdraw your funds, it can't be censored from doing that. Anna (07:02): So in what you described though, you were saying this originally existed on L1, all on L1, and now you're moving to become more of an L2 setup. What does your L2 look like? We said it's not a zkRollup, so what is it? Antonio (07:20): Yeah. So I think it's basically, by definition, a STARK-based rollup. We partnered with StarkWare, who is effectively providing all of the STARK-based proofs that our system runs on. One important advantage and one important distinction is that we're running on StarkWare's rollup mode, which means we use layer 1 Ethereum data availability, similar to an Optimistic Rollup or something like that. And therefore the system is entirely non-custodial, because all the balances are stored on chain. You can always just go to Ethereum to be able to withdraw, be able to trade. And that's where we get a lot of the DEX improvements from. Anna (07:57): How does a STARK, like version of a zkRollup, what does that mean, actually? Cause I thought there was a reason that STARK L2s were built slightly differently because of the limitations of STARKs. Antonio (08:08): Yeah. That's a great question. I'm probably not the most qualified person to answer this. James probably knows a lot more than I do. But my impression is basically that STARKs are a pretty good improvement of the scalability and of the proving times and the proof sizes over what existed in the very earliest zero knowledge proofs. And that's why StarkWare is using them and it's really focusing on them right now. It's the technology that gets you the most amount of scalability and also the most amount of expressiveness in your programming language that's available right now. James (08:42): So for the new dYdX layer 2, this is more similar to zkRollups, but powered by STARKs and a little bit of a departure from the earlier StarkEx systems, right? Antonio (08:55): Yeah, that's exactly right. And the main difference, StarkWare offers two different modes, which they call "Rollup mode", which is what I talked about with on-chain data availability and what we're using. And then they also offer what they call Validium which is effectively like a federated group of data providers, promise to provide your data to you. And I think there are trade-offs with these. Obviously it costs more in gas fees to publish all of the data on chain and do in full rollup mode. But also of course it is more decentralized, as much as decentralization is a spectrum. Now, as long as you trust Ethereum and you can run an Ethereum node, you can always get your data. And we felt that was something that was important to be able to provide to our users. And we were happy to pay the modest, I would say, increase in gas fees to put all the data on chain, to be able to do that. James (09:47): I think that's a really good way of putting it is the core difference between a rollup and a Plasma Validium is where the data is and whether any user can go and get that data at any time. Anna (09:59): So last year I actually had Will Harborne from DeversiFi, also my co-founder at the Zero Knowledge Validator, and Tom Brand from StarkWare come on the show and explain the DeversiFi setup, the way that they were working with StarkEx. And I remember we walked through the federated system. We went through what the committee looked like and everything. I want to understand a little bit more what it looks like now, you're saying you use the rollup version, but what does that actually mean? Antonio (10:29): Yeah, absolutely. So at a high level, the data that exists on our system that we're using with StarkWare is all the user balances and also a bit of data about which particular orders have been filled and things like that. But that's the only data that you need to be able to reconstruct the entire state of the system. So whenever an order is filled, the only thing that's actually going on chain or into StarkWare system are the actual matches or the actual trades, orders that are just placed, but never filled are not actually going through StarkWare system. And that's what I was talking about with the off-chain order book and order matching system that we're running. So, okay. Whenever a trade happens, obviously there are two counterparties, there's a maker and the taker and both parties' balances will be updated. So the data that's actually going on chain is all of the accounts whose balances changed in the current STARK block. Only those accounts have to actually go on chain, because of course we've been publishing data since the beginning of the system. And you can always go back in time on the blockchain and be able to reconstruct the entire state tree with just the delta balances basically. So that's what goes on chain. When I say "on chain", it uses the call data effectively for the transaction, which is not accessible by smart contracts, but that's okay, because all we really need is people that are watching the blockchain to be able to reconstruct the state. And it's a lot cheaper to publish data there than it is to a smart contract state, but effectively the smart contracts are requiring that whenever a new STARK block is published, that the delta data for all the delta balances is published in the call data for that StarkWare block to be mined. James (12:23): I think you've pointed out a really interesting property of the validity proof-based rollups versus Optimistic Rollups. You said that the only thing that goes on chain is the deltas, the changes in the account balances and the orders don't go on chain. This is one of the most compelling advantages of validity proof systems is that you can drop all of the extra data. You can drop all of the orders because you don't care what they were as long as they were matched correctly. And the validity proof proves that there were orders that match these state changes that match these updates, all these trades. Anna (13:02): Does that mean in the Optimistic Rollup, you'd actually have to, if you were to try to create something similar, you'd have to include all the orders, even if they never went through? James (13:12): You would have to include all of the orders that were matched, that went through. Anna (13:15): Oh, that did go through, but you are doing that anyway, aren't you? Antonio (13:18): Yeah. It's actually an important difference. And I think it's a good call out by James, because if you look at the distribution of number of trades on an exchange, it's really, really top heavy. Like there are market makers that are quoting on the exchange and say a market maker may do thousands of trades in a given batch, but actually we only have to publish one delta balance for that market maker. So it's actually a really important nuance, but something that gives us a lot more scalability. Anna (13:46): Do you also find in these setups that there's a lot of trades happening between the same actors back and forth, so they also wouldn't have to publish each one of those? Antonio (13:54): Exactly. Anna (13:54): Oh, interesting. James (13:57): So the advantage of the zk model is that you prove that those orders all existed and you don't have to show them. In the Optimistic model you have to put all the orders on chain too, so that anyone trying to prove fraud can show the orders and can have a guarantee that those orders are available to be included in a fraud proof. So the zk model here gets a pretty big scaling benefit because it can just drop all of that information entirely. Anna (14:26): What made you make the choice in this case? You must have been looking at all the L2s and evaluating how they worked. Do you feel like this one fit your particular use case and needs the best? What was going into that evaluation? Antonio (14:41): I definitely think it was a combination of both StarkWare just being at the real forefront of production-ready scalability technologies, I would say, and also our unique use case. We talked about the advantage that we get as an exchange of just having to publish our delta balances rather than all the trades on chain, which is a really big deal. One of the other things that is unique about dYdX, which we touched on at the beginning, is we're a hybrid decentralized exchange, which means we have our central matching model and central order book already. And that fits really well with StarkWare's current model, and — emphasis on current — but their current model is basically a single central prover to the STARK system. And one of the things that we're going to be working on going forwards is being able to fully decentralize our system and that maps really well with StarkWare's own roadmap to decentralize their prover network. Because the thing we don't have right now for trading specifically, it's not fully censorship-resistant basically, on the trading side. It is fully censorship-resistant on the withdrawal side. You can always close your positions and you can always withdraw. But we could say, we could basically censor users, if we want to, from using our product or our website and going through our central liquidity. Anna (16:03): Because of that central part of the hybrid. Antonio (16:04): Yeah, exactly. James (16:05): The order matching engine. Antonio (16:07): Exactly. Yeah. So I think StarkWare's current system, first of all, is really general, but is an especially good fit for exchanges that are operating on this hybrid model, which both us and DeversiFi currently do. So I think that's some good empirical evidence of that. Maybe taking a step back and talking about our thought process for choosing a layer 2 in general, at a very high level, there were three main classes of things that we considered, which is probably going to be obvious to everybody who's paying attention to this podcast. But the first was other layer 1 blockchains that are not Ethereum. Second is Optimistic Rollups, and Optimism is the leader there. And then third is STARK-based rollups, and StarkWare we think is the leader there for sure. Going through these one by one, in terms of why not another layer 1 blockchain right now, this isn't a super original thought, but just the ecosystem for building decentralized apps on these other chains is not quite there yet, like the wallets are really subpar in general, the cross-chain technologies, like how our user's going to get tokens over, If we move to another layer 1 chain? Anna (17:17): James is making a face when you do that, because this falls on his shoulders. James (17:20): Partially my fault. Antonio (17:26): I mean, that's the point, right? People are working on it and I think there are a lot of great things being worked on, but at a really high level, we needed to scale right now, basically because our users were just getting crossed by the ETH gas fees, the amount of gas that dYdX transaction uses compared to a Uniswap transaction or so on layer 1 is roughly five times higher or so. So our users were having to pay a hundred dollars in gas fees pretty regularly, that would literally spike up to thousands of dollars in gas fees at the times when the gas price was going nuts. And that's actually the time people most want to trade too. So who's going to use it an exchange where you have to pay hundreds of dollars in fees to make a single trade? Not that many people. So we needed all this, like, right now, basically. But getting back to the question of why not other layer 1, just to finish there, you know other people have said this too, but also the developer environment there is nascent, I would say, there's a lot of exciting stuff going on there, but a lot of these other chains have their smart contracts written in Rust, which is fine. I'm actually of the opinion that any good developer should be able to write smart contracts in any given language. But there's not quite things like Truffle or equivalents or like Hardhat and stuff like that, to be able to develop on those chains quite yet. So we didn't think the time was right to move to a different layer 1 quite yet. And then we touched on this before, but there are several advantages, I think, of use for us of using StarkWare over using Optimistic Rollups. The first is increase in scalability. The second, which is basically the same thing as other layer 1s, is production readiness. I mean, just look at the apps that have been live on StarkWare. You mentioned this before, but DeversiFi has been live on software for the past year or so, which gave us a lot of confidence that they would be able to build a production grade system for us now, and not at some point in the future. And then the third thing, which is an interesting point as well, that I'm sure we can dive into, is the withdrawal times on Optimistic Rollups are usually on the order of a week or so, whereas the withdrawal times on zero knowledge rollups are, it really just depends on how much gas you're willing to pay and how frequently you're willing to publish the batches on chain. For us we currently have that set to eight hours, but likely it will be lower in the future, but being able to withdraw on that time period is a really big advantage for users. You can, of course, on the withdrawals, use a central liquidity provider to basically front the withdrawals for the system. And we're actually doing that right now on StarkWare's system. So users of dYdX don't even have to wait that eight hours, it's as fast as withdrawing from any other Dex or a centralized exchange, cause we're fronting the withdrawals there. But the thing that you have to think about if you're running one of these central withdraw providers is how much capital do you need to be able to run one of them. And we were thinking about it and we were like, "Okay, with Optimistic Rollups we need a week's worth or whoever's providing the capital needs a week's worth of capital of withdrawals on the entire exchange. And even for our scale, that's quite a lot of money. That's probably tens of millions, maybe a hundred million dollars or so." And as we scale, imagine trying to do that for an exchange aspiring to scale to the Binance level scale or something like that, it's quite high. Whereas it's definitely tenable for us to be able to front the withdrawals for... Currently we're doing eight hours. As we scale, hopefully, we'll shrink that time even lower, so the withdrawal provider only needs capital proportional to an hour's worth of withdrawals on the system. James (21:10): Quick question.What is the reason for the eight hour delay right now? Antonio (21:14): It's purely a gas cost optimization thing, whereas you're paying if you did every hour, you'd have to pay roughly eight times more in gas costs. It's not exactly eight times more, because basically the gas costs are, I believe it's around 5 million gas right now, a flat fee to prove the STARK proof. And then plus all of the data that you're doing in the validity proofs. James (21:40): Okay. So it's not a question of like, you need eight hours. It's a question of what's the right trade-off for the cost of operating the system. And as the system grows, you can do that more and more often. Antonio (21:51): Yeah, exactly. And that's purely just offset by the trading fees that we're making. So as hopefully volume increases and our fees increase, it makes sense for us to publish them more frequently. James (22:01): This is, I think, one of the interesting trade-offs of STARKs versus SNARKs is that STARKs have a higher base cost for these sorts of things. Anna (22:09): That actually leads me to another question though. So you've done the rundown of what you chose not to do. You chose not to do other L1s, you chose not to do Optimistic Rollup, but why not do a zkRollup, like the zk-SNARK rollup? And I feel like what we started with was more the comparison to Optimistic, but not necessarily to SNARKs. So you must have looked at all of those options as well. What made you make the call? Antonio (22:37): Yeah, we definitely did look at all of them. I think the main reason for choosing StarkWare was combination of production readiness and what we deemed to be professionalism on their team, not to say, I just think StarkWare is the most professional and it has a really high quality team and empirically they had been running with DeversiFi for a while. So like I said, that gave us a lot of confidence to go with them. James (22:59): So we've been talking a lot about why dYdX decided to go with zkRollup using STARKs and a big part of that was that the limit order book that you are running, the order matching system kind of necessitates the choice. Is the order matching system works better with zkRollup? Can you talk a little bit more about why dYdX built a limit order book when a lot of the Dex activity in the space has been moving towards automated market makers? Antonio (23:33): Absolutely. So I think at the highest level, it's worth talking about what our goal is at dYdX. And our goal is to become one of the biggest crypto exchanges, period, but on a 3-5 year time horizon. And that informs a lot of the decisions that we make, I think. So if you want to be one of the biggest crypto exchanges, of course you must support the biggest market in crypto, which is perpetuals right now. One of the interesting metrics on perpetuals is that just in the past year, they surpassed all of the rest of volume on everything else in crypto, combined. And we think that they, and more broadly the derivatives market on crypto, is only going to grow from here. So that led to our choice on why derivatives. Addressing your question on why order books, as opposed to automated market makers, this is not a super original thought, but I subscribed to it, and that's order books, I think, are more efficient for building liquidity than automated market makers are. And of course there's drives to improve this, like the stuff that Uniswap V3 is doing, with us to step on their toes. But I would call that a hybrid, like AMM-order book, cause you can place and cancel in different levels and stuff like that, which I think is really cool actually. James (24:48): One of the ways to look at it is changing the AMM to simulate an order book. Antonio (24:51): Yeah. It's a little bit in between and I think that's awesome and there's trade-offs all over the spectrum, but answering the question of why order books, for a given capital amounts, you can just get much more liquidity, much more depth on the book, with an order book, than you can with an automated market maker. Kind of to give people a sense right now, roughly I think Uniswap has about 800 million or so locked up in their ETH/USDC pool. And that translates into about $2 million worth of depth within 1% slippage. And that's the same depth we have basically, $2 million of depth within 1%, but we only have our market makers quoting with $2 million on the platform. And of course Uniswap will improve, and of course dYdX will also improve the amount of capital and market makers that we have as well. But just, we think we're going to be able, at a really high level, to build a much superior product experience with order books than we are with automated market makers, specifically for the, call it, top 50 or top 100 markets. And that's a really important point actually. And again, this isn't a super original thought, but I think the thing that automated market makers are great at is quoting on the long tail of markets. I mean, just look at the number of markets that Uniswap supports versus even like a Binance or like an FTX or something.You do great execution on being able to list the long tail of markets with an order book-based model and automated market makers, that's the real killer use cases. They're just better for supporting the long tail of markets, because it's so easy to provision liquidity for them. But going back to what I led with, like what is our goal here is to become one of the biggest crypto exchanges. So you have to form an opinion on which one of these two is there actually going to be more volume in, like the top, call it like a 100 markets or so by volume or a 100+ markets. And it's certainly an open question as to how many cryptocurrencies will there be with tons of volume and what would the volume distribution look like? But right now just Bitcoin perpetuals, just that one market, is almost bigger than everything else in crypto put together. So it's very top-heavy in terms of volume towards the top coins. And that's why we're focused on order books, because we think for the foreseeable future, most of the volume will be concentrated in these top markets and we can build a better product by serving them with order books. James (27:08): Interesting. Do you have a Bitcoin perpetual dominance index that I can track? Antonio (27:13): Yeah, I think there probably is one on Coingecko or something like that. I don't know what the current number is. I think it's like 40% of all volume in crypto is on Bitcoin perpetual. James (27:24): Incredible. Anna (27:26): Yeah, you just spoke to this question that we had, which is about the selection of assets that you've chosen to list. It sounds like you haven't quite decided how wide you're going to go or, or have you? What you just said, you, you don't exactly know what the future holds for this. First of all, how do you even make these decisions? Because that will change, right? Those top tokens are going to change dramatically over the next few years anyway, probably. Antonio (27:50): Yeah, absolutely. And I think this is a good segue to one other really big advantage we get on our layer 2 system. I'm going to talk about historically how our layer 1 contracts were set up and how that really limited us in the number of markets we could support, but on our layer 1 perpetual contracts, they only supported, what's known as "isolated margining". And that means for every different market you might want to trade on, you have to put down collateral separately for that market. So if you want to trade both the Bitcoin and ETH perpetuals, you got to put down your thousand DAI or whatever of collateral on the Bitcoin perpetual and then your thousand on the ETH one, separately. So this just really limits capital efficiency for traders. And especially it really limits capital efficiency for market makers, because market makers want to trade on every market that the platform supports. But with isolated margining, say dYdX wants to support a hundred markets in the next year, market makers would have to deposit collateral a hundred times, which is obviously pretty ridiculous. So that really just limited us in the number of markets that we were able to support on the platform to the point where we needed to give people a sense. We literally only had 3 perpetual markets ever on layer 1 Ethereum for this reason. Anna (29:04): Okay. And it was, what did you call it? Bitcoin..? Antonio (29:07): Yeah, we had Bitcoin perpetuals, ETH and then Chainlink as well. Anna (29:10): Chainlink was the choice. Why Chainlink? Antonio (29:14): Well, it has a good amount of volume and also there's a good amount of overlap with the users that we have, which are oftentimes more DeFi-centric. Anna (29:24): Got it. I mean, I actually wanted to ask you that before, when you were talking about these gas prices getting crazy, was that during DeFi summer that you really found this problem to be unmanageable? Antonio (29:33): Exactly. And like mid to late 2020. And consequently, we really missed out on a lot of the volume that went into these new DeFi coins, which was tough to foresee. But actually dYdX had about 30% market share of all volume on Dexes, roughly in the first half of 2020. And then Uniswap obviously just started going crazy because people wanted to trade these long tail of markets and not even the long tail, but going from 3 to on the order of a 100 or so, we have captured most of that volume, we think as well, but we were unable to support that because we only had isolated margining. And the reason for that is effectively one of the things our smart contracts do is whenever a user makes a trade, you have to check that their account is collateralized, which means you have to basically loop through all of the markets on the system. You have to get the Oracle price for every single market, which is a number of SLOADs at least times number of markets that you support, which is quite a lot. So that really limited us in terms of how many assets we could list on the platform, because every single new asset that we would list would have increased gas prices for everyone on the system, even if they're not trading on those markets. So it was a super big limiting factor. Looking forward to what we now support on StarWare, we support this other motive margining called "cross margining", which is basically the opposite. It's like you can deposit collateral one time and you can start trading on any different markets or as many markets as you want to, using that collateral. And again, market makers can use this as well. So they just deposit it one time, it's really easy for them to start quoting on just any different market they might want to trade on. So the reason we were able to support this on StarkWare fundamentally is because of the scalability, because you no longer have to pay constant number of times, like number of SLOADs you're doing basically, gas per trade, anymore. And that's really allowing us to launch a lot of new markets on the platform, which is a really big strategic objective for us. Currently, we're up to, I think like 8 or 9 or so, but we're on a pace of about launching 2 markets per week or so, mostly just doing that for growth purposes, to build hype for every new market that we're launching. But that's a really big advantage of using layer 2, as well. You can just do things that weren't really possible on layer 1 due to gas constraints. Anna (31:53): Interesting. When you say markets, do you mean pair or do you mean a token? Antonio (31:56): Yeah, pair. Anna (31:56): Two new pairs every week? Antonio (31:59): Right. Anna (31:59): What are you up to now? I guess you can just say pairs. For me, I always think in token supported, but I realized I don't think that's the way you're thinking about it. Antonio (32:09): It's basically the same thing. Yeah. All of our quote currencies are in USD. So basically we're listing a new token for each new pair. Anna (32:16): Okay. And how many are you up to now? Antonio (32:18): Currently up to 9, I think, but we just launched the platform, like a month ago. Anna (32:23): Okay. So it's 9 and growing at 2 per week. So that's pretty good. James (32:30): You said the quote currency was USDC? Antonio (32:31): That's right. James (32:33): Cool. Anna (32:33): Do you foresee a limit though, even on the L2? Does it have some point where actually it starts to also affect this model? Antonio (32:42): Yeah, I would say it does. I mean, one limiting factor that we haven't really touched on yet is even with STARKs, a pretty big consideration is the proving costs for STARKs, which are reasonably high. Still, we're paying more in gas fees than, I'm pretty sure, it's cost in StarkWare to run their prover engine, but it is a pretty significant consideration as well. So I believe we're totally golden until we get to on the order of 200 or 300 markets, but at that point, we'd have to think about scaling the proving engine, making the verifiers more efficient, things like that, but that's the stuff that StarkWare continues to work on and that I think will continue to improve. Anna (33:20): Do you also see an evolution in the way that your L2 setup interacts with the L1, going forward? Or is this like you've done a lot of work to launch this and this is what it's going to be from now on? Antonio (33:34): No, it's very much like, I think a lot of aspects will continue to improve over time. One actual critical thing that our users are still running into basically is, in order to onboard to the system, you have to send two transactions, basically: one to register your STARK account on the smart contract, and then a second to deposit your funds. There is no way to get around. Fundamentally, you have to deposit your funds into the system. One thing I'm excited about is just more bridges between layer 2s being a thing. Imagine if Coinbase or something like that were integrated with StarkWare, Optimism or whatever the case may be and could support just withdrawals directly to layer 2. That would be a lot more gas-efficient for them and us, and the whole system. And I think that's the kind of stuff that's gonna start happening over the next year or two, whether it's withdrawals from centralized exchanges or it's like a bridge between Optimism or some other layer 1, and StarkWare and any other chain you might want to trade on. But currently I guess the state of the world is everyone has to go back to layer 1 and then maybe move to whatever layer 2 you want to, whether that's centralized layer 2 on your favorite centralized exchange or it's your StarkWare stuff, but that's still a pretty big constraint, I would say. Anna (34:54): That question of bridges between the L2s. I mean, we have mentioned that I think on almost every episode. But one of the questions I have when I think of that bridge idea is who builds that exactly? Is that agreement, is that like an individual bridge built every time between two teams, they have to figure out who funds what, and then they deliver it. And it only provides that one bridge and there are so many of them that you're gonna need so many of these and each one is bespoke and it's just a nightmare. That's, for some reason, that's what I'm worried about. James (34:57): I have some very strong opinions here, but it's probably best for another time. Antonio (35:30): Yeah. Probably James can speak a lot better to the technical side of this than I can, but maybe I can provide some color on it from a business perspective, like who is likely to be pushing some of these things forwards. I mean, like I just said, obviously there's a huge incentive for us to form partnerships with all either other layer 2s or centralized exchanges to be able to do these bridges. And it's just a massive improvement in onboarding to dYdX. So I think you'll see, just whether it's some form of revenue sharing or payments or incentives. You know, it's good for both sides basically, but I think you'll see more of this start to happen from a business perspective soon, because as we're starting to get these products that have real usage on layer 2, they have real incentive to make a lot of these things happen. Anna (36:18): I started to wonder, this is a little bit off-topic, but it's sort of the future of Ethereum as the role that it's holding. If you have these bridges between the centralized exchanges and other L2s, does ETH and the Ethereum-based chain itself become the store of value? Is it no longer a used token? I mean, I guess it would be used for gas fees and that security model, but I know you need it in a way. But I'm just trying to picture this future, where everything is happening in this net above it. And what actually happens to that L1. Antonio (36:54): Yeah, it's an interesting question. Macro crypto economics is a really hard topic to delve too deeply into that, but I still think there will be at least as much usage of Ethereum, if not more, because of these chains that are built on top. Fundamentally, everything has to settle on some layer 1 chain and clearly we are currently going with Ethereum as that layer 1 chain for variety of, like decentralization security, et cetera, reasons. But I think just that the chain of Ethereum or whatever chain things are settling on will become even more valuable, because of layer 2s, not less valuable. Because now you have just all this new financial activity or whatever activity that you can unlock and still that settling on this one chain. Anna (37:36): Yeah. Going back to the options you saw for yourself, you never had the idea of building your own L1, did you? Antonio (37:45): No, I didn't personally have the idea of building my own L1. I know this is a funny way to say it, but it's just too technically hard, I guess, for me personally. I really respect people that work on that and have the capacity to do that. But I think just for me personally, and given my background, having worked at Coinbase and at Uber and this general Silicon Valley engineer, I have a lot of experience building what I think pretty high quality products and being able to take that technology, take the smart contract scripting language that is provided by whoever's building the layer 1s and transform that into a great product, is something that I'm a lot more personally interested in, but of course both sides of the coin are required to make something that's great. James (38:30): I think my main takeaway from this is that, as opposed to the other L2s that are being built and the other rollups we've talked to, all of them have taken this "tech first approach" and are looking for products. And dYdX has taken the opposite approach, which is start with the goal of being one of the biggest crypto exchanges in 3 to 5 years and have filled in the tech to support that goal. And I think that's really interesting and uncommon in the space. And why do you think you took that approach and why do you feel like that is uncommon in the space? Antonio (39:07): Yeah, it's a good question. And I think it gets back to what I was saying before around why start a company, around the product rather than a layer 1 chain. What we've seen in Silicon Valley over the years is that it's really hard to build a product that people want to use, and that has product market fit. Even if you have the top class technology in the world, it's just hard to find a product use case that is differentiated, that is 10X better in some way from what has come before. So I think it's a really hard ask to just start with new technology and then say, "Okay, let's spend most of our effort building the technology and then we'll think about the product later, or we'll come up with something that is useful". And it gets back to also what I was saying with the two sides of the coin. Of course there needs to be new technology, but it's, first of all, very, very hard to build a new, world changing technology. And also it is very, very hard to build a real world changing product on top of new technology. And if you multiply those two things together, it's just so, so hard, if you're building both the technology and trying to build the product at the same time. So again, we feel like our main expertise is in building really top class products at dYdX. And also of course, at least we think, understanding new technologies and how we can use them to build a great product, but we don't really feel the need to have to build those things ourselves. There are a ton of great people out there that are building them and by forming partnerships with those people and really focusing on just nailing the product use case, all of course understanding the technologies and how that could have implications for what you can build on top of them. But I guess in my opinion, it does make sense to keep those things separate, like have one great company that focuses on building the best possible technology and then another great company, which focuses on building a product on top of that, rather than having them together. That's just my opinion. James (41:10): Very interesting. I guess, what it leads me to think about is these rollups that are building out just general smart contract platforms, I guess they're trying to be 10X better than Ethereum, and dYdX has a very different goal in mind. It's not trying to compete with Ethereum for market share. Antonio (41:31): Yeah, that's exactly right. I mean, we 100% don't care about the scalability technology we use. Well, maybe that's not a great way to put it. We do care. But the only thing we care about is the actual benefits to our end users on a lot of different axes, whether that's decentralization, security, performance, all of that. But we have no specific allegiance to Ethereum or something like that. As long as we think it is giving our users the best possible trade-offs for decentralization and security, and then multiplying that by StarkWare's performance is the best possible product we can build right now. But if there were something better later on, I would definitely go out and settle StarkWare's transactions on some other chain, if it were able to compete on the metrics we care about. Anna (42:18): Got it. So you are focused on this product, you are a company and you're based in America? Antonio (42:23): Right. Anna (42:23): What's your plans for the business itself? You talked about wanting to be an exchange of sorts, but you're still... At least you have one foot in Dex world. Do you have any plans for decentralization on the company front? Antonio (42:38): Yeah, that's a great question. This is something we're thinking a lot about this year, especially. And that's going to be our main area of focus for the next 12 to 18 months or so is full decentralization of the product. And for us, really, what that means is full decentralization of what I would call "the liquidity model" and getting no longer running the central order book and the central order matching system, for a variety of reasons. But we have some ideas on that, we don't have any decisions on it yet. I can talk through what we're thinking about at a high level. And of course, like I said, we don't really care what technology we're using. We just want to build, at the end of the day, the best possible use case for our users. So that's kind of the angle we're coming at it from. But okay, talking about this question of how do you decentralize a central limit order book, or maybe even taking a step back at a high level, just how can you build the best possible liquidity system for perpetual contracts, for the highest volume markets? Because as we talked about, that's what we think most of the volume is. We have a couple of ideas, kind of stack-ranked. First of all, we're thinking about utilizing more of a "Request For Quote system" rather than an order book system. And the way this would work is effectively there may be like 5 to 10 market makers or so, which are known in the ecosystem. And whenever you want to make a trade, you just ask all the market makers for a quote, they get back to you or they don't. And then you just take whoever's giving you the best price. And the reason we think this could work pretty well specifically for us is twofold. First of all, it supports bespoke markets really well. So order books are really good for just aggregating liquidity. But if you have tons of products and tons of markets, it's hard for order books to scale to that number of markets, like I was saying before, and one of the things that we are interested in the long-term is the growth of the options markets, which is important from a strategic perspective. Right now, perpetuals have about a 100X the volume or so of the options market in crypto, but at least personally, I think that's likely to change on this 3 to 5 year time horizon, where options and even more sophisticated financial products will take up more of the volume share. And options are very bespoke, there are tons of different expiration dates, there are tons of different strike prices that you could buy. And even in traditional finance, most volume through options markets just runs through this "request for quote system". If you're trading on a Robinhood or something like that, that's basically how Robinhood works is it just goes and talks to these high quality market makers that can provide good liquidity. And that's one of the things we've been focused on a lot at dYdX actually is building these relationships with market makers. I like to think we're at the forefront of that index. There's a lot of these crypto market makers, see dYdX and our current hybrid approach being really approachable, coming from centralized exchanges.We have an API, we have trading clients that is pretty similar at the end of the day to what centralized exchanges can support. So we've been able to build a lot of really high quality relationships. It's really a top tier market makers in crypto and this RFQ system could potentially mirror our current liquidity model pretty well. Right now it's, for given market, probably like 3 to 10 market makers are providing most of the liquidity, so it could potentially work well. And the cool thing about that is still, you only have to put the actual settlements on chain, you don't actually need to put the order book on chain. And the issue with putting the order book chain, which leads to our second potential option here, is that order books, the main throughput that you require and the main thing that's happening, is not trades. It's just orders being placed and canceled and not filled all the time. It's like market makers placing and canceling, repricing orders. And roughly this happens at about 10,000 x the rate of actual trades happening. So if you're trying to think about moving this to an on chain system, which again, point number two that we're considering, is building an on chain order book, something like what Serum is building on Solana. But the real question here is how much scalability is your solution actually providing? And what's the order of magnitude increase in, roughly you need 10,000 times more scalability or potentially even more to run an on-chain order book, than you do if you're just doing the trade settlements on chain, which could be achievable on the time horizon that we care about. But this is very much a research question as to what is the real level of scalability specifically for our use case of placing and canceling or repricing orders on a given chain. And then the third one that I'll just touch on is moving to more automated market maker model, with this third. So it's lowest on the stack-ranked for reasons that I touched on before, in terms of thinking that other liquidity models are more efficient for building liquidity for the top-tier markets, but we are watching what's going on in crypto. Like I said, excited about a lot of the new developments with Uniswap V3 and their, what I would define as hybrid order book, like automated market maker model. And potentially there is something that comes out that could work well for us too. And as the last point I'll make is, once you're fully decentralized, the cool thing is that these options are no longer mutually exclusive. Like you could imagine you have an AMM or an on-chain order book, and that could be supplemented by RFQ liquidity. And all of these ideas, we're not the first one to think of these, tons of people have tried every one of these three things. But I think we're uniquely positioned to do it just because of our focus on the product, relationship with high-quality market makers and just being able to translate technologies into really great working products. Anna (48:16): Does what you describe really make you censorship-resistant? I mean, you're still a US company. If you were able to articulate some of this decentralization that you described in terms of the order book, would that mean that you no longer have control over it? Antonio (48:29): Yeah. I guess "control over it" is a bit of a loaded terminology, depending on who you're asking, but decentralization obviously is a spectrum. And I think it gets us much, much further to the right. I mean, our goal is to be able to say that all we're doing here is publishing this open source code that our users are using, whether our users are end users of the product. Or you could imagine potentially we publish open source nodes that market makers could run as part of our RFQ system or something like that, and we're kind of the technology provider in that ecosystem. But I think another thing that we're moving more towards over time is decentralized governance, like decentralized ownership of the protocol itself. And obviously there's been a ton of activity, going on in DeFi, over the past year and we've been watching, and we think that's something we want in terms of users actually owning and having more decision-making power in the protocol for ourselves as well. Anna (49:23): Is that on a public roadmap to actually create some sort of decentralized governance of the protocol yet? Antonio (49:29): No roadmap for that right now, it's just kind of internal thoughts that were happening. But like I said, we're watching everything else that's going on in DeFi. And there's obviously a lot of momentum around that. Anna (49:38): Totally. So I think as a last topic that I want to touch on, and I just want to get your thoughts on. Now it's not DeFi summer, it's DeFi whatever it is now. I think that the difference here though, is the price of ETH has gone up so much that if you're outside of crypto, it's brutal. What is your thinking on the state of it right now? Do you see it as, is this the moment that it's crossing over? You've also been working in the space for 3.5 years or so. I think you might've started around the same time I did. So, yeah. I'm just curious to hear your thoughts on the state of DeFi. Antonio (50:12): Yeah. I think the state of DeFi is really interesting right now. I think the thing that layer 1 gave us is just it's really easy to experiment and build new things in DeFi, and that's just a really awesome thing. It's just so much easier to build in crypto actually a financial product, than it is in traditional finance. Just one quick allegory on this. I used to work at Coinbase as a software engineer, and I think the thing people don't realize about Coinbase is 75 to 80% of the work on engineering side goes into dealing with the traditional financial industry and roughly 20% is on the crypto side. What I did was integrating with banks and stuff. It's a massive headache, even from the technical side, not to even get into the regulatory and compliance side there. But it's so easy to experiment on DeFi right now, and that's amazing. But as you mentioned, the main limiting factor here is as there's more interesting stuff being built, and there's more usage of the chain, because there's this really low cap on throughput of the system on layer 1 Ethereum right now, that just results in these astronomical gas prices. So it's kind of this balancing function, where it's like all this cool stuff that we want, but if there's too much cool stuff, then there's this cap on how much people are willing to pay for said cool stuff. And I think the thing that is going on in crypto right now, and obviously you mentioned this in terms of the types of guests you've been having on the podcast and stuff recently, is layer 2s are happening. They're here, like real mainstream DeFi products are moving to layer 2, dYdX, Synthetix, I think Uniswap has plans to launch with Optimism really soon as well. And I think over the next 6 to 12 months or so, we're really gonna see almost all the mainstream DeFi products, I think just beyond layer 2 in some form or another. One of the things that is interesting to me, as a bit of an aside, is everybody seems to be moving to a lot of different layer 2s, there's not yet consensus around, which layer 2 is the best, I guess. And of course there's no objectively best one. It's like different things are better for different particular use cases. But I think we'll likely at some point see a re-centralization to the top most or the most winning layer 2s, as people realize that it's harder, at least, to have a lot of composability that makes certain DeFi products interesting, if everybody's on different layer 2s, but we'll see. So I think it's going to be a really exciting next 12-18 months, but we just had this ridiculously huge problem of who's going to use DeFi, if you have to pay a $100 in fees every time you want to do something, and now we're solving that on layer 2s. That'll bring new issues with composability and all that kind of stuff, but we'll solve those next going forward, as well. Anna (52:59): Cool. Well, Antonio, I want to say thank you so much for coming on the show. Antonio (53:03): Yeah, thanks so much for having me. It's a great conversation. Anna (53:06): If anyone wanted to find out more, where do they go? Antonio (53:08): Yeah. So you can head over to our website dYdX.exchange, or just Google dYdX and we'll probably show up. And you can join our Discord and ask me or anybody else on the team questions directly, try out the product. I mean, I think, I guess as an aside, one interesting thing is all of this stuff is live right now, we're not just talking anymore. Go out and use the product and see the gas fees, see the user experience and stuff like that, and see for yourself about a lot of these technologies that we've been talking about for awhile now. And related to my last answer, it's an exciting time where we're not just talking anymore, go and use the products and see what the technology can build. James (53:50): And do you have a Docker container that I can go out and run a node on the dYdX rollup? Anna (53:58): He asked this on the last episode too James (54:00): I'm going to ask this on every episode. Antonio (54:03): We don't have a Docker container right now, but I mean, all the data is on the Ethereum itself. So no nodes required, I guess right now. Anna (54:11): Cool. All right. So thanks again. Big, thank you to Andrey, the podcast producer, Henrik, the podcast editor and to our listeners. Thanks for listening.