Join Delphi Research today and immediately get access to our full Member Portal!
Join Delphi Research today and immediately get access to our full Member Portal!

Antonio Juliano: Scaling dYdX’s Perpetuals Using Starkware To Target The Trillions In Monthly Perps Volume

Apr 26, 2021 ·

By Tom Shaughnessy

The Delphi Podcast Host and GP of Delphi Ventures Tom Shaughnessy hosts Antonio Juliano, the founder of dYdX, the decentralized derivatives exchange for perpetual swaps and margin trading. We talk scaling on Starkware to the sheer size of this market to economic attack vectors and everything in between.

Every Delphi Podcast is dropped first as an audio interview for Delphi Digital Subscribers. Our members also have access to full interview transcripts. Join today to get our interviews, first.




 Music Attribution:

  • Cosmos by From The Dust |
  • Music promoted by
  • Creative Commons Attribution 3.0 Unported License

Interview Transcript 

Tom (00:00):

Hey everyone welcome back to the podcast. I’m your host Tom Shaughnessy and today I have Antonio and David from dYdX, which is a very popular protocol, just launched the layer 2s and StarkWare. Super excited to have you guys on. Antonio, why don’t you introduce yourself with a bit of your background?

Antonio (00:19):

Yeah, absolutely and thanks for having us on. So I am the founder at dYdX, got into crypto back in 2015 when I had my first job out of college at Coinbase. I was a software engineer there, worked on a lot of stuff while I was there including payments, including a lot of their banking integrations, including the beginnings of what’s now Coinbase Wallet. After that did a brief stint at Uber, also on the engineering side and then left to start my own thing. We’ve been working on dYdX for over three and a half years now, I think, and really focused on the advanced financial products use case of decentralized exchanges and now specifically on perpetual contracts. Yeah, as you mentioned we have recently launched our layer two product in partnership with StarkWare, using zero knowledge roll-ups. I’m so happy to talk more [inaudible 00:01:12] about that or anything else.

Tom (01:15):

Awesome. David, what about yourself?

David (01:19):

Yeah. So my name is David Gogel. I’m the Growth Lead at dYdX. I joined the company last summer, working on a lot of different things but the mandate has been driving our international growth strategy and execution. Prior to that, I worked in the crypto startup ecosystem in New York. I was with the fund affiliated with ConsenSys, then [inaudible 00:01:42] Techstars Blockchain Accelerator and then started my own consulting business. Prior to that I got my MBA at Wharton Business School where I was president of the fintech club and helped launch the [inaudible 00:01:54] blockchain club. And then prior to that, I worked on Wall Street, first as a trader and then an M&A, in New York and then [inaudible 00:02:01] Asia for a few years.

Tom (02:03):

That’s awesome. Your finance experience makes sense, especially for this project. And Rob from Delphi is also here. Rob, why don’t you give us your quick intro? I think it’s the first time you’re on our pod.

Rob (02:11):

Hey everyone, I’m Robert Sarrow, as Tom mentioned I’m on the bench team at Delphi Ventures. My background is basically, had a couple of stints of consulting and then a couple of startups and visual assets and found my way over to Delphi Digital recently. So it’s been great.

Tom (02:29):

It’s awesome. So Antonio, David, let’s dive right into why the perpetuals market? Can you guys just get a sense for people? Because I feel like everyone goes to Coinbase to see spot volumes. I’m not sure everybody’s aware of just how big the perpetuals market is. Can you give some colors on the market sizing here?

Antonio (02:47):

Yeah. It’s massive, basically. Perpetuals are bigger than everything else in crypto put together right now, in terms of trading volume. I think the volume has been continuing climb quite a lot. Binance, I believe did over $120 billion in one day on perpetuals last week. So it’s a massive market growing really fast. I guess one way we look at it is normally in the traditional financial markets, you see the derivatives markets, being about five to 10X bigger than the spot markets. And one of the interesting things that’s happened just in the past year in crypto is the derivatives volumes have gotten bigger, basically 1X bigger than everything else that’s in crypto. So I really think we’re not even that close yet to the potential of derivatives on crypto. It’s already a huge market and I think it’ll only grow from here.

Tom (03:39):

Yeah. Now that’s incredible. And can you just give a brief overview of dYdX and your offerings just that people could contextualize that before we dive in a bit deeper?

Antonio (03:48):

Yeah, absolutely. So as I mentioned the main thing we’re focused on at dYdX right now is perpetual contracts. I guess to give a sense, perpetuals are by far the most popular type of derivatives in crypto right now, as I mentioned, biggest market in crypto. I think options right now are pretty just in second in terms of derivatives volume. I don’t have the latest numbers in front of me but I think it’s roughly like perpetuals or a 100X more volume than options or so, right now. So it’s really the main name of the game for derivatives and that’s why we’re focused on it. In terms of other product offerings, historically, we’d also offer borrowing, lending, margin and spot trading on the platform. We still offer that through our layer one product that we’re starting to move away from that and move more towards focusing on just perpetual contracts.

Tom (04:38):

It makes a lot of sense. And Antonio I’m somebody who had to look up, I guess months ago, what perpetuals are when I was diving into this space and it took me a couple tries to get it. So I hate to ask the dumb question just to round out the basics but could you give a brief overview on what exactly a perpetual contract is?

Antonio (04:55):

Yeah, absolutely. So the main thing to understand about perpetuals are that they are synthetic contracts. And what synthetic means is that when you’re trading a perpetual contract, say you’re trading a Bitcoin perpetual contract there’s none of the underlying asset that actually exists in the contract. So on a Bitcoin perpetual contract, you’re not actually trading hard Bitcoin, you’re effectively collateralizing your position with some other asset and then just trading a synthetic asset that gives you price exposure to Bitcoin or whatever other asset you’re trading with. And the main reason these contracts are so, so popular is that they can be traded with very high leverage. So if you’ve ever seen like Binance and BitMEX’s 100X leverage is out of the world, these are the products that can offer that kind of leverage.

