006

/

March 8, 2022

Decentralized Exchanges

with

Abe Othman, Co-founder of Shipyard Software

Apple podcast logoSpotify logoSpotify logo

In this episode, I sit down with fellow Shipyard co-founder Abe Othman to talk about all things DEX-related. This includes a dive into the history of AMMs (automated market makers), DeFi limit order books, and how next-generation DEXs are building on past successes.  

Why? Because DEXs process hundreds of billions of dollars’ worth in crypto each month, and are an integral part of the rapidly expanding DeFi ecosystem. They’re worth learning more about beyond the surface level stuff, which is why my conversation with Abe covers the deeper components of DEX design – not just the different types of decentralized exchanges, the risks and opportunities they present, and how they stack up against centralized exchanges.

Dr. Abraham Othman is the co-founder of Shipyard Software, a venture-backed organization that is launching a series of user-specific DeFi products. Prior to Shipyard, Abe was an original advisor to the Augur project, alongside Vitalik Buterin, and his 2012 PhD thesis, Automated Market Making: Theory and Practice, revolutionized the discipline and was cited in Uniswap's V3 whitepaper. Abe also created the first liquidity-sensitive homogeneous market maker, a key theoretical innovation of current market maker design, and served as the Head of Data Science and AngelList Venture. His numerous accomplishments have earned him a spot in Forbes’ 30 Under 30.

Mark Lurie:

Welcome to WTF Crypto, where we explore the crypto universe to understand what's really going on and how it affects you and your portfolio. I'm your host, Mark Lurie. And as a caveat, nothing in this podcast is legal or investing advice. Today we're talking about decentralized exchanges in crypto with Abe Othman. Welcome Abe, thanks for joining us.

Abe Othman:

Thank you, Mark. It's a pleasure to be here.

Mark Lurie:

So decentralized changes have started processing an enormous amount of volume on the order of $100 billion per month. That's an enormous number going through on chain peer to peer, peer to pool, decentralized exchanges. And traders really need to know about these because they need to know where to get at the best prices, what the different types of decentralized exchanges are, what kind of risks and opportunities they're signing up for when they use decentralized exchanges and how they compare to centralized exchanges. It is core to doing things with crypto.

Mark Lurie:

So today we're going to dive into all of that with one of the world's experts on the technology behind decentralized exchanges, Abe Othman. So Abe, could you give us some context on your history with decentralized exchanges and also just in general, what makes you such a guide on this subject?

Abe Othman:

Sure. I now coming on 11 years ago wrote a PhD thesis called, Automated Market Makers Theory and Practice. And automated market makers are really the heart of modern decentralized exchanges. Of course, at the time, 11 years ago, there was no crypto. There was no Ethereum. There was very limited ideas about what you could do with blockchains. And it's sometimes joke that people are doing research that 10 years later finds practical use. And that was the case for my PhD thesis, much my surprise, a decade later, this work that I had done for my PhD, and I've largely abandoned in my professional career suddenly became the most relevant thing of decentralized finance.

Mark Lurie:

Awesome. I'm looking forward to digging into that. So before we do, let's just hit some other highlights. And we should also flag our personal relationship. So Abe and I have known each other since college, we were freshman at Harvard. Abe went on to do his PhD in Computer Science at Carnegie Mellon. I believe he was a Google Research Fellow as well. And you started a couple companies along the way as well.

Abe Othman:

Yeah. So after my, or as I was finishing my PhD, I moved out to the Bay Area, started a company that went to market as Comfy. Who's like Nest for office buildings, which got acquired by Siemens, got pretty deep into machine learning stuff, was a running machine learning consultancy that got acquired. And then most recently, before we left, I think before we started the Shipyard, I founded the data science team at AngelList. So that has been my practical experience has moved fairly far away from what I did my PhD on.

Abe Othman:

My crypto involvement really started actually with a cold email I sent to the Auger team back in, I think 2013 after reading their introductory white paper on prediction markets and on Ethereum. And the amount of progress that has been made in terms of tooling from the environment that I saw, the first Auger developers working on in 2013, 2014 versus now is really remarkable. It was very, very rickety seven or eight years ago and now it's much more robust and much more secure as well.

Mark Lurie:

It has come a long way. In your research, your PhD research, Automated Market Making Theory and Practice has become widely read and widely cited and is somewhat foundational to this space. And that is also a big part of our thesis for starting a company together because Abe and I are co-founders of Shipyard Software, which is an exchange group for decentralized finance. And we are building specialized decks largely based on Abe's expertise. So we spend a lot of time together.

Abe Othman:

We do, and I treasure it. A lot of what people think about in terms of DeFi is an opportunity to rebuild the foundations of the financial system on a freer and fairer basis. And I think it's one of the things that motivates both of us. And the reason that coming out of my PhD, I didn't get to do anything with automated market makers is because the conventional financial system did not accept that as a modality of, it didn't slot nicely into what they were doing at Goldman or what they were doing at Morgan Stanley. And so as a result, there was no practical application in my work.

Abe Othman:

And I think it's frankly quite gratifying to see real practical applications of this research. And it has to come from this sort of trope of DeFi, where the financial system gets rebuilt. And it has been gratifying to me to see it get rebuilt in such a way that automated market makers are very prevalent in a way that they, in the typical financial role they're not at all. So that's kind of cool.

