Walraswap: equilibrium-based decentralized exchange integrating external AMM liquidity

summary

The gist

Consider a finite set of trade orders and automated market makers (AMMs) at some state The solution is based on Brouwer’s fixed-point theorem This paper proposes a solution to finding an…

In short

The paper proposes an algorithm using Brouwer’s fixed-point theorem to find a Walrasian equilibrium price vector for a set of trade orders and Automated Market Makers (AMMs). This solution ensures all orders are executed jointly at a fair relative price, protecting users by modeling AMMs as non-agent functions rather than independent traders.

Key concepts

Walrasian Equilibrium
This is the goal: finding a stable price vector where the net value of every trade is zero. It means all supply (orders) perfectly matches all demand (AMMs) at a single, consistent price point, allowing for simultaneous execution.
Fixed-Point Method
This mathematical tool helps find the equilibrium. In this context, it means finding a specific price vector 'p' that satisfies the conditions where the supply and demand functions meet exactly at that point.
AMM Function Properties
AMMs are modeled using concave functions. These functions must be increasing, bounded above, and have a decreasing right derivative. This mathematical structure allows the system to precisely calculate optimal swap amounts based on current prices.

Terminology used across episodes

This episode discusses

The paper

Walraswap: equilibrium-based decentralized exchange integrating external AMM liquidity · Read on arXiv

Sergio Andrés Yuhjtman

This article advocates the development of a decentralized exchange protocol for Ethereum based on Walrasian equilibrium. Building on previous work (arXiv:2111.02719, arXiv:2210.04929), it develops a mathematical framework that incorporates liquidity from independent automated market makers (AMMs). Trade orders are represented by continuous monotonic pairwise supply functions and external AMMs are represented by concave swap functions. Under a connectivity condition, we establish the existence of a common clearing-price vector and external swaps that jointly fulfill the prescribed orders while leaving a nonnegative surplus of every token. External AMMs execute ordinary swaps according to their own pricing rules, including swap fees. For the selected clearing-price vector, the prescribed external swaps maximize the value of the batch surplus. We also establish structural properties of equilibrium, including invariance of individual net trades across equilibria, and formulate equilibrium computation as a convex optimization problem. We then outline Walraswap, an exchange protocol for Ethereum with off-chain batch construction and on-chain settlement. Its proposed governance and solver accountability mechanisms aim to encourage public order disclosure and discourage censorship. The protocol design explores how the mathematical construction could support decentralized trading with reduced opportunities for maximal extractable value.

Transcript

Introduction to the show: ident: Quantitative Finance. The day in quantitative finance: models of markets, risk and prices.

Ruth: I'm Ruth.

Warren: And I'm Warren, here with Iris.

Ruth: We're looking at the paper: "Walraswap: equilibrium-based decentralized exchange integrating external AMM liquidity".

Warren: Here's the gist of the paper. Consider a finite set of trade orders and automated market makers (AMMs) at some state The solution is based on Brouwer’s fixed-point theorem This paper proposes a solution to finding an equilibrium price vector to execute all the orders jointly with corresponding optimal AMMs swaps.

Ruth: The Core Problem and Approach The primary focus of that paper is an algorithm to compute Brouwer’s fixed-point This article addresses a problem that is currently central in the context of public blockchains.

Warren: The aim is to protect end users through a system that executes the trade orders in a commutative manner.

Ruth: The solution is obtained as a walrasian equilibrium

15: of a pure exchange system constructed from the original trade orders plus virtual trade orders associated to the AMMs.

Title and authors: Ruth: The paper we're discussing is "Walraswap: equilibrium-based decentralized exchange integrating external AMM liquidity." We're seeing how they approach this problem of finding a joint equilibrium for trades and AMMs.

Warren: It’s about using Brouwer’s fixed-point theorem to find that equilibrium price vector, which allows them to execute all the orders simultaneously with the optimal AMM swaps.

Iris: What I find interesting is how they model the behavior of the automated market makers, treating them as passive machines rather than active agents in this specific analysis.

Ruth: That’s right. They don't consider the liquidity providers behind AMMs; they focus on the auctioneer, who has a balance for each token starting at zero.

Warren: The paper suggests that the chosen AMM swaps must be such that there isn't another choice that increases the auctioneer’s balance of every token, at least one of them strictly.

The paper's summary: Ruth: To summarize what this paper is proposing, they are building a system where every order in the batch gets executed at the relative price determined by that equilibrium vector.

Warren: This means they’re aiming for a fair market execution across all trade orders and AMM swaps simultaneously, which helps with optimal resource allocation when handling large sets of trades.

Iris: They're defining an admissible supply function, which has two key conditions: it must be continuous and satisfy the Walras law where the sum of the supply values for each token is zero.

Ruth: And they introduce a stricter condition for this function, called a strict supply function, which guarantees that there is a price vector where the total value of all those orders equals zero.

Warren: The main result hinges on showing that if you have such a strict supply function, then there must exist a price vector p where the net value of any trade is zero.

The paper's improvements: Ruth: One significant improvement they highlight is how this approach helps mitigate maximal extractable value, or MEV. They compute that price vector p such that the final price at each AMM, given by the right derivative of the return function, aligns with that price vector.

Warren: By doing this, they claim to eliminate arbitrage opportunities and protect end users from MEV exploitation because if prices were discrepant, it would mean there's an opportunity to slightly modify amounts for a better outcome.

Iris: They also model the AMM operation using concave functions, which means the right derivative exists at every point and is decreasing, allowing them to precisely calculate the optimal swap amounts for each token.

Ruth: And they connect this back to virtual agent allocation by assigning a specific virtual agent to each AMM based on a relationship called hC equals hfc g c equals gfc.

Conclusion: Warren: So, wrapping up, the paper "Walraswap: equilibrium-based decentralized exchange integrating external AMM liquidity" provides a method for finding an equilibrium price vector to execute all orders jointly with corresponding optimal AMM swaps.

Ruth: It achieves this by using Brouwer’s fixed-point theorem on a strict supply function, which is what guarantees that there's a price vector where the net value of every trade is zero.

Iris: From my side, the work is interesting because it focuses on identification; they are checking that the variation they are using actually does the work and that this equilibrium condition is indeed what we need to satisfy.

Warren: The limitation they point out is that their analysis assumes AMMs are passive machines, not agents participating in the auction themselves, which allows them to achieve price coherence between orders and swaps.

Ruth: So, while it's a solid mathematical framework for finding this equilibrium, the paper notes that treating AMMs as active agents would lead to incompatibility with the price coherence assumption they want to maintain.

Iris: That's a fair point; their view that AMMs are not agents and don't need to receive the same effective price as trade orders is what enables them to fulfill price coherence.

More episodes

← Home