  Constant Function Market Makers (CFMMs) are a family of automated market
makers that enable censorship-resistant decentralized exchange on public
blockchains. Arbitrage trades have been shown to align the prices reported by
CFMMs with those of external markets. These trades impose costs on Liquidity
Providers (LPs) who supply reserves to CFMMs. Trading fees have been proposed
as a mechanism for compensating LPs for arbitrage losses. However, large fees
reduce the accuracy of the prices reported by CFMMs and can cause reserves to
deviate from desirable asset compositions. CFMM designers are therefore faced
with the problem of how to optimally select fees to attract liquidity. We
develop a framework for determining the value to LPs of supplying liquidity to
a CFMM with fees when the underlying process follows a general diffusion.
Focusing on a popular class of CFMMs which we call Geometric Mean Market Makers
(G3Ms), our approach also allows one to select optimal fees for maximizing LP
value. We illustrate our methodology by showing that an LP with mean-variance
utility will prefer a G3M over all alternative trading strategies as fees
approach zero.