And some people choose to use that high leverage. Obviously there’s quite a lot of risk involved with that but even if you’re not trading with such ridiculously high leverages, there are quite a lot of reasons to utilize perpetuals over utilizing based off a spotter margin trading. A lot of traders in this space will oftentimes use about like 10 to 20X leverage. I believe Binance published some statistics on this and I think they said maybe roughly the 20X leverage range, which is still quite high and obviously still think critically about whether you want to use that much risk in your trading. But that’s the most popular leverage range that you can trade with on Binance. And one of the best ways, I think, to think about leverage or the concept of leverage, is say you come to an exchange with a $100 on Coinbase. If you’re just doing regular old spot trading, you can buy a $100 with a Bitcoin. Makes sense, right? But if you’re trading on an exchange that offers leverage and on dYdX you can trade with up to 25X leverage, you can work up with your $100 dollars and you can immediately buy $2,000 worth of Bitcoin or a Bitcoin synthetic.

And that’s just a really big difference, right? You can just get way more price exposure in a way more capital efficient way. So that’s one of the reasons that people are so into perpetuals. Another reason why they’re pretty popular is it just makes it a lot easier as an exchange and especially as a decentralized exchange to offer a wider array of assets to trade on the platform because it’s a synthetic, basically the only thing our smart contracts need under the hood is one collateral asset, which on our platform right now is USDC. And then you can just synthetically create any different token regardless of whether or not it’s on Ethereum and you can create price exposure to that asset.

Tom (07:30):

It makes a lot of sense, given how easy it is to interact with and basically how much leverage you could get, it definitely makes a lot of sense. Do you get the sense so that people are starting to understand PERPs in mass? I feel like the recent drive has been, in the last couple of months you’ve gained a lot of momentum and other projects but I’m not sure if, say my friends that are potentially [inaudible 00:07:53] on Coinbase really understand the ease of use and the benefits of using PERPs. Do you think we’re at that point yet or do you think it’s mostly for institutional traders?

Antonio (08:02):

Oh yeah I think we’re definitely at that point. I think just look at the number of users of perpetuals on centralized exchanges like Binance and BitMEX. Even Binance, I think is pushing their futures as their main product offering, which makes a lot of sense. And also in terms of the volume that’s flowing through these things, a lot of it is individual takers, you got more retail flow as compared to just a more institutional volume on crypto. I think, really the way I think about institutional volume on crypto from an exchange’s perspective is that it’s a bit different. Actually, it’s totally on its head from how it works in traditional finance, where in traditional finance, usually all the volume is really flowing through the institutional players and then the retail players will just follow along to whatever venue has the most liquidity.

I think it’s really the opposite in crypto where the name of the game, if you’re an exchange, is building out a great product offering with great user interface and all of that to be able to attract the individual takers and that retail flow, and the institutional traders will just follow along to whoever has the most retail takers because that’s just a really great source of organic taker volume. So I think already, most of the flow is going through retail. And I think a lot of people are getting their first exposure even a lot of times and especially in the international markets, to derivatives through crypto and I think that’s a really empowering thing.

Tom (09:33):

No, I totally agree. Excited to see it [inaudible 00:09:36] to new markets and new people. And I want to dive into perpetual swaps a little bit more and then I really want to hit on where you guys are going, your success so far in L2. And I definitely want to compare you guys to a couple of other players in the market to contextualize this a bit. But you mentioned perpetual swaps, you gave a great overview and they rely on two critical aspects, right? An index price and a funding rate? Can you describe how the funding rate allows the perpetual swaps to trade in line with index price? I think some people may get confused on how that actually works.

Antonio (10:08):

Yeah, absolutely. So, the first component you mentioned just the index price, so the first thing you need to know if you’re creating a synthetic contract with the intention to track the price of an underlying asset is what is the price of that underlying asset? And all the index prices is the price of that asset. So the index price basically tells you what the price of Bitcoin is. And on dYdX, similar to a lot of other exchanges, we effectively get that from an accumulation and [inaudible 00:10:37] prices on a bunch of different top tier exchanges with the most liquidity. So, okay, now we know what the price of Bitcoin is, how do we make our synthetic contracts, our perpetual trade at the price of Bitcoin? How you do it is you use this financial concept called a funding rate.

And the funding rate, I think, people get confused about it sometimes but all it really is, is an interest rate effectively that’s paid out between those who are long the contract and those who are short the contract, and it could go either way. Sometimes longs pay shorts and sometimes shorts pay longs. And the main way that the funding rate works is to stabilize the price of the perpetual. And it does that through incentives. So consider the case where the price of the perpetual is trading too high. Say the price of Bitcoin is $50,000 and your perpetual is trading at $51,000 or whatever the case is. So you want to drive the price of the perpetual contract back down to the price of regular old Bitcoin.

The way you do that is you make your funding rates, take the people who are long and make them pay the people that are short, kind of this dynamic interest rate or this funding rate. Now you basically created this financial incentive, for more people to go short because they’re getting paid, right? So this incentivizes more people to sell, to go short, which drives the price of the perpetual contract down, back to the index price. And if the price of the contract is too low, you just do exactly the opposite thing where you make those were short pay those were long, to incentivize more people to go long.

Tom (12:16):

Your explanation makes it so easy. So basically if there’s more longs than shorts, the longs are paying a small fee of the shorts to incentivize them to close up their positions or take the other side to return back to the index price. Is that right?

Antonio (12:30):

That’s mostly correct. It’s actually, just by definition zero sum. So there’s always exactly the same amount of long as there is short. Really the thing that you care about is what is the price that the perpetual is trading at? And is it too high or too low relative to the index price? But it’s basically right.

Tom (12:46):

Got it. No, that makes sense. And I guess in a perfect world thinking more robotically, you want this to come back to its index price relatively quickly but you also have a mass of people around the world with open positions that need to react and change their positions, I guess. How do you build in a model that… The interest rate on the funding rate, how do you build that so it incentivizes people but it’s also not too, I guess, damaging to one side?

Antonio (13:16):