Mark Lurie:

Super cool. Okay. So before we jump into the intellectual history of AMMs, can we just level set a bit with what kind of volume, how widely used are AMMs today and why did Dexus exist in a model that's distinct from central limit order books?

Abe Othman:

I hesitate to quote statistics, because it changes all the time, but I will talk about the latter point, which is why are agent mediated exchanges that are like where these agents are written in code and running out on blockchain. So in the conventional financial role, a lot of exchanges, they run using limit order books. Why does that not really seem to work with DeFi? It's because of throughput.

Abe Othman:

And it's an interesting thing because the actual artifacts that run the centralized limit order books are incredibly sophisticated. They're some of the most advanced pieces of computer technology that we have. Because these are the actual systems that handle all of the requests from high frequency trading systems. So they're like, you can think of them as being an order of magnitude more sophisticated than high frequency trading systems. These are the most sophisticated pieces of computer, I would say the Java run time and the actual central limit order book systems that we have, those are the most advanced pieces of computer technology that we have.

Mark Lurie:

They're like this newest generation fighter jets, they're like the Indy 500 and just of systems. And just to be clear, a central limit order book, that's basically what people usually think of when they think of the stock exchange, the New York Stock Exchange, right?

Abe Othman:

Yes.

Mark Lurie:

There's a bunch of buy orders, a bunch of sell orders and they match at the marginal price and then they clear, and you're actually matched against someone else's specific order. That's a central limit order book, right?

Abe Othman:

And you can get a sense of it as well. If you go to Coinbase Pro and you just take a look at the, "Oh, I just want to watch prices on Coinbase Pro for a while." You see thousands and thousands of orders added, removed, hit, price changes, price fluctuations, and you're watching this on a lag, that's actually simplifies the flow. Somewhere, there is a computer that is doing an order to magnitude more operations than you're even seeing over your connection for all of these orders in the order book. And it is in milliseconds or even faster. It's a really advanced, advanced system.

Abe Othman:

And so if you try to take something like that, put it on blockchain where you're talking about a couple transactions per second, maybe at best, it doesn't work and it'll never work. If there's one kind of thing, that's clear it's that if there's enough mode of force behind it, that's the reason there is high frequency trading in stocks or on centralized exchanges for crypto is that people will always want to put more transactions through your system. Right?

Abe Othman:

It's like urban design, you're building a highway in Texas, so you add two more lanes and it doesn't solve the traffic because that means there's more housing developments and more people who want to drive. It's like, if you do increase the throughput, you'll just get more limit orders. And that is the challenge. So there is a deep sense in which limit order books do not work for DeFi. And not only do they not work, they will not work. It just is an inherently incompatible thing when you're working with a system that has to be less efficient, that just definitionally has to be less efficient than a centralized system.

Abe Othman:

So you have this real mismatch, right? These most advanced centralized systems that exist and DeFi that just has to be worse. So what are some alternatives to it? And that's where you get these automated marketing systems, which essentially-

Mark Lurie:

Sorry, one question. So why fundamentally does a blockchain have to be worse performance? I presume one reason is they have to do an extra step, which is consensus between all the computers running the blockchain. And there's no way you can ever keep up with a centralized computer that doesn't have to do that and is a Ferrari or an Indy 500 car. It's just an extra step that can't be competitive.

Abe Othman:

And that's correct. And there is a decentralization tax, right? Like normally it can be okay for many applications, but it's only when you start talking about the outer fringes of the most advanced centralized algorithms, the most advanced centralized computer artifacts, it just doesn't work. It doesn't and will not work. It like literally cannot work. If we had any advances, there would be immediately channeled into more traffic that would further break the system.

Mark Lurie:

I see.

Abe Othman:

You cannot like, I mean...

Mark Lurie:

And then that's also why, there's a is it good enough question because it can become a victim of its own success.

Abe Othman:

It will. Yes, absolutely. If you show up with the fastest and best DeFi limit order book for sharing crypto, what ends up happening is that people's stuff more orders in your system and then it breaks again. Or the transaction fees go super high, which one kind of thought experiment is like where the one active limit order book you do see for crypto in DeFi, that is running is open C. I mean open C often it has destroyed domain in Ethereum based on a very small number of non high frequency transactions. And like-

Mark Lurie:

And that's NFTs, that's unique NFTs so you can imagine if that were not unique NFTs with manual bid offers, it would break it, even it would it or completely overwhelm it.

Abe Othman:

It would. And even if you move to Polygon or something that was much faster, an L1 or 2 that was built for speed or throughput or something, you would just get more orders and it would just break it. And that's like the foundational challenge is that, and it gives me a deep sort of belief that there's no solution to the centralized limited book order problem in DeFi. And instead DeFi needs to use different methods to be able to perform these transactions and to scale.

Mark Lurie:

It makes sense. Okay. Got it. And last question, so you've mentioned to me that it's not just speed, it's also storage and other aspects, right?

Abe Othman:

And you can think about, okay, that is something where you can imagine alternative blockchains lowering the cost that gets much closer to what you get to, or, it's... But in terms of just raw throughput, folks demands for what they would want to use are just orders of magnitude higher than what I think any reasonable blockchain can go through.

