Skip to main content
Log in

Replicating market makers

  • Original Article
  • Published:
Digital Finance Aims and scope Submit manuscript

Abstract

We present a method for constructing constant function market makers (CFMMs) whose portfolio value functions match a desired payoff. More specifically, we show that the space of concave, nonnegative, nondecreasing, 1-homogeneous payoff functions and the space of convex CFMMs are equivalent; in other words, every CFMM has a concave, nonnegative, nondecreasing, 1-homogeneous payoff function, and every payoff function with these properties has a corresponding convex CFMM. We demonstrate a simple method for recovering a CFMM trading function that produces this desired payoff. This method uses only basic tools from convex analysis and is intimately related to Fenchel conjugacy. We demonstrate our result by constructing trading functions corresponding to basic payoffs, as well as standard financial derivatives, such as options and swaps.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2

Similar content being viewed by others

Data availability

No data was used in this paper.

References

  • Angeris, G., Agrawal, A., Evans, A., Chitra, T., & Boyd, S. (2022). Constant function market makers: Multi-asset trades via convex optimization (pp. 415–444). Springer International Publishing. https://doi.org/10.1007/978-3-031-07535-3_13

    Book  Google Scholar 

  • Angeris, G., & Chitra, T. (2020). Improved price oracles: Constant function market makers. In AFT ’20 (pp. 80–91). Association for Computing Machinery. https://doi.org/10.1145/3419614.3423251.

  • Angeris, G., Chitra, T., & Evans, A. (2022). When does the tail wag the dog? Curvature and market making. Cryptoeconomic Systems, 2(1). https://doi.org/10.21428/58320208.e9e6b7ce.

  • Angeris, G., Kao, H.-T., Chiang, R., Noyes, C., & Chitra, T. (2021). An analysis of Uniswap markets. Cryptoeconomic Systems, 0(1). https://doi.org/10.21428/58320208.c9738e64.

  • Boyd, S. P., & Vandenberghe, L. (2004). Convex optimization. Cambridge University Press.

    Book  Google Scholar 

  • Carr, P. P., & Jarrow, R. A. (1990). The stop-loss start-gain paradox and option valuation: A new decomposition into intrinsic and time value. The Review of Financial Studies,3(3), 469–492. http://www.jstor.org/stable/2962078.

  • Clark, J. (2020). The replicating portfolio of a constant product market. Available at SSRN 3550601.

  • Daian, P., Goldfeder, S., Kell, T., Li, Y., Zhao, X., Bentov, I., et al. (2020). Flash boys 2.0: Frontrunning in decentralized exchanges, miner extractable value, and consensus instability. In 2020 IEEE Symposium on Security and Privacy (SP) (pp. 910–927). IEEE.

  • Evans, A. (2021). Liquidity provider returns in geometric mean markets. Cryptoeconomic Systems, 1(2). https://doi.org/10.21428/58320208.56ddae1b.

  • Evans, A., Angeris, G., & Chitra, T. (2021). Optimal fees for geometric mean market makers. Financial Cryptography and Data Security. FC 2021 International Workshops. FC 2021. Lecture Notes in Computer Science (vol. 12676). Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-63958-0_6.

  • Foucault, T., Moinas, S., & Theissen, E. (2007). Does anonymity matter in electronic limit order markets? The Review of Financial Studies, 20(5), 1707–1747.

    Article  Google Scholar 

  • Gregoriou, G. N. (2016). The handbook of trading: Strategies for navigating and profiting from currency, bond, and stock markets. The McGraw-Hill Companies.

    Google Scholar 

  • Kao, H. T., Chitra, T., Chiang, R., & Morrow, J. (2020). An analysis of the market risk to participants in the compound protocol. In Third international symposium on foundations and applications of blockchains.

  • Martinelli, F., & Mushegian, N. (2019). Balancer: A non-custodial portfolio manager, liquidity provider, and price sensor.

  • Moallemi, C., & Yuan, K. (2014). The value of queue position in a limit order book. Market Microstructure: Confronting Many Viewpoints.

  • Neuberger, A. (1994). The log contract. The Journal of Portfolio Management,20(2), 74–80. https://doi.org/10.3905/jpm.1994.409478. https://jpm.pm-research.com/content/20/2/74.

  • Rockafellar, R. T. (1970). Convex analysis (Vol. 28). Princeton University Press.

    Book  Google Scholar 

  • Shreve, S. E. (2004). Stochastic calculus for finance II: Continuous-time models. Springer. https://books.google.com/books?id=O8kD1NwQBsQC.

  • Sterrett, E., Jepsen, W., & Kim, E. (2022). Replicating portfolios: constructing permissionless derivatives. arXiv preprint arXiv:2205.09890.

  • Zhang, Y., Chen, X., & Park, D. (2018). Formal specification of constant product (\(xy=k\)) market maker model and implementation.

Download references

Acknowledgements

The authors would like to thank Neelesh Tiruviluamala for useful discussions and finding some inconsistent notation in an earlier draft. The authors would also like to thank the anonymous reviewers for their feedback and suggestions, most of which were incorporated in the text.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Guillermo Angeris.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix: Delta-hedging

Appendix: Delta-hedging

As in Sect. 4, we have that \(c_1 \in {{\textbf {R}}}_+\), \(R_1 \in {{\textbf {R}}}_+\), and \(R_2 \in {{\textbf {R}}}_+\) are all scalar quantities, where \(c_1\) is the price of the asset in question. We seek to construct a trading function such that \(R_1=R_1(c_1)\) for all \(c_1\). We define

$$\begin{aligned} p(R_1)=R_1^{-1}(c_1), \end{aligned}$$

which is the marginal price of the traded coin. Recalling that \(R_2\) can be thought of as an implicit function of \(R_1\), we have