Yeah, that’s a great question. And I think this gets down a little bit deeper into the technicalities of how exactly this bonding rate is calculated. It’s a reasonably complex formula. You can find out more about it on our help docs and if look at FTX and BitMEX and people who support this as well. But effectively how it works is like the farther away it’s trading from the index price, the higher the funding rate is. So the farther off it is, the more of an incentive there’ll be to drive the price up or down and back towards the index price. So it’s a bit of a balance, right? Like you say, you want to drive the price back to the index price on some reasonable time horizon and of course you don’t want to trade in too far away, ever, from the index price.

So the funding rates can scale up quite a lot, actually. Historically on BitMEX, we’ve seen funding rates up to… I don’t even know, probably like 200 or 300% plus APR. So it can be quite significant. They’re a lot lower. And then of course on the flip side you don’t want your funding rates to be too, too volatile because then it just makes it harder for long-term holders to hold these products and not get destroyed by the funding rate if they’re on the wrong side of it.

Tom (14:35):

[crosstalk 00:14:35].

Antonio (14:34):

But that being said, the interesting thing about the funding rate is that there’s a lot of arbitrage that’s available on the funding rate too, right? Say like dYdX has a funding rates that’s something ridiculous, like 200% APR. And then back on FTX, FTX has a 10% funding rate or something a lot lower. Arbitragers can really step in to drive the price of dYdX back down to something reasonable. And they’re incentivized to do that because of this funding rate spread. So it’s actually really healthy for the ecosystem and that’s something that goes on quite a lot to equalize things across exchanges.

Tom (15:10):

No, that’s fair. And, I guess, how long in practice for new traders or new people that might want to try out dYdX, how potentially impactful can a funding rate be if you’re on the wrong side of the trade or just the offset side of the trade? If I put up $10,000 and the funding rate is against me, in a couple hours, is it going to have a noticeable effect on my principal? Or is this something that would take a considerable amount of time? And I know it potentially varies with how off the price will be, which impacts, obviously, the funding rate percent.

Antonio (15:43):

Yeah, absolutely. So I think for us as a relatively smaller exchange compared to the Binances and BitMEXs of the world, it does tend to be a little bit more volatile, though it is stabilizing a good bit. I looked at it earlier today and it was roughly on the order of like 30% APR or so. So if you’re trading or holding a position on the order of a few hours, it shouldn’t be too impactful. If you’re holding a position potentially longer than that, maybe something more to consider. But again, I think we point to working with a lot of these more programmatic traders who are really incentivized to take advantage of these arbitrage opportunities. So I don’t expect the volatility on our funding rates to last for [inaudible 00:16:25] much longer. And I think it’s already in a pretty reasonable place. That’s a good question though and definitely something to consider.

Tom (16:30):

That’s totally fair. And if we’re talking about the lowest common denominator, the everyday trader who wants to come on, who wants to get exposure because eventually you want to attract the masses to dYdX, what’s the argument to the long only side of things? Like, “Hey, come take out a long [inaudible 00:16:46] on BTC,” but my friends might push back and say, “Hey, you know what? I could just buy BTC on Coinbase, I don’t have to deal with potentially negative funding rate,” is the quick answer that, “Hey, you can just take out more leverage.” Or is there a better answer for them?

Antonio (17:00):

I think that’s most of the answer. Yeah just leverage and therefore, I guess, the concept or how we call it is buying power, which is just the same thing but said another way. And that example I gave before, I was like, “Well do you want to hold just your $100 worth of Bitcoin on Coinbase?” And maybe you do, that’s a totally reasonable strategy but if you want to trade more actively, now you can get access to much higher amounts than you otherwise could have.

Tom (17:25):

Yeah. Now that makes a lot of sense. Antonio, thanks so much. Rob, I know you want to jump in on some of the L2 questions, I’ll see to you.

Rob (17:33):

Yeah. So I wanted to briefly get an introduction to why you guys chose ZK-rollups as your design and just walk us through that. That’d be great.

Antonio (17:44):

Yeah, absolutely. So maybe first I can give a really quick overview of what zero-knowledge roll-ups are, and then I’ll get into the question of why we think they’re really optimal for our product right now. So basically the ways that zero-knowledge roll-ups work is you take some data, and in our case, this data is, say, all the trades we want to execute on dYdX in the given timeframe, say like for the past hour or so. And then you have this data and then you use this magical math on them basically. It’s a very complicated. I don’t really understand exactly how zero-knowledge proofs work.

But therefore that’s our partnership with StarkWare. Anyways, have this data, run this thing called a zero-knowledge proof on them. And then what that basically gives you is this constant size data object, which effectively proves, mathematically and cryptographically, that all of the trades in this batch happens, they are all valid, all the positions are collateralized after this. Everything you might want to prove as an exchange is proved by this proof. But the cool thing is after this proof, the thing that you get out of it, this proof, is constant sized. And what that means is that it doesn’t matter how many trades you put into this batch. There could be one, could be a hundred, there could be a million. And the size of this proof would be exactly the same. And effectively what you do with that proof is you send it in a transaction to regular old Ethereum and then you have a smart contract on regular old Ethereum that knows how to verify the proof. And then effectively, as long as the proof is valid, everybody’s balances are updated as per all of the trades that happened in that batch.

And this is really cool because now we can multiply the scalability that we have by a potentially really, really large amounts because it doesn’t matter how many trades you’re putting into this batch. It’s always going to be the same proof size and therefore the same gas usage. Anyways, getting to the question of why did we use zero-knowledge proofs as opposed to some other scaling technology? The main ones we considered were, first of all, obviously, zero-knowledge proofs, we considered optimistic roll-ups and the leader in that is optimism right now. And then we also considered other layer one blockchains. In terms of why not other layer one blockchains? The biggest reason…

Well, I guess it was twofold. First of all, I think a lot of them are not super production ready yet or at least are not as heavily tested as the work that StarkWare has already done. One of the really big things that drew us to StarkWare zero-knowledge proofs, was that they’ve actually been live in production for, I think, over a year now. StarkWare has been working with another decentralized exchange called DiversiFi, and they’ve been powering their exchange for that entire time. One of the big, I think, misconceptions people have about zero-knowledge proofs is that they are optimal, but they are not really ready for production yet, where they’re very complicated. And I think this is exactly empirically wrong because we’ve seen DiversiFi has been live with StarkWare for over a year now, dYdX, of course, we just launched a couple of weeks ago.

