paper

Walraswap: equilibrium-based decentralized exchange integrating external AMM liquidity

arXiv:2310.12255

Abstract

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.