If there exists an arbitrage opportunity between two Constant Product Market Making exchanges, how can you confidently determine the maximum volume to use in order to ensure highest profit?

I can imagine incrementing and testing various values, but it seems extremely inneficient.

As an example:

These exchanges do not have an orderbook, but rather provide a varying rate that depends upon the volume of the input. A rough example would be the following:

If I were to buy 1 share of AAPL, I would get it for $174.13.

If I were to buy 2 shares of AAPL, I would get it for less, maybe $174.10.

The rates are derived from the amount of liquidity in the market (imagine a pool of AAPL stock). If there are 1000 AAPL in the pool, and you tried to buy 999 of them, the price would be in the millions of dollars, because you will have effectively depleted the pool.


closed as unclear what you're asking by madilyn, skoestlmeier, Helin, Attack68, Lliane Mar 6 at 8:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


You're kind of asking for a specific answer to a fundamentally nebulous question.

First, a 'constant product market marking exchange' isn't a real thing. From the link you included, it looks like the paper talks about a theoretical framework, potentially rooted in something real, but theoretical nonetheless.

To answer more generally, based on the mechanics you described, you can model this. From what you've said, I imagine price/share, if plotted price as Y and position size as X would look like a parabola of some kind (highest price would occur for very small positions and very large positions, approach infinity for purchase of the entire market). You can pretty easily find the minimum price by inspection or using analytical methods if you want to get picky.

  • $\begingroup$ Thank you for the response. The final paragraph makes perfect sense. To go further, if the other exchange has the same attributes, how would you choose which point on the graph of the first exchange to use? For example, the max point of the graph you described would correspond to the size, x, and would result in an output y = size * price. Though the y value is the maximum profit on one exchange, it may not produce the maximum profit from an arbitrage on the second exchange. How would you account for that in an attempt to get the maximum output from both exchanges? $\endgroup$ – quantfinancequest Feb 28 at 21:41
  • $\begingroup$ @quantfinancequest, insofar as you're looking to minimize price paid per share, you could simply take a VWAP or weighted average over the two exchanges. $\endgroup$ – Chris Feb 28 at 21:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.