But already zero-knowledge proofs and the language that StarkWare has called Cairo, is able to support really, really complex applications like dYdX and perpetual is just inherently one of the most complicated financial things that you could build in DeFi. And they’re already live on zero-knowledge proofs today. Getting back to the point on layer one blockchains, so StarkWare is live already. Our users were really facing, like everybody else to DeFi, just massive issues because of gas costs. A lot of times on layer one it was costing our users upwards of a hundred, sometimes I literally saw it be as high as $2,000 in gas fees to make a single trade on dYdX, which is just absurd. Who’s going to use a product where you have to pay hundreds of dollars in fees to make a single trade? So of course that was really holding our product back.

So it was really important for us to solve this right now or as soon as we could for our users. It wasn’t something that could wait so the production readiness was huge. Other factors for layer one blockchains, a lot of the wallet infrastructure and also the developer ecosystem around the exchange [inaudible 00:22:13] isn’t quite there yet. And a lot of them struggle with cross chain solutions as well. So I guess the TLDR there is, I think they’re not quite ready yet, potentially interesting in the future. In terms of why StarkWare over optimistic roll-ups, I make the same point basically, just that optimistic roll-ups aren’t quite production ready yet. I believe optimism is currently running in limited production or [inaudible 00:22:42] environments. Synthetix is working with them. It’s definitely exciting but again they’re not totally public yet.

And then the second issue there, which actually makes quite a big deal if you’re an exchange, is optimistic roll-ups have really long withdrawal times. Basically how it works on optimistic roll-ups, is you request to withdraw and then you can’t really withdraw for roughly a week or so after you request the withdrawal. There are ways to get around this and you can use a central liquidity provider to front withdraws but the issue with this is that the liquidity provider has to have capital proportional to the entire week’s worth of withdrawals on the system. Which even for us was a huge amount of capital and imagine if we scaled from here. So that was tough. I think optimistic roll-ups, while exciting, are also just a little bit less proven than zero-knowledge roll-ups. Ann additionally they are more based on game theoretic guarantees, whereas with us with StarkWare, cryptographically you can prove that all of these trades are valid. You don’t have to rely on withdrawal… Sorry, challenged periods or anything else like that.

Tom (23:52):

Antonio, it’s a great answer. You summed up a lot of complex technologies really well. I guess the other question here for you is that, the other technologies you mentioned, let’s say, looking at a zkSync, we’re looking at optimism, they’re not totally live yet; zkSync isn’t live yet to my knowledge. Optimism is kind of live in a limited way with Synthetix. But from a business perspective, it doesn’t make sense in my mind for you to wait for another player because you could potentially be waiting months or years when you’re ready to go today. Is that a good way to think about it? Or did you choose StarkWare because it, overall, is just a superior solution, overall. Because I know the [inaudible 00:24:35] has been really bullish on things like zkSync because, well, potentially not zkSync but the ZK-rollups just because you get that passive security without having committee and things like that. So just wondering your take there.

Antonio (24:47):

I think it’s both, basically, you have your cake and eat it too because it’s like [inaudible 00:24:55] says, I think it is a pretty optimal end state for scalability. It’s just this magical math that you can take a linear amount of things, improve them in a constant amount of time, is pretty wild. So the scalability, potential throughput with scalability is really high and certainly there are still improvements to be made, right? It’s not just the end state of all scalability solutions in terms of optimizing the proofing engines and things like that. But definitely I feel like it’s really promising for the future. And like I was getting at before, it is the most production ready right now. So why not go, right now with what you think will be most optimal in the future too?

Tom (25:32):

No, I appreciate that. That’s great [inaudible 00:25:35]. And Antonio, I’d be remiss not to play devil’s advocate here for a second because we have you on, I definitely want your take on this. If you had to… Let’s say you had a nation state actor with not unlimited resources but will say a lot and intent to take you guys down or something or intend to take down every perpetual’s project, whether it’s launch on StarkWare or others, what exactly could somebody do to manipulate your system? Is there anything that they can do with StarkWare, with another committee, is there anything they could do with their site? Now what would the attack vector be? Because I guess a lot of people are wondering where the centralization risks are with the different L2s and for you guys you’re handling a lot of user funds, so it definitely calls that into question.

Antonio (26:19):

Yeah, absolutely. And I think this gets at what I was saying before [inaudible 00:26:23] state. So let me first start with, I guess, what the state of the world is and then I’ll talk about where we’re going over time. But current state of the world right now, dYdX is what’s known as a hybrid decentralized exchange, which means we have some central components and some decentralized components. Decentralized components are, of course, the smart contracts that run on the blockchain and all of StarkWare’s proving engines and stuff like that. Central components are, basically we run the order book and the order matching system in a central way right now, for performance reasons. And so that’s basically the state of the world right now. And then I guess other main centralization factor on StarkWare’s side is they run a central proving engine right now. StarkWare basically is running this proving engine.

So current state of the world right now, basically what some attacker, or a nation state or something could do, there’s effectively two different classes of things they could potentially do. One is possible and one is not possible. Effectively the thing that’s not possible is they cannot, or anybody cannot steal user funds basically or alter… So both, they can’t steal user funds and then they also can’t alter the ongoing contracts effectively. And the reason for that is that there is effectively a backdoor where you can go directly to the smart contracts that are running on Ethereum and always be able to close your positions or trade or withdraw your funds. So that’s why the system is totally non-custodial. The thing that could potentially happen is trades through our matching engine and through our liquidity, could potentially be censored by… Also, if we wanted to do it for some reason or some nation state that were putting pressure on us or whatever’s going on there.