$$\begin{aligned} \frac{\text{d}R_2}{\text{d}R_1}=-p(R_1). \end{aligned}$$

Therefore

$$\begin{aligned} \int p(R_1)\text{d}R_1 = -R_2 \end{aligned}$$

will give a family of trading functions with the desired property.

Hedging a covered call Extending the example in Sect. 4, we now look at delta-hedging a covered call. In this case, we hold \(\frac{\text{d}}{\text{d}c} V(c)\) units of the risky asset, i.e., \(R_1(c)=1-\Phi (d_1)\). We therefore have

$$\begin{aligned} \int Kh(R_1)\,\text{d}R_1 = -R_2, \end{aligned}$$

where h is defined as before where h is defined as \(h(R) = \text{e}^{\sigma \sqrt{\tau }\Phi ^{-1}(1-R_1)-\tau \sigma ^2}\). In this case, we have the trading function

$$\begin{aligned} \psi (R_1,R_2) = k-\frac{1}{2}K+K\Phi (\Phi ^{-1}(1-R_1)-\sigma \sqrt{\tau })-R_2=0, \end{aligned}$$

where k is an arbitrary constant. As before, k will control where the hedge will fail as the CFMM runs out of reserves. An appropriate choice would be to select k, such that the initial value of reserves match the initial price of the covered call. In this case, we have

$$\begin{aligned} c_1R_1+R_2=c_1(1-\Phi (d_1))+K\Phi (d_2). \end{aligned}$$

Substituting the values for \(R_1(c)=1-\Phi (d_1)\) and \(R_2=k-\frac{1}{2}K+K\Phi (\Phi ^{-1}(1-R_1)-\sigma \sqrt{\tau })\) and solving for k, one obtains \(k=\frac{K}{2}\). Substituting this value recovers the trading function derived in Sect. 4.

Hedging a log contract We consider the case of delta-hedging a short position in a log contract. As noted in Neuberger (1994), delta-hedging a contract paying the natural logarithm of the futures price will replicate a variance swap. In this case, we seek a trading function for which \(R_1(c)=\frac{1}{c_1}\). In other words, to achieve the desired hedge, we seek a CFMM that holds one unit of asset 2’s worth in asset 1. Noting that

$$\begin{aligned} p(R_1)=\frac{1}{R_1}; \end{aligned}$$

we get

$$\begin{aligned} \int p(R_1)\text{d}R_1 =k-\ln {R_1}=R_2, \end{aligned}$$

where k is an arbitrary constant. Any trading function of the form

$$\begin{aligned} \psi (R_1,R_2) = k-\ln {R_1}-R_2=0 \end{aligned}$$
(A1)

will achieve the desired hedge insofar as \(k \ge \ln {R_1}\) or \(c_1 \ge \text{e}^{-k}\), as the CFMM will otherwise run out of the reserves required to continue hedging (Fig. 3).

Fig. 3
figure 3

Delta-hedging CFMM for the log contract with different parameter choices for the constant k

Path dependence and arbitrage loss Suppose the price of the asset at time t is \(c_1(t)\) and consider delta-hedging a short position in the log contract by holding \(\frac{1}{c_1(t)}\) units of the asset under zero transaction costs. The profit-and-loss (PNL) of this strategy over a discrete period \([t,t+1]\) is \(\frac{1}{c_1(t)}(c_1(t+1)-c_1(t))\). When continuously rebalancing over [0, T], we have PNL \(\int _0^{\textrm{T}} \frac{1}{c_1(t)} \text{d}c_1(s)\). For simplicity of illustration, suppose \(c_1(t)\) follows a geometric Brownian motion with stochastic differential

$$\begin{aligned} {\textrm{d}}c_1(t)=\sigma {\textrm{d}}W(t), \end{aligned}$$

where W(t) is a standard Brownian motion. One can check that the expected PNL of the delta-hedging strategy is zero. Now, we contrast this with delta-hedging with the CFMM we recovered in (A1). One can check that this CFMM has payoff

$$\begin{aligned} V(c_1)=1+k+\ln {c_1(t)}. \end{aligned}$$

The expected PNL of this strategy is therefore

$$\begin{aligned} \mathop {{\textbf {E}}{}}[V(c_1(T))-V(c_1(0))]=-\frac{\sigma ^2}{2}T. \end{aligned}$$

In other words, implementing the delta-hedge through a no-fee CFMM instead of continual rebalancing under no transaction costs will result in a supermartingale. This observation is analogous to the result in Angeris and Chitra (2020) and Evans et al. (2020) that the portfolio value of a G3M or constant-mean market maker is a supermartingale under the risk-neutral measure due to arbitrage losses.

More generally, a no-fee CFMM has payoff \(V(c)=R_1c + R_2\), which is always path-independent. In contrast, the equivalent delta-hedging strategies continually rebalanced at no cost are path-dependent. When delta-hedging a convex strategy, one’s portfolio will be short gamma and long theta (Shreve, 2004). The equivalent CFMM does not benefit from positive theta due to arbitrage, resulting in the supermartingale behavior. In other words, delta hedging a convex claim with a CFMM with the appropriate concave payoff will underperform the equivalent delta-hedge rebalanced under no transaction costs. We conjecture that a result similar to that of Evans et al. (2021) may allow one to arbitrarily approximate unconstrained delta-hedging strategies with CFMMs by taking the directional limit as the fee approaches zero, but do not pursue this direction further in this paper.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Angeris, G., Evans, A. & Chitra, T. Replicating market makers. Digit Finance 5, 367–387 (2023). https://doi.org/10.1007/s42521-023-00082-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s42521-023-00082-0

JEL Classification

Keywords

Navigation