Mark Lurie:

Okay. Got it. All right. So then there's an alternative?

Abe Othman:

Yes. So the way a lot of systems work, like Uniswap, or Clipper Exchange work are by essentially trusting, taking a model of the way that a market maker with a bot that the agent that matches buy and sell orders in the market would operate and embedding that within a computer formula and just letting the computer formula take care of this problem for you. So instead of having an actual algorithm go out and say, "I'd be willing to buy this much at this price. I'd be willing to buy even more, a little bit lower, even more, a little bit lower, even more, a bit lower." You say, "Hey, that actually seems like it makes a curve." So we'll just say, "I'm willing to buy on this curve."

Abe Othman:

And suddenly now you have this very efficient way of expressing... The challenge in a limit order book is if you have these expressions, you say, "Okay, well, this one got hit and now I need to readjust and say, okay, now I'm actually going to buy a little bit less," the formula just does that all for you. So instead of having to send 1000 messages every second, you have just transmitted the formula, the curve, and as a result, you can process transactions efficiently because you've transmitted a minimal amount of state on the blockchain to express this.

Abe Othman:

And you lose something, you lose this manual human ability to tweak and change. And you also lose some of the human ability to, like bad, you also lose some of the human ability to do some of the illegal or questionably legal things that we know market makers do, write spoof, for instance, when you put out fake orders and then withdraw them, or you lose that ability. You have to embrace the legibility of using and actually pricing according to a formula.

Abe Othman:

So as a system, as a whole, you actually get a different paradigm of working with it, you lose some manual control, you lose some of the ability to, honestly, I think it's fair to say, to cheat because you have to have this sort of formula that you're operating off of. And that's that a provocative way of thinking about it. But essentially the core idea of the automated market maker is replacing the manual human logic of how you would operate on one of these markets with a formula.

Abe Othman:

And all of these automated market makers rely on LPs, liquidity providers to finance the operations, to make up the gaps between the buy and the sell. And those LPs are essentially signing on, they're saying, "Hey, I like this formula. And I'm willing sign on for the, hopefully the stream of returns that this math formula produces based on the way prices are changing."

Abe Othman:

And the reason that I started researching this originally was actually very strongly motivated by the flash crash, which happened in 2010 where stocks dropped 15% in minutes and nobody really knew why. And then it rebounded back. And there was just a very weird and disruptive event for like an hour or two.

Mark Lurie:

And afterwards people moved on as if this was just a glitch and like nothing had happened, but no one really understood exactly what happened, but actually it was like a glitch in the matrix.

Abe Othman:

And what happened there, the reason that this glitch was exposed, was actually a bunch of market makers just withdrew from the market because they said... So a little bit of weird stuff happened. And then the actual people operating with their fingers on the buttons of these trading agents said, "There's some weird stuff happening. I'm not sure what's happening. I'm not sure what's going on. So I'm just going to step away."

Abe Othman:

And what was exposed is that market makers play actually a very unique role within the financial system and that when they withdraw, there are all these wacky second order effects. And actually there can be quite catastrophic damage when they just choose to step away. And the idea is that while if you replaced this human in the loop who might panic with a computer formula, you could then just, you'd never have to worry about the secondary collateral damage to the market maker stepping away. Because they would just programmatically be going about their business, as a result you would never have these crazy knock on effects.

Abe Othman:

This was our thinking 2010 before we had ever... What would a market maker look like in that context? Well, you'd have people signing up to provide risk capital that would get paid out according to this formula where sometimes you'd make money and sometimes you'd lose money, but you'd be locked into operating in the system.

Abe Othman:

Even I was able to recognize that this is quite fantastical and far fetched, that this is actually how our markets would operate. And then fast forward 10 years, that's the way DeFi works. Right? You have LPs signing up for this stream of returns based on a function of external market prices that they have no control over, they just trust the formula to go and execute and hopefully produce gains.

Abe Othman:

This was all an idea we had about like, well, you wouldn't have these self interested trading firms really operating anymore. You'd have this very different looking kind of financial product or way of putting assets to work. And yeah, that's how this all works now, but we didn't have that language back then. We didn't know, like liquidity providers, we didn't know that's what that would be called, but we knew that, that was a rule that was going to exist if you replaced the human market makers with automated market makers.

Mark Lurie:

Huh. It's so interesting. A lot of PhD thesis are written on very narrow niche subjects that are often outside of the focus of the status quo or thought leaders in the space. And for you fast forward 10 years and it's become very relevant. It's quite fortuitous and really interesting. I mean, it's a privilege to have spend so much time on this and then have it be so relevant to society.

Abe Othman:

And I was also very disappointed because we had a lot... Like the reason that these ideas didn't get any play within the conventional financial system and normal banks and stuff, I think for me, it's very validating, because it suggests to me that it wasn't a weakness of the ideas or the concept, it was a weakness of the banks. And that's nice that's the way that it's worked out. If you had had to rebuild it from first principles, you'd end up with a very different system than the one that I was pitching as I finished my PhD thesis.

Mark Lurie:

Interesting. Okay. And so just so I understand, so there's this flash crash and basically what happens is in centralized markets, you have market makers, which are just trading firms, right?

Abe Othman:

Yeah.

Mark Lurie:

And so essentially they see a trade come in for five shares of Apple. No one wants to buy five shares of Apple at that exact moment, they just buy it and then they ex they hold it for maybe only a few minutes and then they sell it to someone else. And so it makes things more efficient and makes the market work more smoothly. And then when those dry up, it just doesn't work as smoothly suddenly. And that's basically what you're saying, right?

Abe Othman:

There's nobody to buy or sell your Apple shares, yeah, when the market makers withdraw. And so suddenly where do prices go when there are no participants, they can become super dislodged. And that's what happened in the flash crash.

Abe Othman:

You also mentioned their trading firms that there are trading firms and they're not really trading firms with good reputations. Right? So an example of a market maker that has been in the news a lot recently, Citadel Securities, they're not folks who were buying Robinhood flow, and possibly internally matching that, these are not firms or modalities of operating where you think of them as being honest, trustworthy, and publicly minded in the way that they operate. They have bad reputations and they often act in ways that seem kind of bad.

Mark Lurie:

Yeah. They almost serve a role, which is public market infrastructure, but actually they're purely financially motivated firms and individuals. And I guess we shouldn't expect them to operate any differently.

Abe Othman:

Yes. And they often operate, I think a lot of these guys, and this comes from exactly who you're identifying, in some ways they are serving this role of being a public utility and they are also operating on a very proprietary level. And so you have this sort of mismatch between maybe folks' expectations about what actually happens when they log into Robinhood and they want to buy or sell some stock or some options or something and what's actually happening behind the scenes in that.

Abe Othman:

It's frankly, a lot of our public markets infrastructure does look like that. It's actually pretty horrifying to see some of the business models that have emerged. And I would say there is a lot of intentional opacity in the way these things are designed. People don't really want folks to understand how the market infrastructure actually, and the plumbing is all kind of put together because there are a bunch of choke points along the way where a stream of income can be harvested.

Mark Lurie:

I see.

Abe Othman:

And I think what's cool about the automated market maker model is it's frankly, it's a much better match for this conception of it's like you're running this public utility and you have these LPs who are signing on to provide for this very open and transparent way of actually performing this public good. And it's a very compelling model. And it's something that you can be a lot more honest about where do potential gains come from? Where can losses happen? What are some good situations versus bad situations? You can be a lot more open and honest about it.

Abe Othman:

Now, not a lot of, there are folks in either intentionally or unintentionally because maybe they haven't thought about it so deeply. I do see things like, "Oh, with this automated market maker design we'll never lose money." Sometimes it can be hard for me to tell whether folks they just haven't thought about it deeply or that they're actually intentionally being willfully misleading, but you at least have the ability.

Abe Othman:

And I think it's something we've tried to do with Shipyard and with Clipper is to actually communicate with folks in an honest way about what you do when you provide liquidity to an automated market maker. And I think that's a very strong motivation. I think it's really good, you can provide this sort of public service and be very open with the public about it.

Mark Lurie:

Okay. So basically, just to make sure we level set here, the idea is, LPs liquidity providers can take a bunch of crypto assets and they can put them into a smart contract on the blockchain, a formula determines the price at which a trader can swap one for the other, and the trader pays a fee for that, which accrues to the pool and provides yield almost like interest, but yield. And that motivates the liquidity providers to that capital in the first place. And that's how the whole system works for an automated market maker.

Abe Othman:

That's a fair gloss. It's a little bit more complex because you actually have this, the formula determines it's not just this, "Oh, asset X is worth this much. And asset Y is worth this much." You have a way of handling different size orders, and maybe the price kind of changing what I would call slippage, but what that has now been hijacked and overloaded in DeFi, but what a traditional market would call slippage as the order size gets bigger and bigger.

Abe Othman:

And then, yeah, but the fees are also in general, they're highly ambiguous because essentially the way a lot of mechanisms work is, there's not a separate... So you go to Coinbase, you do a trade on Coinbase or something. Coinbase just takes some of your money. With automated market makers, a lot of the time they will not actually just take the money and put it in a separate fee lock box. What will happen is they'll sort of use a formula to calculate what a fair value would be. And then they will slightly shave off the return value you get from a fully fair value trade.

Abe Othman:

And that will have a tendency to over time, those little, little bits that get shaved off, even though they're not carved off in a separate box or something that will tend to make the value of the pool, that the LP are contributing to grow.

Mark Lurie:

The fees and yield or interest is kind of the wrong word, it's more like the pool just appreciates. And that's why LPs provide capital?

Abe Othman:

That's right. Yeah. That's correct.

Mark Lurie:

Okay. And it's interesting, because it opens up a whole design space, right? This formula can do a lot of different things in a lot of different ways. And we can put this in almost as a public utility to the markets. It's very interesting.

Abe Othman:

I mean, this is like, what is so intellectually exciting about the idea too, because now suddenly you say, well, what should the formula be? And can you characterize the space of good formulas? And what are some desideratum around like, "Oh a good formula should do A, B and C." And that becomes very intellectually interesting. It provides opportunities to think about this at a pretty good theoretical math level of how these functions can actually operate. And actually see them in practice very quickly. It does open up a huge rich design space. It's pretty cool.

Mark Lurie:

Can we briefly touch on the idea of I permanent loss and how that factors in? And define that word however you want. But I think it's something that people hear about a lot. And then maybe we can dive into the early intellectual histories of how you think about AMMs and what are the different types today?

Abe Othman:

In permanent loss, this was a phenomenon that was noticed fairly early I would say in this, so the first kind of deck design, I think actually took inspiration from a paper that Vitalik wrote, thinking about how you could trade two crypto assets against one another. Essentially what was noticed is that there... And this is the standard for most mechanisms, is that there's no way of avoiding a loss within any trading mechanism, right? The only mechanism that never loses money is one that never trades. And because your gain or loss, whether it was a good idea to do a swap or not is dependent on the future path of price that you have no control over.

Abe Othman:

So for any swap you do that can always move against you. And the market, his idea is the average case, or at least 95% of the time you'll get enough offsetting orders that you can make a bit of money on this fee, and end up net positive. But this a very strong kind of like, "Oh, this typically happens," as opposed to something that says, "Oh, we'll never lose money," or whatever.

Abe Othman:

So it was noticed fairly early on that actually, and this actually comes back from the original formula Vitalik has this constant product market maker, which is what Uniswap V2 uses and Sushi uses, is it is very, very subject to having arbitrageurs trade against this mechanism. What it means is that in the Uniswap pool, there's always a little bit of an opportunity for someone to rip it off a bit, because they're more informed. Essentially these markets don't use any outside pricing information. And so there's always opportunity for a more informed trader to rip them off.

Abe Othman:

And what impermanent loss comes from is this idea of like, well, if the price of which you're swapping is here, but it should be here and what a trader will do is they'll bring the price to here, but you'll have done a swap that you, based on now visible prices, regret doing. The idea within impermanent loss and the reason it's impermanent is that if prices were to revert back to what they were, suddenly, it would look great, because this trader they did this swap with you, but they actually ended up doing it at prices that now that look bad, it might have looked good at a time, but now it looks bad.

Abe Othman:

And so if the prices were to just magically move back and magical is I think the right word here, because there's no guarantee this would ever happen, and frankly it probably won't, but if prices were to move back to what they were suddenly your LPs would make money. In general, I think it's fair to say in a lot of these Uniswap pools that traders are only doing these trades because they're more informed than the market maker. If you don't have a sufficient volume of what the market making literature would call noise traders, you'll end up losing money.

Abe Othman:

And so I think the hedge here was that the reason it's called impermanent loss is because technically if prices were to revert back to what they were when you originally put your LP money in, it would look like you had made money, but if you were to just withdraw right now, you would've lost money. You should mark your assets on what they're worth, not at what they might be worth if literally the best thing happens.

Mark Lurie:

So this happens, and then people don't really realize it until they withdraw their money. I guess they're looking at yields which are not actually correct. They're not really reflective of the market yields of their asset. Right? Because it's missing this key piece. Is that fair to say?

Abe Othman:

Correct. Correct. Yeah. I think again, it's hard for me to know whether folks have done this either intentionally, like willfully have tried to misrepresent what actual returns are or if they just don't know any better. Like if they haven't actually thought through the full financial and mathematical implications of what we're talking about.

Abe Othman:

But yeah, I think a lot of the time, it's something we've tried to do or tried to think about with the design of Clipper and what we show people on the Clipper data page is actually trying to calculate yield calculations that would hold up if someone came and they were actually like someone from a bank came with a spreadsheet and wanted to verify what the yields were, we try to do that in as rigorous way as possible, but there's very little and the math is hard and there's not much incentive to show people.

Mark Lurie:

I see. So it's actually hard for liquidity providers to even figure out. And it's not like a lot of people have an incentive to show them. And so it creates a little bit of a-

Abe Othman:

They're very unfortunate incentive towards bag holding in a lot of crypto.

Mark Lurie:

Interesting. Okay. Maybe let's go back to the intellectual history of AMMs. So this idea of order flow, informed order flow, uninformed order flow, what are the inspirations for the work you originally did? How do you think that's manifested in different types of AMMs today?

Abe Othman:

What the intellectual sphere of this is interesting and actually can be ignominious in parts. It's not all positive. The actual foundational work on this stuff goes back the '80s. And I think that's two places. One is Pete Kyle's work on for the first time theoretically trying to understand the work that market making agents were doing in terms of why do these trading firms exist? And what are their motivations in terms of setting prices?

Abe Othman:

And Pete Kyle came up with this really brilliant model where, which is, I think a very true gloss of thinking of the world is that market makers are exposed to two kinds of flow. There's informed traders and there's noise traders. And noise traders are just they're trading either randomly or just idiosyncratically for their own reasons. They're not trading because they think they know more than the market maker.

Abe Othman:

And then you have informed traders that may know more than the market people. This is the original Kyle model, but then you have stuff about maybe you can select between these, but if you're just having to open and publicly post prices and you'll be exposed to these two kinds of flow, how do you solve this problem? Because you want to essentially harvest some money from noise traders, which they're fine paying. And you want to avoid as much as possible getting run over by informed traders.

Abe Othman:

So that's one kind of intellectual strand. Pete Kyle is a really sharp dude. He was actually on my PhD committee. And yeah, really very original thinking in terms this agent based stuff.

Abe Othman:

The other intellectual model is from something that goes back to finance called convex risk measures. This was essentially this goes from the risk desks at banks, their own traders are out there accumulating positions of assets or bets on complex derivative bets on stock prices or commodities prices or whatever, and essentially there's like this desk of the bank, like this really more of a back office role, like the risk desk that has to sign off on big trades or has to set boundaries about how far traders can go.

Abe Othman:

And so essentially the problem there is formulated is, here's this portfolio, is this portfolio acceptable or not? And because this is like a back office cost center kind of functionality there hasn't been a lot of sophistication in terms of the development of these models, because this is something that the trader wants to do the trade, the trader thinks it's a good idea. They want you to say yes, in some sense, the bank wants the answer to be yes subject to not blowing up. And so there's a lot of all the motivation is on the say yes, side.

Abe Othman:

So models that have been developed out of banks on this functionality are not particularly sophisticated. And one of them I would say is actually responsible for the financial crisis. And that was the value at risk model. And just to talk about what that VAR, what VAR does is essentially say, okay, it's a very, again, not thoughtful way of solving this problem, which is to say like, well, what we'll do is we'll just evaluate the either the 1st percentile or 5th percentile, in and out of 20 days, what's the amount of money we'd expect to lose, the worst day? Or out of 100 days what's the amount of money we'd expect to lose on the worst day, out of those 100 days? And that'll be our way of measuring whether we've taken on too much risk.

Abe Othman:

And the danger with that model is that say you're measuring it on the 5th percentile. The danger with that model is that if your 1st percentile outcome goes from losing a million dollars to losing a billion dollars, your 5th percentile measure has not changed. And so you have all this tail risk that is incorporating this model that you just never see.

Abe Othman:

And that is essentially, in short, I would argue is like, that's what happened in the financial crisis. Is that you were using a way of measuring the risk in a complex portfolio, as like, "Oh, if we have like a pretty bad day, how much money do we lose?" Not like if we have the worst day ever, what happens to the... If this thing that our math, this says is very unlikely happens how much, and then that very unlikely thing happening actually became fairly-

Mark Lurie:

Yeah. So it assumes a normal distribution and also we're notoriously bad at knowing the tails.

Abe Othman:

Yeah. It doesn't have proper accounting for tails. I'm not going to say it assumes a normal distribution, but it doesn't have proper accounting for the tails. And like what you'd actually imagine is a more holistic... It's funny, actually, there's a lot of these ways of thinking about risk management, actually don't convert well into... This is the primary contribution I think of computer science to this discipline has really come from the, I think a mindset question.

Abe Othman:

And that mindset question is like, well, can we, like all of computer science is like, "Well, can we build a robot to do it?" And so when you have this model, you have this way of assessing, "Oh, is this portfolio good or bad?" You also have this way of assessing with the mechanism that's been there you also convert that into a question of like, "How good is this portfolio?" And in particular, "Is portfolio A better than portfolio B?"

Abe Othman:

And now from a computer scientists perspective, you're like, well, okay, so what we'll do is we'll design a agent, a robot that will take any bet that increases how good this portfolio is between A to B. So if B is better than A, it'll definitely take a swap that moves from A to B. If C is better than B, it'll definitely take a swap that goes from B to C. And so what you've actually done there is you've moved, this is just a completely mindset insight is that you've moved from a model where you are assessing risk to you building a trading agent.

Abe Othman:

And of course when I was finishing my PhD and I talked to people at some big banks and I was like, "We can use this stuff to build a trading agent." They're like, "No, no, no. We work in the risk desk. The traders are the ones who do the trade. Your idea doesn't work because we don't do the trades, the traders do the trades. We don't do the trades." I'm like, "Well, you could do the trades. Actually you could do a much better job of doing the trades."

Abe Othman:

And what that actually motivates though, as well is if you hand all the trading logic over to this agent, you actually motivate the development of much better risk measures, because you would never go to market with this VAR, 5th percentile trading agent, because it's such a poor measure of actually the value of a portfolio that you would just get... It wouldn't work.

Abe Othman:

And so one of the arguments I actually heard when I was talking to these banks when I was finishing my PhD, was that like, "Well, if you were just trying to maximize your VAR, you'd never want to trade with that. So obviously your idea is stupid." It's like, no, actually what that suggests is in fact, the way you're measuring risk is stupid. If your risk measurement way doesn't immediately correspond to a trading agent, then it's not the idea of embedding this in a trading agent, it's your risk measure. And I think future events have proven that to be correct and accurate. But that's the kind of mindset that I encountered in conventional clients.

Mark Lurie:

It's so interesting because it takes a, by removing the capabilities of the existing system, it forces an evolution and adaptation to that system, which actually can result in superior outcomes from a theoretical or risk-based perspective. It's just interesting that more difficult technical environments can actually force innovation in productive ways, which that just couldn't push through in the legacy system, the way it was set up.

Abe Othman:

And this is something that actually, I think is another... Why is this computer science? What is there that is computer science about this? And I actually do think it's this like practical, pragmatic robotics mindset.

Abe Othman:

Another guy who was on my PhD committee, Jeff Gordon, who's probably the most brilliant person I've ever met. He once told me that essentially, a computer planner is a tool for finding bugs in your model of the world. Because usually what happens if you hand something like a planner or an optimizer or something for robotics or something like, "Oh, I'm trying to get this joint to move from here to here or whatever," you get this crazy, not workable policy, right? Oh, we'll just move infinitely fast between here and here. And then it breaks your robot.

Abe Othman:

And so what he meant by that statement is essentially what that indicates is that your way of modeling the world to your program was inaccurate. Right? If you can't hand an optimization problem over to your agent and say, "Solve this." And run with it and feel confident that it's going to be fine, you have exposed bugs in your model of the world.

Abe Othman:

And so that's, I think what was happening with this VAR stuff is that this 5th percentile risk was an insufficient specification of the world. And you get this mindset with computer science where like, this is something that we can solve and fix, this is not an opportunity to stop work on the algorithmic side and just assume that some sales and trading bro will do good trades or whatever. It's like, no, let's make the system better so that we can hand it to a computer agent that doesn't know anything beyond what we've told it and still feel really confident it can make great decisions

Mark Lurie:

For its discipline and rigor in your conception of things. Interesting. Okay, cool. So we have this VAR risk model issue, and we have this informed versus uninformed order flow issue, help link this to the present and what we see in various AMMs today?

Abe Othman:

Yeah. So the actual computer science contributions on this started, I think actually, he's not a computer scientist, but Robin Hanson at George Mason came up with this idea of how you could build really what would be like the first automated market maker in prediction markets. Where essentially you have this agent that's operating to set the correct lines on bets without potentially knowing or not knowing anything about the actual underlying probabilities. And this is a very much not aware of what was happening in finance and this proceeded for a while.

Abe Othman:

I think actually my PhD thesis was the first one that actually linked these two streams, one from the computer science side, one from the finance side. And the interesting thing is that some of the market makers that Robin Hansen signed originally, there is certainly an interpretation of what's happening within Vitalik's market maker, where those are actually the same system, which is really cool to see.

Abe Othman:

So you have this intellectual history that goes through, touches a number of fields and all kind of work separately from one another, which I think is very fascinating that a bunch of people are touching the same ideas and coming up with different solutions to them. And so that's the original inspiration behind these automated marketing systems. And what you see, at least I think what's interesting is, there is a level of sophistication now that in the design space and what you can do that I think is really cool.

Abe Othman:

I mean, we have a white paper from Shipyard that we posted from some kind of just an extension of the research action in my PhD describing a family of these automated market makers that are really nicely parameterized.

Abe Othman:

I think one of the big advances that I was fortunate to do in my PhD work that is now I think is one of the more cited papers is what do we call a practical liquidity sensitive, automated market maker. And that was the first market maker that has this mathematical property of being positive homogeneous, which essentially, this is actually the... I wish we had been brilliant enough to like actually tie this in, but that actually solves the problem of the LP problem, which is, so I have this pool of assets that get traded by a market maker. If I contribute that amount of assets to the pool, I should own half the pool. Because I've doubled the asset base and I've contributed, I can point to saying, "Hey, I contributed exactly half the assets of the pool." If I withdraw some of my money, how should I... So it's this tie between contributed assets and pool ownership.

Abe Othman:

We solved that in that paper, but I don't think we realized that we had solved that in the paper. So I wish... It was just so far ahead than any kind of practical implementation. The market maker in that paper has been implemented a few times to our prediction markets and that's it. But the intellectual idea of being able to figure out if someone's contributing some assets to a pool, how much of the pool do they actually get to own, that comes from that paper.

Mark Lurie:

Interesting. So much innovation is happening at such a rapid pace here right now. Okay. So there's different types of automated market makers, right? I mean, there's Uniswap V3 model. There's a Uniswap V2 model. There's a curve model. There's one that incorporates Oracles. Like what are the big groupings that you see today if any?

Abe Othman:

I think the biggest one is really around the use of external price Oracles. So you have models for stuff like, in the Uniswap V2, constant product market maker, which is also what Sushi uses and a lot of other folks use, it's actually interesting, it is this unique, special case that does not rely on knowledge of any external market price on any external Oracles. Which makes it actually a very good design for, let's say, long tail assets in crypto, where price discovery actually ends up happening on decentralized exchanges.

Abe Othman:

And so in some sense, not having an external price Oracle is correct because there is no such thing as an external price because the price formation is literally happening in the trades that you're making. Which I think is quite intriguing. But for shorter tail assets where you do have expressions of what the market price should be, because the thing is that if you have an asset that's traded actively on Coinbase Pro or something, that's where price discovery is going to happen, just because the throughput is so much higher on centralized asset exchanges.

Abe Othman:

So for the short tail assets, if you're not using a price Oracle, if you're not using some external reference for what the price should be, when from these centralized asset exchanges, you're going to lose money for your LPs. It's very hard to not lose money for your LPs.

Mark Lurie:

I see. So the way to think about it is in these shorter tail assets where prices are discovered in centralized markets that are faster, you have uninformed flow, which is probably random. You have informed flow, which sees what's happening on the centralized market maker, and consistently puts you on the bad side of a trade, and so your LPs are just consistently losing money. And that's also, I guess, a way of thinking about impermanent loss to a certain extent is when you are continually harmed?

Abe Othman:

Yes. Or you've gotten there because it's a product of your traders being better informed than you are. And it is a question, right? There is this interesting relationship between arbitrageurs in DeFi, because for long tail assets, again, where there's no giant centralized order book for trading some obscure asset, the arbitrageur is actually doing the role of price discovery for the asset, is actually figuring out, "Oh, this coin is valuable versus not valuable." And in some sense they should compensated for that one.

Mark Lurie:

Yeah. I mean, it goes back to the point where they in the centralized markets, they serve some role of public utility. It's just, that's not their purpose and so there's going to be attention.

Abe Othman:

And on the flip side, though, in the short tail markets, if you have this, oh, the price of Ethereum among Coinbase Pro just jumped 1%, the person who brings that information to the Uniswap V2 or Uniswap V3 pool is they're not particularly performing a valuable service. There's a sense in which this information was known and you're sort of just ripping off some LPs to get there.

Abe Othman:

So I think there is this sort of like sliding scale, as you get more towards price discovery, the arbitrageurs become, for the thinnest most DeFi markets, they become really important and very valuable. And for trading wrapped Bitcoin against USDC on Uniswap, they become not... In some sense, you don't want those people. Or if you're an LP in that pool, you definitely do not want those people involved at all. All they're doing is taking money from you.

Mark Lurie:

And so basically you see the biggest divide between market makers that do, or don't incorporate centralized market prices in their formula because that can mitigate some of this tax or this loss?

Abe Othman:

It makes you want your market maker to be, and this, I mean, goes back ironically to again, to Pete Kyle's work, is you don't want your market maker to be less informed than the folks that you're trying to... It's very hard to make the model work if you're only, or even half the time exposed to people who know more than you. You really want that number to be single digits at most. And I think this is one of the appeals for crypto is that then you get this kind of unique looking asset stream where you still get crypto price exposure, and you get this yield as well. You get a consistent yield and you don't like ever...

Abe Othman:

In DeFi, noncustodial DeFi, you never lose control of those assets and you get some yield and because you still have those assets you also get crypto price exposure, which generally goes up. And so I think that's what makes it such a unique if it can be done correctly, it's what makes it such a unique kind of way of using your commodities, let's put it that way.

Mark Lurie:

Interesting. This is so fascinating. We're almost at time. I have one more question. It's going to be very broad. To be honest, maybe it makes sense to be the subject of its own episode, but I'd like to see if you have any top of mind thoughts, where do you think AMMs are going to go in the future? How do you think centralized finance and central limit order books will react to their existence and how do you think it's going to change finance? I know a super broad question, but would welcome key thoughts and maybe we can touch on it at a future point again?

Abe Othman:

The vision I have for the future is one where essentially the only role played by centralized exchanges is fiat on and off ramps. Fiat on and off ramps are done centralized with KYC and all that good regulated stuff. And then everything after that is DeFi. That is the world that I think is the correct one. I'm a huge believer in, not your keys, not your crypto. I personally only ever keep assets on something like Coinbase in order to buy or sell crypto for fiat, that's it. But I think that's, it is in some sense, the true vision of crypto to have DeFi and decentralized exchanges everywhere that's not touching fiat.

Abe Othman:

And then for the stuff that touches fiat that is interacting with the real economy and needs to be very well regulated. That's the touch point with the real economy is to do things that way. But the vision I have for the future is that there's much, much more activity. Like essentially folks stop using centralized mechanisms and convert over or move over. And I think it's just going to be a path to get there, right?

Abe Othman:

Like when I started getting into crypto, I would use a bunch of Coinbase Pro, DeFi scared me, I didn't understand it. And now you get into it and you're like "Oh, actually this is much more attractive." It is additional responsibility, but it's, but the control and frankly, the liberty you get from self custody and from interacting with centralized exchanges is so much better, right?

Abe Othman:

I'm not concerned that I haven't put my assets on some sketchy exchange that's going to go under. No, they're solid. I think what we see is we're in this intermediate phase where more and more people are finding out about crypto and they're like, "Well, what's the easiest way to buy Bitcoin? Oh, Coinbase. Okay, cool." That's the start.

Mark Lurie:

It's the gateway.

Abe Othman:

It's the gateway. It's the first step of 10 steps that results in someone hyping some wacky NFT on a display channel. And the thing is there's such a huge volume of people that are just taking that first step that we've only started seeing people start to move down the path to actually using DeFi stuff. And I think that's what to me is... The market for DeFi it will win for everyone who's touching anything related to the [inaudible 00:54:22] It just has to win because it is fundamentally better, safer. It is the correct way to use these systems. These blockchains were not designed so that you could just have your crypto on Coinbase. That's not what this is for.

Mark Lurie:

Makes sense. Abe, thank you so much for joining us today. We really appreciate you sharing your thoughts. We could go on forever and maybe we will in a future episode, but for now, thank you again. Normally I would ask where can people find you but I think it's fair for me to say as your partner, that people can find us on Twitter @shipyardSW for Shipyard Software, or the website: shipyardsoftware.org, that's: shipyardsoftware.org.

Mark Lurie:

Abe thanks again for your time.

Abe Othman:

Thank you, mark. It was a real blast. I appreciate it.

Listen to Making Sense of Crypto on your favourite podcast platform.

Apple Podcasts logoSpotify logo
See more platforms