So that definitely could happen right now. And that’s the current state of the world as we have it right now. One of the big things we’re going to be focusing on going forward is further decentralization of the protocol. And I think this is really a big focus on both our and StarkWare’s side. For us really the name of the game and the thing we have to solve is being able to fully decentralize. I would call it the liquidity model, whether that’s… We have some ideas about this, whether that’s building an on chain order book, shifting to more requests for quotes systems, interesting stuff going on in automated market maker world.  But some way or another, we need to get rid of, basically, this central order book and central matching engine on some time horizon. And that’s going to be a big focus for us over the next year or so. And then on StarkWare’s side one of the main things that they’re working on that we’re really excited about is building out the network of prover engines. So there’s not this single point of failure or, really, single point of, we call it censorship on, or potential censorship on the proving engine side as well.

Tom (29:22):

That’s a great summary, Antonio. So basically on the first point, just the order matching and the order book that’s run on, say the cloud, even if somebody were to infiltrate that for some reason, user funds are totally safe. It would just… That’s what’s, I guess, the UI, right?

Antonio (29:34):

Yeah. Basically, basically. It could lock people out of using our website basically but it can’t mess with, like I said, anybody’s contracts or funds that they have on the platform.

Tom (29:49):

Got it. Okay, cool. And then just one follow up on the other attack vectors on the StarkWare’s side, is the provers that you’re describing, is that similar to the data availability committee? Because I think people point to that as like a-

Antonio (29:49):

Mm-hmm (affirmative).

Tom (30:02):

… centralized entity but in reality, I think it’s not centralized because users are always able to retrieve their funds directly from the program, I believe but we would love your take there.

Antonio (30:14):

Yeah, absolutely great questions. And I guess to dive in down to STARK, which is great, I’m happy to talk about it. But there’s basically two things on StarkWare’s side that are different, that they operate. So the first thing is what you were talking about, effectively, the concept of data availability and in our use case, effectively what data availability means is where do the user balances live. And I’m trying to think about how to explain this without getting too technical. But I guess at a high level, what’s actually stored on layer one, Ethereum is what’s called a Merkle root, which is basically, you take all the balances on the system, put them in this tree structure which has basically just one value which can prove all of the balances. And that’s the only thing that’s stored on the layer one blockchain and that’s, again, where a lot of the scalability comes from.

So this is great but then the problem is, “Okay, well, that’s great. We have this root. They’re proving everything but what if we, users of dYdX don’t actually know what everybody’s balances are?” You need some information about this vertical tree to effectively be able to withdraw. So where does that live? Where does the entire tree structure live? Because we can’t put it on layer one Ethereum because… Or at least in the smart contract state of layer one Ethereum because that’s too expensive. And there’s two solutions to this and StarkWare supports both of them and I’ll talk about which one we use and why. The first solution is what you get at, Tom, where you could effectively have some committee of members basically promise that they’ll store this information for everybody. This is like a pretty reasonable solution, right? Probably not all of the… I’m not sure how many there are but I think the five to 20 or so, data availability members will go offline and probably one of them will give you your data. So, that’s pretty good from a decentralization perspective.

And then the second mode that StarkWare supports is what’s called roll-up mode. And roll-up actually means something really specific. I think the term is thrown around a lot in layer twos. But what roll up means is that you actually put the data effectively, all of the leaves of this Merkle tree and everybody’s balance basically, on Ethereum. But where you put it on Ethereum, is in a much cheaper state on Ethereum. You effectively just put it in the transaction data on Ethereum, which is a lot cheaper because smart contracts can’t use this information but that’s okay, right? You don’t want smart contracts to use this information, just all of the users at dYdX need to be able to use it. So, I’m sorry, I hope that wasn’t too technically complicated, but-

Tom (30:14):

No just-

Antonio (32:52):

… that’s effectively what the data availability trade offs are. And we, dYdX, use StarkWare’s roll-up mode. So we actually have full decentralization of our data. And then of course users can use that data to be able to withdraw at any point later on.

Tom (33:09):

No, that’s an awesome explanation. So on the role [inaudible 00:33:13], you said you’re storing the data in a much cheaper spot. So basically I think the way I understand it is that you’re storing the data basically as a list but you’re not actually asking a theory in itself to run all of these transactions. Is that the dumb way to think about it?

Antonio (33:28):

Kind of, basically. Like when people sometimes put messages on Bitcoin or something like that and you can see them on the block explorers?

Tom (33:37):

Yeah. Yeah. Yeah.

Antonio (33:37):

It’s that basically.

Tom (33:39):


Antonio (33:39):

It’s like you put it in there [crosstalk 00:33:41].

Tom (33:41):

So the data’s always viewable to outside parties even though Ethereum isn’t, say, doing all of these state transitions?

Antonio (33:49):

Yeah, exactly.

Tom (33:50):

That’s awesome. Okay. So you guys are… So if somebody points to you guys and says there’s a centralized component within STARK, where for dYdX there really isn’t at all.

Antonio (33:59):

Yeah. So there’s definitely not on the data availability side. And again, that’s why the system is fully non-custodial. The thing that still is central on StarkWare’s too and as I mentioned, they’re working on this, is the prover basically. Who is running the zero-knowledge proof to be able to take this list of trays and transform them into this zero-knowledge proof. And then that’s currently being run by a STARK brother company. But they have plans to basically build this out to a network of a bunch of people who can do these proofs. But again, it’s basically the same trade off as we already had on our central matching in order to book. So we’re not losing anything there. All they could potentially do is stop someone from using the website basically. But you can still always withdraw course.

Tom (34:41):

That’s awesome. And how would it work as they decentralize that out? Does that mean you have hundreds of provers or what would that look like?

Antonio (34:52):

Yeah, it’s a great question. I’m probably not going to have as great an answer on this as StarkWare themselves would, obviously. But my understanding is that it would be similar to running a blockchain node like mining, where instead of putting all of the transactions on Ethereum into blocks and stuff like that you’re just batching effectively blocks still of transactions. But you’re going to have to run a zero-knowledge proof and then you put the proof on chain. So probably on the order of 100s or so.

Tom (35:25):

Okay. And sorry, this is awesome color. And just one clarification, that the prover themselves they’re just running all the transactions and posting it to Ethereum, right? I guess the question is obviously if StarkWare got hacked, then they could mess with what they’re posting to ETH’s layer one?

Antonio (35:45):

