Abstract: The bonding curves of decentralised exchanges (DEXs) define, with mathematical formulae, the relationship between liquidity supply, price impact, and execution prices. Most DEXs use the bonding curves of constant function markets (CFMs) to clear the demand and supply of liquidity. CFMs prevent liquidity providers (LPs) from acting strategically, so they  operate at a loss, on average.  We generalise CFMs and introduce decentralised liquidity pools (DLPs) where dynamic bonding curves maximise the expected wealth of LPs. In  the DLP, the bonding curve is determined by impact functions that encode how liquidity taking orders affect prices and by quote functions that encode how the price of liquidity is set.  We develop models to find the optimal bonding curve when LTs are sensitive to the price of liquidity and when prices form in a competing trading venue, form in the DLP, or form in various venues. In fragmented markets, the DLP employs the trading flow to estimate the fundamental price and to adjust the bonding curve. Our models may be used as dynamic fee hooks in Uniswap v4 when the price impact of orders are those implied by the constant product function.

Getting here