  In decentralized finance ("DeFi"), automated market makers (AMMs) enable
traders to programmatically exchange one asset for another. Such trades are
enabled by the assets deposited by liquidity providers (LPs). The goal of this
paper is to characterize and interpret the optimal (i.e., profit-maximizing)
strategy of a monopolist liquidity provider, as a function of that LP's beliefs
about asset prices and trader behavior. We introduce a general framework for
reasoning about AMMs based on a Bayesian-like belief inference framework, where
LPs maintain an asset price estimate. In this model, the market maker (i.e.,
LP) chooses a demand curve that specifies the quantity of a risky asset to be
held at each dollar price. Traders arrive sequentially and submit a price bid
that can be interpreted as their estimate of the risky asset price; the AMM
responds to this submitted bid with an allocation of the risky asset to the
trader, a payment that the trader must pay, and a revised internal estimate for
the true asset price. We define an incentive-compatible (IC) AMM as one in
which a trader's optimal strategy is to submit its true estimate of the asset
price, and characterize the IC AMMs as those with downward-sloping demand
curves and payments defined by a formula familiar from Myerson's optimal
auction theory. We generalize Myerson's virtual values, and characterize the
profit-maximizing IC AMM. The optimal demand curve generally has a jump that
can be interpreted as a "bid-ask spread," which we show is caused by a
combination of adverse selection risk (dominant when the degree of information
asymmetry is large) and monopoly pricing (dominant when asymmetry is small).
This work opens up new research directions into the study of automated exchange
mechanisms from the lens of optimal auction theory and iterative belief
inference, using tools of theoretical computer science in a novel way.