That’s true. They could definitely mess with it but the only way they can mess with it is by censoring people. The zero-knowledge proof effectively guarantees that they could never put anything invalid in there. So they couldn’t put a trade that somebody didn’t sign or they couldn’t make a position undercollateralized on dYdX. They could potentially, I don’t know, if a random person trades and for whatever reason they don’t want to include that trade in the proof they could do that. So it’s more denial rather than invalid state.

Tom (36:16):

Got it. Okay. No, that’s awesome. Really interesting discussion going down the STARK. I definitely got off on a tangent there but I appreciate your answers.

Antonio (36:25):

Yeah, absolutely.

Tom (36:26):

Rob, I think you had another one too.

Rob (36:29):

Yeah. So I want to [inaudible 00:36:30] back into the product a little bit. The team announced the closed alpha back in February with over 100,000 users on the wait list and recently launched on for production. So I was wondering if you could explain a little bit how traction has been as well as how has the community received the new PERPs product?

Antonio (36:50):

Yeah, absolutely. So I think it’s been really strong so far. As you mentioned, we had around 100,000 signups for our alpha, which was super exciting. And that’s translated so far into, I believe last I looked around 12,000 or so signups on the new product. And we have a lot of things rolling there on like improvements we’re making to the product to improve that conversion as well. Optimistic about that but even with the numbers we’re already seeing we’re really seeing a high number of users that are using the product. Maybe I’ll let David jump in after I finish here. I think he has the more updated numbers. But I think we’re seeing roughly on the order of, I don’t know, 1500 active traders per week. But yeah, David, do you have more insights on some of the metrics we’re seeing there?

David (37:36):

Yeah. I think in terms of weekly active traders we’re seeing around 1500 or so weekly active traders. A lot more takers than where you need takers than makers, about 1300 unique takers last week and about 500 or so unique makers. So definitely seeing taker volume grow, which ultimately we think is really important to attract more macro liquidity to the platform. Overall, we’re starting to see really strong volume growth. This past week we had three days where we did 30 million plus in volume. And then on April 18th we did $40 million in volume. So this effectively is the most amount of volume on any kind of layer to roll up to date. And so we’re excited that 10, 15 days or so after a public launch we’ve already broken a volume record. And then this week we also announced that cumulatively since launching the Alpha we’ve done $300 million in cumulative volume.

So definitely seeing rapid growth there overall to largely when you look at the volume by market, most of the volume is driven by the ETH-USD pair, followed by Bitcoin. We’re starting to see increased trading volume on the new markets that we list. Last week we launched two new markets, Uniswap and Aave, and have seen good traction there. And then our goal is to launch one to two markets every week for the next few weeks and targeting 30 to 50 markets over the course of this year. And [inaudible 00:39:33] lists, A, the pair [inaudible 00:39:38] your top DeFi tokens and then some of your top layer one tokens. And so starting to see overall positive momentum for cost metrics that we’re looking at.

Rob (39:56):

That’s great. And now can you break it down a little bit, the differences in costs from L1 and L2? How much, I guess, gas fees are a user saving by switching over to the L2?

Antonio (40:09):

Yeah, I think the thing on L2 is that we’re actually able to offer our users zero gas fees when they’re trading on the product, which is pretty exciting I think. We instead just charge like a regular old maker-taker, volume weighted fee schedule like we’ve seen really successful on centralized exchanges. And the reason we’re able to do that is just getting back to all the stuff I was talking about before, where we have pretty predictable and constant costs for our gas spends. And only gas spend is for putting these batches that start per sending on chain. But we can reason out our volume and understand that these flat fees that we’re charging will more than exceed the amount per dYdX trading anchor depending on gas.

Rob (40:58):

Okay. Now that makes a lot of sense. And now I feel like I have to ask about, David already mentioned the April 18th volume. Just wondering if you can give a little bit more insight into the recent crash, the unwinding of a lot of liquidations, I believe the total was 10 billion for centralized exchanges. And how did dYdX do during that time period?

Antonio (41:19):

Yeah, I think this was a really exciting thing where it actually went really well on our side. We always have some alerts for ourselves on their engineering side, just when these speed crashes happen because that’s usually the time things break. But I think this time it didn’t, which was especially exciting because we literally just launched this product two weeks ago and we’re already seeing this really big crash. And especially if you’re running a leveraged exchange that leads to a lot of liquid liquidations, as you say. I forget exactly how many liquidations we had on the system. I think it was five to 10 million or so. But the exciting thing was that the system performed really well overall. One of the really big improvements that we made to the system was not just in gas fee reduction, but it was also in the performance of our price oracles.

And what price oracles are, are basically telling the protocol what the index price is and that’s the entire thing. But the problem with price oracles on layer one Ethereum is that they’re super under-performance. So a lot of times it’ll take upwards of five to 10 minutes plus once a crash happens for that price to be reflected in the actual protocol. But we’ve gotten that down to single digit seconds on layer two. And that’s what’s really allowing us to offer a higher amounts of leverage really safely. And that culminated on Saturday in the fact that our insurance funds, which effectively acts as a backstop, is the protocols losing money, it’ll come out of the insurance fund first. But our insurance fund actually made money during that event, which was pretty exciting. Which basically just means that we’ll be able to liquidate everybody really efficiently. There was sufficient liquidity to do these liquidations on the order book. And the system performed really well overall

Tom (43:12):

Antonio, we have 15 minutes left because we took a little bit more time on the technical stuff, which I really appreciate. It’s [inaudible 00:43:20] to hear it from you guys. I just wanted to dive in a little bit just the differences on you guys versus other projects out there. One of the things that stands out for you guys versus other projects, obviously your traction in L2 and all the things we’ve discussed. But one of the things that makes you guys stand out is just your margin type. You guys allow for cross margin whereas a lot of other projects don’t. Can you explain what that is for users and what the benefits are?

Antonio (43:46):

