  Automated market makers are a popular type of decentralized exchange in which
users trade assets with each other directly and automatically through a
liquidity pool and a fixed pricing function. The liquidity provider contributes
to the liquidity pool by supplying assets to the pool and in return they earn
transaction fees from traders who trade through the pool. We propose a model of
optimal liquidity provision in which the risk-averse liquidity provider decides
the investment proportion of wealth she would like to supply to the pool, trade
in a centralized market, and consume in multiple periods. We derive the
liquidity provider's optimal strategy by dynamic programming and numerically
find the optimal liquidity pool that maximizes the liquidity provider's
utility. Our findings indicate that the exchange rate volatility on the
centralized market exerts a positive effect on the optimal transaction fee.
Moreover, the optimal constant mean pricing formula is found to be related to
the relative performance of the underlying assets on the centralized market.