Yeah, absolutely. So this is another really important feature that was unlocked by layer two. But what cross margining is, in a pretty simple way, is you can just use one pool of collateral to collateralize every different market you might want to trade on dYdX at the same time. And this is different from the opposite of cross margining is something known as isolated margin. What isolated margin is, is for every different position you might take or every different market you might trade on, you’d have to collateralize that position independently. But effectively what this has allowed us to do is just create one dYdX account. And when you come to dYdX the first thing you got to do is just deposit money into your accounts. And that’s basically it. You don’t have to move money around into different accounts. So anything like that or worry about collateral. Sorry. Worry about margining after that.

After that, after you deposit, you can just start trading any of the markets that we add. And as David mentioned, we’re really planning to scale up quite a lot the number of markets we have on the system, especially by the end of the year or so. And one of the problems we ran into on layer one is that we only supported isolated margining. And that was really due to gas constraints on our smart contracts on the system. And the problem there was that if you wanted to trade on multiple markets at the same time you had to deposit collateral separately for each one of these markets. So if you wanted to trade both Bitcoin and Ethereum you’d have to deposit 1000 USCC of collateral into the BTC perpetual and then separately deposit your 1000 USCC collateral into the ETH perpetual. So this was pretty bad for users. A lot of users want to trade on multiple markets at the same time. But it was especially in emphasis bad for market makers. And this is really important, actually something that goes on below the hood because market makers trade too.

And they also especially want to trade on every market that is offered on the exchange. And of course there has to be liquidity on those markets. So the problem on layer one was that we had a hard time building liquidity on the long tail of markets because we only supported isolated margining. And therefore say dYdX had 50 markets and they also had isolated margin only, market makers would have had to deposit 50 times into every one of those different markets, which is obviously ridiculous and crazy cost of capital. And that was the thing that was really holding us back from launching new markets on the platform. Now market makers, like everyone else, just deposit once, can start quoting on every different market they met on a trade on. And it’s super easy for us to add new markets. All we need is basically an index price and then some market makers to start quoting that market and then we can ship the market after that. So that’s really the thing that’s unlocking a lot of new markets on the platform. And also it’s a great value add for capital efficiency for traders.

Tom (46:38):

No, it’s awesome. Just thinking through that and you answered this already but it’s just really hard to get access to the long tail of assets if I have to see each one with collateral. I mean, if I go in dYdX I could basically just use that collateral for the long tail. Yeah, that’s incredible.

Antonio (46:54):

Yeah. And that we’ve already really seen this play out in our volumes so far. We had three perpetuals on layer one, the two big guys, Bitcoin and Ethereum, and then we had Link which we’re excited about. But I guess for our first market we were just trying to get into the long tail there. And the layer one Link perpetual didn’t really have that much volume compared to the other markets because you would have to deposit to that specifically. But one of the things we’re excited about is we’re already seeing really strong volume [inaudible 00:47:24], the markets we use, low long-tail markets we have on the layer two platform, especially compared to layer one. And I think that bodes well for when we add the long tail of markets, which is also important to attract new traders.

Tom (47:36):

Yeah, for sure. The cross margin makes it so easy from the UI perspective, right? Do you trade that off though with a lot of risks because you’re not siloing the platform risk for each asset or each PERP? Or is that not as much of an issue? I don’t have a great answer there.

Antonio (47:53):

Yeah. It’s definitely a reasonable question. And I would say it’s not objectively better in all cases. Certainly cross margining does make the product a lot simpler because it’s just deposit then trade anything you want. One of the things that other exchanges mainly FTX offer is this concept of creating sub-accounts. So you could create a sub-account that has its own margining, if you wanted to, say, isolate some of your portfolio from the rest of your portfolio. We plan to support this. We don’t quite yet on the product. Plan to support this hopefully in a month or two. And then of course you can also just always use separate addresses to create isolated margin separately.

Tom (48:34):

It makes a lot of sense. And switching gears a little bit and if anyone in the crowd has a question just let me know, just raise your hand. But just one other question, you have about, I don’t know, maybe eight or nine peers on decentralized side, not including the centralized side, specifically in regards to PERPs. I feel like everybody’s competing to go on L2s but I don’t see a lot attempting to go cross-chain. Do you see any value there or is there any plans to do that? I guess my next question.

Antonio (49:06):

Yeah, it’s a reasonable question. I would say right now probably not a huge reason to do that again because we’re synthetic. So we can just start quoting any assets that’s on any chain. So I guess the main value proposition there would be if people have funds that are on other chains that they want to deposit to dYdX and they can’t do so because we’re on Ethereum. But I don’t really feel like that’s the case for the most part right now, every exchange, every centralized exchange will let you withdraw [USDC 00:49:36] via ERC20. Potentially still the layer one gas costs are still a minor issue I would say. Because although users don’t have to pay them when they’re trading, they do have to pay them when they’re signing up to the platform. So it’s, I don’t know, 30 bucks to create an account or something, which isn’t the end of the world as TFI goes, of course. But we still want to continue to improve that over time. So I guess to answer your question, no urgent need to do cross chain right now but we’re open to it in the future if we have to.

Tom (50:08):

That makes a lot of sense. And another totally separate question or just on fees. I think your fees on your protocol are extremely low. But my understanding is that as you go to layer two people are going to shift their glare from what they’re paying on gas to what they’re paying to the protocol itself. Are you guys competitive on a fee structure versus your peers? Or how does that work?

Antonio (50:33):

Sure. I guess it depends on who you consider our peers. But I think we’re even reasonably competitive on fees with centralized exchanges. I think our fees right now are a bit higher than they are on centralized PERP exchanges. But they’re also volume weighted. So as people are doing more volume and are likely caring more about their fee tier, they’re incentivized and can get into a lower fee tier, which is pretty competitive with centralized exchanges. We charge 20 BIPs I think right now on the intro fee tier. But that goes down quite a lot as you’re doing more volume down to I think the lowest is 7.5 BIPs, which is pretty close to, that’s basically BitMEX next charges. So pretty competitive with centralized exchanges and I think way more competitive than anything that’s not on any perpetual protocol that’s not on the layer two right now. So I think pretty competitive across the board on fees.

Tom (51:29):

Yeah. That’s fair. And we have a couple minutes left. I just want to switch to the community side of things. When do you think the real movement will shift from centralized exchanges to decentralized platforms? I guess I don’t mean from scale or fees or long tail assets or features. I guess I just mean just the community movement. From I don’t want to use Coinbase as token holders exchange or something like that. I want to move to a decentralized one. I want to move to one that potentially I could own part of in the future, things like that. And of course you could buy Coinbase stock, but I think you know where I’m going with this. When do you think the real community transition will take place from centralized exchanges to decentralized versions?

Antonio (52:11):

Yeah, absolutely. So I guess touching on the elephant in the room first, certainly we’re really excited about decentralized governance and a lot of things that are going on there and decentralized community ownership. And that’s something we are definitely looking into and, like I said, have plans to fully decentralize the product and its ownership on some time horizon. So I guess how do we get there over time. And what’s holding PERPs on DeFi back right now relative to small trading. And I think it’s just something that builds up over time, the financial complexity of a given user base. And this is something we saw happen on centralized exchanges on crypto where, first of all, the spot exchanges got really huge. I mean, Mt. Gox and then Coinbase. And then one thing that was interesting that happened while I was at Coinbase actually is we became no longer the biggest exchange by volume anymore in crypto. And we were really quickly surpassed by Bitfinex because they offered margin trading.

And at that point in time the financial sophistication of crypto users in general made it such that, we’re willing to use margin trading. And then, like I said, the thing we’ve seen happen just in the past year, just quite a while in crypto terms, is that derivatives have become more popular than everything else in crypto. And I think we’re going to see a similar transition happen in DeFi as well. It just takes a little bit longer because the products get more sophisticated. So they’re just fundamentally more complicated to build a DEX for perpetuals than it is for spot trading. So it takes a little bit longer.

I’m pretty excited about where we’re at with the current product. But that’s by no means the end state. It’s going to continue to improve there. Then also continuing to our next big crossing of the chasm here is getting more users from centralized exchanges to shift over to what we’re doing in DeFi and DeFi PERPs. And I think that’s really going to happen over the next one to two years or so. And I think we’re pretty excited to be at the forefront of that.

Tom (54:19):

That makes lot of sense. And one of my last questions for you, when you were at Coinbase, did you know that they potentially weren’t going the PERP route or did you even have this in your mind as something to build? I guess I’m just wondering because you were literally at a giant and to leave couple of years later, I know you had some stuff in between, but to think that they won’t eventually do this or they can’t just flip a switch and build this out, it is daunting to make that move. But I think the timelines might be a little different.

Antonio (54:50):

Yeah, absolutely. I guess for me and my personal journey from Coinbase to starting my own company was really driven by just that desire to build something impactful and be able to lead that and build that myself. So I knew I wanted to leave and start my own thing at some point. I guess the question of whether Coinbase and people there knew about PERPs and margin trading, we definitely knew it was going on with Bitfinex and like I was saying in terms of them really quickly surpassing us in terms of volume. I tell stories of our team sometimes. But I think one limitation we had at Coinbase was that we weren’t quite open-minded enough, at least in my opinion, about new interesting things that were happening in the space. And especially if they were what we deemed as, I don’t know what the best way to say this is, as sketchy, I guess, on Bitfinex and the margin trading that they were doing there and the really high amounts of leverage.

And we were like, this is a generalization but we were like, “That’s ridiculous. This is [crosstalk 00:55:59]. This is going to blow over.” Which is clearly wrong. And I think we could have definitely been more open to understanding the financial shift that I was talking about, the use cases for trading with really high leverage and stuff like that. But it’s always going to be hard for Coinbase to do that as just an exchange that also offered US dollar fee on and off ramps. So I think for me personally I didn’t really know that much about derivatives and things before I started dYdX. The angle I came at it from was I was super excited about Ethereum. Was convinced it was a new paradigm for computing where you can for the first time build these programs that execute totally autonomously deterministically and it’s not controlled by anybody. So I was like, “Okay, 100%, this is going to be something interesting to build on top of Ethereum.” But I wasn’t sure what it was at that point.

Took a look at what was going on in the space at that time and that was right around when Zero-X and Kyber and some of the first odd exchanges, decentralized exchanges were coming out. And I was like, “Okay. Well, think about finance as a stack.” So now we have decentralized money, we have decentralized exchanges, [inaudible 00:57:15] exchanges, what’s next? And it seemed like it was pretty obvious that it was margin trading and derivatives. So that’s the genesis of the idea. And I think a lot of that is really just timing and timing the market as to when this happens. And as I’ve been talking about it I think the shift is really happening in a big way right now. And we’re excited to be a part of that.

Tom (57:34):

That’s an incredible story. I’m going to chuckle in a couple of years if I see Coinbase potentially trying to acquire you guys. I think you guys are going to grow pretty fast and they probably won’t be able to but it’ll be fun. But Antonio and David and Rob, thanks so much for coming on. It was a great first episode into dYdX. Obviously a very complex area especially when you bundle in L2s. I think you guys just crushed everything at once. Looking forward to having you guys on again so we can go into different areas in more detail too.

Antonio (58:04):

Yeah. Thanks so much for having us. It was really good conversation.

Show Notes:

(1:40) – (First Question) Antonio’s Background.

(2:40) – David’s Background.

(3:45) – Rob’s Background.

(3:52) – Why The Perpetuals Market / Market sizing.

(5:01) – dYdX Overview.

(6:00) – What is a Perpetual Contract.

(8:51) – Thoughts on PERPs target.

(11:06) – How the funding rate allows the perpetual swaps to trade in line with index price.

(18:45) – Why ZK-rollups.

(26:49) – Thoughts on dYdX risks / Attack vectors.

(37:16) – How has the community received the new PERPs product / dYdX traction.

(40:38) – Differences in costs from L1 and L2.

(41:38) – Insights into recent crash / the unwinding of a lot of liquidations / How did dYdX perform during that time period.

(43:55) – Thoughts on cross margining / benefits.

(49:10) – Thoughts on cross-chain.

(50:40) – dYdX fees.

(52:00) – Thoughts on the world transitioning from centralized exchanges to decentralized platforms.

(55:00) – Thoughts on Coinbase offering perpetuals.