Introduction

Existing blockchain systems come to consensus on transactions in batches, called blocks. Yet the economic mechanisms those transactions interact with are generally designed to process each individual transaction sequentially, making their behavior reliant on the ordering of transactions within the batch. This abstraction mismatch is the primary source of miner extractible value (MEV), defined as economic value that can be captured by the block proposer (originally the miner) who selects and sequences the transactions to be included in the batch [6].

However, rather than trying to blind the block proposer, or choose a “fair” ordering (which is difficult, if not impossible, to construct in any direct sense on current systems) within a batch, we could alternatively attempt to design economic mechanisms which do not depend on the order of transactions within a block, and instead, process each batch of transactions ‘all at once’. These mechanisms would then be aligned with the actual ordering provided by the consensus mechanism, stepping from one batch of transactions to the next in the same discrete time steps in which consensus happens.

One such mechanism is a ‘pro-rata mechanism’. In this mechanism, there is some known notion of value: for example, every user might want to trade some asset A for another, say B, and everyone ‘pitches in’ some amount of asset A into a pool. After everyone has placed their amounts, the pool, as a whole, is traded on an exchange for some amount of asset B, and the resulting amount of asset B is distributed back to each player, in proportion to how much of asset A each player placed in the pool. It is not difficult to show that such a mechanism has the desired property: the order in which players placed asset A into the collective pool does not change how much of asset B each player receives. Using some ideas from cryptography, this game can additionally be implemented in a way that does not reveal any one player’s contributions or identity [9], and so may be considered a simultaneous game.

On the other hand, mechanisms of this form often lead to interesting phenomena as users must now consider the possible actions of other users when planning their own actions. A natural framework to study these kinds of problems, where players must reason about the strategies of other players, recursively, is via game theory and the study of the equilibria of games [12]. This paper serves to cleanly set up the game resulting from a pro-rata mechanism in a simple mathematical framework and derive a number of useful results for such games.

This Paper. The paper is organized as follows. We introduce the concave pro-rata game in Sect. 1 and show a few interesting properties under mild conditions. Such properties include the existence and uniqueness of a symmetric pure strategy equilibrium and an explicit way of efficiently computing this equilibrium by solving a single variable, unimodal optimization problem. We also show some simple bounds for the price of anarchy. In Sect. 2 we then describe how this type of game connects to a recent proposal for a batched decentralized exchange. We run a number of simulations in Sect. A and Sect. B, illustrating the price of anarchy and showing that in the iterated setting agents appear to converge quickly to the specified equilibrium.

1 The Concave Pro-rata Game

We will define the pro-rata game with n players as the game with the following payoff for player \(i=1, \dots , n\):

$$\begin{aligned} U_i(x) = \frac{x_i}{\textbf{1}^Tx}f(\textbf{1}^Tx). \end{aligned}$$
(1)

Here, \(f: {\text{ R }}_+ \rightarrow {\text{ R }}\) is some function satisfying \(f(0) = 0\), while \(x \in {\text{ R }}_+^n\) is a nonnegative vector whose ith entry is the action performed by the ith player. We will say the game is a concave pro-rata game if the function f is a concave function. This game has a simple interpretation: every player ‘pitches in’ some amount \(x_i\) into a pool, totaling \(\textbf{1}^Tx\), and the pool pays out \(f(\textbf{1}^Tx)\) depending only on the total amount pitched in by all players. The amount paid out by the pool is then distributed among the players in a pro-rata way; i.e., each player i receives an amount proportional to how much she put into the pool. For the remainder of this paper, we will assume that the function f is concave. We note that concave pro-rata games consist of a special case of aggregative games in which the payoff of each player is a function of their strategy and the sum of the strategies of all players (cf., [11]).

Concavity. The payoff \(U_i\) is concave in the ith entry, holding the remaining entries constant. To see this, first define \(y = \textbf{1}^Tx - x_i\) (i.e., y is the sum of all entries of x except the ith entry). Overloading notation slightly for \(U_i\), we have that

$$ U_i(x_i, y) = \frac{x_i}{x_i + y}f(x_i + y). $$

We can write \(U_i(\cdot , y)\) as the composition of the following two functions

$$ U_i(x_i, y) = g(x_i, h(x_i)), $$

where

$$ g(x_i, t) = t f\left( \frac{x_i}{t}\right) \qquad \text {and} \qquad h(x_i) = \frac{x_i}{x_i+y}, $$

which are defined for nonnegative real inputs. We will use this rewriting to show that this function is concave in \(x_i\), since, using the basic convex composition rules (cf., [3, Sect. 3.2.4]) it suffices to show that (a) h is concave and (b) g is concave and nondecreasing in its second argument.

First, note that h is (strictly) concave since

$$ h(x_i) = 1 - \frac{y}{x_i + y}, $$

which is evidently (strictly) concave in \(x_i\) since y is a constant. We can see that g is jointly concave in its arguments as it is the perspective transform of the function f, which preserves concavity (cf., [3, Sect. 3.2.6]). Finally, we need to show that g is nondecreasing in its second argument. To see this, let \(0 \le t \le t'\), then we have

$$\begin{aligned} \begin{aligned} g(x_i, t') = t'f\left( \frac{x_i}{t'}\right) &= t'f\left( \frac{t}{t'}\frac{x_i}{t} + \left( 1-\frac{t}{t'}\right) 0\right) \\ &\ge tf\left( \frac{x_i}{t}\right) + \left( 1-\frac{t}{t'}\right) f(0) = tf\left( \frac{x_i}{t}\right) = g(x_i, t). \end{aligned} \end{aligned}$$
(2)

The inequality follows from the definition of concavity, while the second-to-last equality follows from the fact that \(f(0) = 0\).

Selfish Maximum. The fact that g is nondecreasing in its second argument also has an interesting consequence: a player never does better in the pro-rata game when compared to the ‘selfish’ version. In other words, for a fixed \(x_i\), player i has the largest payoff when all other players \(j \ne i\) have \(x_j = 0\). This is easy to see since

$$ t = \frac{x_i}{\textbf{1}^Tx} \le 1 $$

so

$$ U_i(x) = g(x_i, t) \le g(x_i, 1) = f(x_i), $$

where g is as defined above. The inequality follows from the monotonicity of g in its second argument.

Strict Concavity. In the important special case where f satisfies

$$\begin{aligned} f(\alpha t) > \alpha f(t), \end{aligned}$$
(3)

for every \(t > 0\) and \(0 < \alpha < 1\), then the function \(U_i(\cdot , y)\) is strictly concave in its first argument. (We will show this soon.) Property (3) has the interpretation that any chord of the function, drawn between (0, 0) and any other point on the graph, lies strictly below the function itself. For example, a sufficient condition is that the function f is strictly concave, though this condition is not a necessary one as there are functions which are not strictly concave that satisfy (3). See Appendix C for a more general condition.

Since we know that h is a strictly concave function and g is a concave function, we can show that \(g(x_i, h(x_i))\) is strictly concave in \(x_i\) by showing that g is strictly increasing in its second argument. Strict concavity of g follows from the usual composition rules (see [3, Sect. 3.2.4]). To show that g is strictly increasing in its second argument, let \(0 < t < t'\), then:

$$ g(x_i, t') = t'f\left( \frac{x_i}{t'}\right) = t'f\left( \frac{t}{t'}\frac{x_i}{t}\right) > t'\frac{t}{t'}f\left( \frac{x_i}{t}\right) = tf\left( \frac{x_i}{t}\right) = g(x_i, t), $$

where the inequality follows from an application of (3) with \(\alpha = t/t'\).

Definitions. For completeness, we state several important game theoretic definitions [12]. To each player \(i=1, \dots , n\), we associate a strategy, which is a probability distribution \(\pi _i\) over the possible actions of player i, the nonnegative real numbers. We say a strategy is pure if \(\pi _i\) is a deterministic distribution or point mass. In other words, we say a strategy is pure when the probability of choosing a specific action z is always one; i.e., \(\pi _i(\{z\}) = 1\) for some \(z\ge 0\). Otherwise, we say the strategy is mixed.

A Nash equilibrium (simply an equilibrium from here on out) is a collection of strategies \(\pi _i\) for each player \(i=1, \dots , n\) such that no individual player can achieve a strictly better outcome by choosing a different strategy. Concretely, let \(x_i \sim \pi _i\) be a random variable chosen by player i’s strategy (mixed or pure) and let \(y_i \sim \pi _{-i}\) be a random variable denoting the sums of random variables from other players’ strategies. The collection of strategies \((\pi _i)\) consists of an equilibrium if, for each player i, we have

$$ \textbf{E}_{x_i \sim \pi _i, ~y_i \sim \pi _{-i}}\left[ {U_i(x_i, y_i)}\right] \ge \textbf{E}_{x_i \sim \tilde{\pi }_i, ~y_i \sim \pi _{-i}}\left[ {U_i(x_i, y_i)}\right] , $$

where \(\tilde{\pi }_i\) denotes any strategy. (For the remainder of the paper, we will drop the \(x_i\) and \(y_i\) in the definition of the expectation to shorten notation.) If the above condition holds with strict inequality for all i except when \(\tilde{\pi }_i = \pi _i\), the equilibrium is said to be strict. In words, an equilibrium is strict if each player would achieve a strictly worse outcome by choosing a different strategy. In general, we say an equilibrium is pure if all strategies of that equilibrium are pure, and mixed otherwise.

Pure Equilibria. With those definitions, we note that the strict concavity of \(U_i(x_i, y)\) in \(x_i\) has an important, direct consequence: every equilibrium of this game is a pure equilibrium. Let \(x_i \sim \pi _i\) be any strategy that is not pure, while \(y_i \sim \pi _{-i}\) is a random variable denoting the sums of the other players’ strategies, then

$$ \textbf{E}_{\pi _i, \pi _{-i}}\left[ {U_i(x_i, y_i)}\right] = \textbf{E}_{\pi _{-i}} \left[ \textbf{E}_{\pi _{i}} \left[ {U_i(x_i, y_i)} \right] \right] < \textbf{E}_{\pi _{-i}} \left[ {U_i(\textbf{E}_{\pi _{i}}[x_i], y_i)} \right] , $$

where the strict inequality is a result of strict concavity of \(U_i(\cdot , y)\) for all y and the fact that \(\pi _i\) is not a point mass. In other words, if \(x_i \sim \pi _i\) is a mixed strategy for player i, then this player is always strictly better off playing the pure strategy \(\textbf{E}_{\pi _i}[x_i]\) instead. For the remainder of this paper, we will assume that f is concave and satisfies condition (3), unless otherwise stated. Additionally we will only discuss pure equilibria for the remainder of the paper, as all equilibria must be pure, so talking about a strategy as as a specific action \(x_i \in {\text{ R }}_+\) is reasonable.

Extensions. A simple immediate extension to the concave pro-rata game is to consider payoff functions of the form:

$$ U_i(x) = \frac{c_ix_i}{c^Tx}f\left( c^Tx\right) , $$

for some strictly positive vector \(c \in {\text{ R }}_{++}^n\). A more general extension is when we have a collection of n strictly increasing functions \(\varphi _i: {\text{ R }}_+ \rightarrow {\text{ R }}\), where \(\varphi _i(0) = 0\) and \(\varphi _i(t) \rightarrow \infty \) when \(t \rightarrow \infty \) for \(i=1, \dots , n\), and

$$ U_i(x) = \left( \frac{\varphi _i(x_i)}{\sum _{i=1}^n \varphi _i(x_i)}\right) f\left( \sum _{i=1}^n \varphi _i(x_i)\right) . $$

In either case, all of the same properties given above apply to this slightly more general game with nearly identical proofs, but we will only consider the (often useful) special case where \(\varphi _i(t) = t\).

1.1 Symmetric Pure Strict Equilibrium

There is a strict, pure equilibrium where all players have equal strategies, given by \(x = (q/n) \textbf{1}\) where q is the optimizer of the following problem:

$$\begin{aligned} \begin{aligned} & \text {maximize} &\,& q^{n-1}f(q)\\ & \text {subject to} &\,& q \ge 0, \end{aligned} \end{aligned}$$
(4)

with variable \(q \in {\text{ R }}\). We will show some properties of this result first and then show that the pure strategy \(x = (q/n)\textbf{1}\) is, indeed, an equilibrium.

Solution Properties. This problem has a (unique) and finite solution \(q > 0\) provided \(f(z) > 0\) and \(f(w) = 0\) for some \(0 < z < w\). The fact that \(q > 0\) follows by noting that q must satisfy \(q^{n-1} f(q) \ge z^{n-1}f(z) > 0\) since it is optimal. On the other hand, the fact that q is finite follows from the fact that, for any \(r \ge w\), we have

$$ \frac{w}{r}f(r) + \left( 1 - \frac{w}{r}\right) f(0) \le f(w) = 0, $$

where the first inequality follows from the definition of concavity. Since, by assumption, \(f(0) = 0\) and \(w/r > 0\), we have that \(f(r) \le 0\) so r cannot be optimal. (In fact, both statements combined prove the stronger fact that \(0 < q < w\), but this is not necessary for what follows.) The uniqueness of the solution to problem (4) follows from observing that the logarithm of the objective function is strictly concave. (This is true since \(\log \) is strictly increasing and \(\log \circ f\) is concave if f is concave.)

Discussion. It may appear that the condition placed on f is very strong, but in fact, any f not satisfying the above condition has only trivial (or no) equilibria. In particular, since f is concave, if f does not satisfy the above condition, either (a) f is strictly positive everywhere except at \(f(0)=0\), (b) f is strictly negative everywhere except at \(f(0)=0\), or (c) \(f = 0\). In the first case, there is no equilibrium as any player can improve their payoff by increasing their strategy. In the second case, any player who plays a nonzero strategy receives negative payoff (whereas playing the zero strategy would give 0 payoff). While, in the third case, any strategy is an equilibrium.

Equilibrium Properties. The collection of strategies \(x = (q/n)\textbf{1}\) is clearly pure and symmetric. To see that \(x = (q/n)\textbf{1}\) is a strict equilibrium, note that the best response for any player i, when every other player plays strategy q/n is:

$$\begin{aligned} \begin{aligned} & \text {maximize} &\,& \frac{x_i}{x_i + (1-1/n)q}f(x_i + (1-1/n)q)\\ & \text {subject to} &\,& x_i \ge 0, \end{aligned} \end{aligned}$$
(5)

with variable \(x_i \in {\text{ R }}\). We will show that the solution to (5) is \(x_i = q/n\) in two steps. First, we will show that any solution must have \(x_i > 0\) and therefore that the first order optimality conditions applied to the objective suffice. We will then show that \(x_i = q/n\) is a solution to the optimality conditions. This result, combined with the fact that the objective is strictly concave, implies that \(x_i = q/n\) is the unique solution to the optimality conditions, which proves the final claim that this equilibrium is strict.

To see that any solution to the best response problem (5) must have \(x_i > 0\), note that q/n is feasible and achieves an objective value of \(f(q)/n > 0\), which is strictly greater than the objective value of zero achieved by \(x_i = 0\).

Next, note that \(q > 0\) must satisfy the first order optimality conditions of (4):

$$\begin{aligned} (n-1)f(q) + qf'(q) = 0. \end{aligned}$$
(6)

On the other hand, the first order optimality conditions for the objective of problem (5) are that \(x_i\) must satisfy (writing \(q' = (1 - 1/n)q\) for convenience)

$$ \frac{q'}{x_i + q'}f(x_i + q') + x_if'(x_i + q') = 0. $$

Choosing \(x_i = q/n\) clearly satisfies this condition, since plugging this value in gives

$$ \left( 1 - \frac{1}{n}\right) f(q) + \frac{qf'(q)}{n} = \frac{1}{n}((n-1)f(q) + qf'(q)) = 0, $$

as required. Since the objective is strictly concave, this is the unique \(x_i\) satisfying the optimality conditions and is therefore the best response. Additionally, while we have assumed that f is differentiable, a very similar proof using subgradient calculus gives an identical result.

1.2 Uniqueness of Equilibrium

In fact, it is not hard to show that the symmetric, pure, strict equilibrium is, surprisingly, the unique equilibrium for this game, under the same conditions as (4); i.e., that \(f(z) > 0\) and \(f(w) = 0\) for some \(0 < z < w\). This proof can be broken down into a few steps. First, we will show that any equilibrium x satisfies \(f(\textbf{1}^Tx) > 0\) and \(x_i > 0\) for each i. This will then be used to show that there is no non-symmetric equilibrium, and, since we know that any symmetric equilibrium must satisfy Eq. (4), which has a unique solution, we then know that it is the unique equilibrium of this game.

Positivity of Equilibria. First we will show that \(f(v) > 0\) for every \(0 < v < w\). To see this, note that the function f is bounded from below by all of its chords, as it is a concave function. Note that the chord with endpoints (0, 0) and (zf(z)) lies above the x-axis, except at (0, 0), while the chord with endpoints (zf(z)) and \((w, f(w)) = (w, 0)\) lies above the x-axis, except at (w, 0), which leads to the final result.

Now, suppose a collection of (pure) strategies satisfies \(f(\textbf{1}^Tx) < 0\). Since \(f(0) = 0\), there is some index i such that \(x_i > 0\). This implies that \(U_i(x_i, \textbf{1}^Tx - x_i) < 0\). But then player i can achieve a payoff equal to 0 by employing the strategy \(\tilde{x}_i = 0\), which is strictly better than a negative payoff, so x cannot be an equilibrium.

On the other hand, if a collection of strategies satisfies \(f(\textbf{1}^Tx) = 0\), then, from the previous discussion, we must have either \(\textbf{1}^Tx = 0\) or \(\textbf{1}^Tx = w\). If \(\textbf{1}^Tx = 0\), any player i can obtain a strictly positive payoff by playing the strategy \(\tilde{x}_i = z\). If, instead, \(\textbf{1}^Tx = w > 0\), there is some index i such that \(x_i > 0\). We have that the player’s payoff is \(U_i(x_i, \textbf{1}^Tx - x_i) = 0\) which means that

$$ U_i(x_i - \varepsilon , \textbf{1}^Tx - x_i) = \frac{x_i - \varepsilon }{\textbf{1}^Tx - \varepsilon }f(\textbf{1}^Tx - \varepsilon ) > 0, $$

for \(\varepsilon > 0\) small enough since \(f(w - \varepsilon ) > 0\), so x is not an equilibrium.

Putting all of these statements together means that any equilibrium x satisfies \(f(\textbf{1}^Tx) > 0\) and \(\textbf{1}^Tx < w\). To see that any equilibrium must also satisfy \(x > 0\), note that if there exists an index i with \(x_i = 0\) for a collection of strategies with \(f(\textbf{1}^Tx) > 0\), player i can always achieve a strictly positive payoff by playing \(\tilde{x}_i = \varepsilon > 0\), for \(\varepsilon \) small enough.

Symmetry of Equilibria. Next, we will show that if \(x_i\) is a best response for player i, then any j for which \(x_j > x_i\) is not a best response for player j, and vice versa. This will immediately show that any equilibrium must satisfy \(x_i = x_j\) (i.e., it is symmetric). We will show this in the case that f is differentiable, but a similar proof holds in the more general case, using subgradient calculus.

Let x be an equilibrium with \(x_j > x_i\). Given that \(x_i\) is a best response, then the optimality conditions for (5) imply that:

$$ \left( \frac{\textbf{1}^Tx - x_i}{(\textbf{1}^Tx)^2}\right) f(\textbf{1}^Tx) + \frac{x_i}{\textbf{1}^Tx}f'(\textbf{1}^Tx) = 0. $$

Since x is an equilibrium, from the previous discussion, we have that \(f(\textbf{1}^Tx) > 0\), \(x_i > 0\), and \(\textbf{1}^Tx > x_i\), so \(f'(\textbf{1}^Tx) < 0\). On the other hand, differentiating the objective of the best response problem (5) for player j gives

$$ \left( \frac{\textbf{1}^Tx - x_j}{(\textbf{1}^Tx)^2}\right) f(\textbf{1}^Tx) + \frac{x_j}{\textbf{1}^Tx}f'(\textbf{1}^Tx) < \left( \frac{\textbf{1}^Tx - x_i}{(\textbf{1}^Tx)^2}\right) f(\textbf{1}^Tx) + \frac{x_i}{\textbf{1}^Tx}f'(\textbf{1}^Tx) = 0, $$

where the inequality follows from the fact that, since \(x_i < x_j\) we have

$$ \frac{\textbf{1}^Tx - x_j}{(\textbf{1}^Tx)^2} < \frac{\textbf{1}^Tx - x_i}{(\textbf{1}^Tx)^2} \quad \text {and} \quad \frac{x_j}{\textbf{1}^Tx} > \frac{x_i}{\textbf{1}^Tx}, $$

so \(x_j\) cannot be a best response as it is not optimal for (5). The converse case, when \(x_j < x_i\) with \(x_i\) being a best response, follows from a nearly identical proof. This immediately implies that any equilibrium must be symmetric, so, from the preceding discussion, the unique equilibrium is the one given by the solution to problem (4).

1.3 Equilibrium Payoff

Conditioned on each player receiving the same payoff (a fairness condition), the optimal allocation every player would get is

$$ \frac{1}{n}\sup f, $$

which is, by definition, at least as good as the equilibrium payoff:

$$ \frac{1}{n} f(q), $$

where \(q > 0\) is the solution to (4). In fact, we can show that the optimal fair allocation is always strictly better than the equilibrium payoff. To see this, note that, under the assumptions on f introduced above, we know \(\sup f\) is achieved by some value \(0 < q^\star < w\), satisfying \(f'(q^\star ) = 0\). Rearranging the first order optimality condition for q in problem (4) gives

$$ f'(q) = -(n-1)\frac{f(q)}{q} < 0, $$

for all \(n > 1\) since \(f(q) > 0\). This means that q does not satisfy the optimality condition for maximizing f, so \(f(q) < f(q^\star ) = \sup f\). (In fact, this says slightly more: using the concavity of f, we have that \(q > q^\star \), i.e., that players ‘overpay’ at equilibria when \(n > 1\).)

Price of Anarchy. Given the same assumptions as the beginning of Sect. 1.2 on the function f, it is not difficult to show that the price of anarchy satisfies

$$ \frac{\sup f}{f(q)} \ge \varOmega (n) $$

as the number of players n becomes large for some constant C. To see this, consider the first order optimality conditions for y (4):

$$ (n-1)f(q) + qf'(q) = 0. $$

Note that \(f'(q) < 0\) since \(q > 0\) and \(f(q) > 0\), so

$$ f(q) = -\frac{qf'(q)}{n-1} > 0, $$

whenever \(n > 1\). Since f is concave, then \(f'\) is monotonically nonincreasing, and, since \(q \le w\) for every n we have that

$$ f(q) = -\frac{qf'(q)}{n-1} \le -\frac{wf'(w)}{n-1} \le O\left( \frac{1}{n}\right) . $$

Finally, we know that \(\sup f\) is constant in the number of players, so

$$ \frac{\sup f}{f(q)} \ge \varOmega (n). $$

2 Batched Decentralized Exchanges

In this section, we will show some basic applications of the above properties to a batched decentralized exchange, which we describe below.

Decentralized Exchanges. A decentralized exchange (or DEX, for short) is a type of exchange that exists on a blockchain. Such exchanges enable any agent to trade currencies without the need for a centralized intermediary. In many cases, these exchanges are organized as constant function market makers (see, e.g., [1] for a general introduction to this type of exchange), a special type of automated market maker that uses a specific function to price assets.

Batched DEXs. A batched decentralized exchange is a DEX where the trades are batched before they are executed. Specifically, the trades are aggregated in some way (depending on the type of batching performed) and then traded ‘all together’ through the DEX, before being disaggregated and passed back to the users. Though the idea of a batched exchange has been proposed many times in different contexts (see, e.g., [4] and [13]), presently, almost all major decentralized exchanges are not batched. Recent work has suggested that batching is useful for privacy [5] and Penumbra [9] has proposed a design for a fully-private decentralized exchange which makes use of batching as a method for avoiding certain information leakage [2]. We describe a very simplified version of this proposal below, which will suffice for our discussion.

Batching Design. In this scenario, we have traders \(i=1, \dots , n\) who all wish to trade some amount, say \(\varDelta _i \in {\text{ R }}\) of asset A for some other asset, which we will call asset B. In this case, negative values of \(\varDelta _i\) denote that trader i wishes to receive some amount of asset A (and will instead tender asset B to the protocol). For convenience, we will assume that \(\textbf{1}^T\varDelta > 0\), i.e., on net, traders want more of asset B than asset A. The batching protocol of penumbra first clears all trades to get a nonnegative vector of ‘residual’ trades \(\varDelta ' \in {\text{ R }}_+^n\) with \(\textbf{1}^T\varDelta =\textbf{1}^T\varDelta '\). (In other words, the protocol does not generate debts in any one side.) We can view \(\varDelta '\) as the ‘excess demand’ for asset B over A and leave the mechanism for constructing \(\varDelta '\) otherwise unspecified, requiring only the additional condition that, if \(\varDelta \ge 0\), then \(\varDelta ' = \varDelta \). (This condition can be roughly stated as: if the only trades are due to excess demand, then no clearing happens.) The protocol then pools the residual demand, \(\textbf{1}^T\varDelta '\) and trades it against a constant function market maker, represented by some function g, to receive \(g(\textbf{1}^T\varDelta ')\) of asset B, which it then distributes to each agent i in a pro-rata way, leading to an identical form to that of the pro-rata payoff (1) with \(x = \varDelta '\). Constant function market makers always have concave g, known sometimes as the forward exchange function (cf., [1, Sect. 4]), with \(g(0) = 0\), and, in many practical cases, these functions are strictly concave.

2.1 Arbitrage

A common way of analyzing markets is through the lens of arbitrage: the ability to exploit price differences in order to make essentially risk-free profit. From before, we will write g for the forward exchange function of a constant function market maker, used by the batching design presented above.

Existence. Assuming g is differentiable at 0, we can interpret \(g'(0)\) as the marginal amount of asset B that one would receive for a marginal amount of A. (The function g is often not differentiable at 0, but is one-sided differentiable at \(0^+\), which suffices.) If \(g'(0)\) is larger than the price of an external market, say \(c > 0\), then anyone who can directly trade with g can make risk-free profit by trading some (potentially small) amount, \(t > 0\) of asset A for g(t) of asset B, and then sell this amount of asset B to get \(g(t)/c - t > 0\) of profit. (One simple way to see this is true is to use the definition of a derivative on g(t)/c and send \(t \downarrow 0\).)

Optimal Arbitrage. Since an agent can make risk-free profit in these cases, it is reasonable to ask: what is the maximum amount of profit an agent can make with this strategy? This is known as the optimal arbitrage problem, written:

$$ \begin{aligned} & \text {maximize} &\,& g(t) - ct\\ & \text {subject to} &\,& t \ge 0, \end{aligned} $$

with variable \(t \in {\text{ R }}\). From before, if we know that \(g'(0) > c\), then this problem has an optimal value that is strictly positive. If g is differentiable, the optimal solution \(t^\star \) satisfies

$$ g'(t^\star ) = c, $$

which we can see from the first-order optimality conditions for this problem. This has the interpretation that the marginal price of the CFMM after the trade \(t^\star \), given by \(g'(t^\star )\) should be equal to the price of the external market, which we defined to be c.

The (Aaggregated) Arbitrage Game. In the batched exchange above, arbitrageurs cannot directly trade with the constant function market maker, but must instead go through the batching process. Assuming there are n arbitrageurs competing to maximize their profit, the next question is: what are the properties of this game? Defining

$$ f(t) = g(t) - ct, $$

then this game is a concave pro-rata game with function f, since the payoff (1) for player i is

$$ U_i(x_i, y_i) = \frac{x_i}{x_i + y_i}f(x_i + y_i) = \frac{x_i}{x_i + y_i}g(x_i + y_i) - cx_i. $$

Note that this is exactly the amount received from the DEX with forward exchange function g, minus the cost of trading \(x_i\) with the external market, for player i. This game inherits all of the properties derived in Sect. 1. We show some numerical simulations of iterated behavior for some utility functions of this form in Appendices A and B.

3 Conclusion

We introduced concave pro-rata games and established several useful properties under relatively mild conditions. In particular, we showed the existence of a unique equilibrium that is symmetric and pure. This equilibrium can be computed efficiently by solving a single variable, unimodal optimization problem. We further established that the price of anarchy is \(\varOmega (n)\) in the number of players, relative to the optimal ‘fair’ allocation. We illustrated how concave pro-rata games connect to a recent proposal for a batched decentralized exchange and numerically studied the behavior of agents engaged in such a game in the iterated setting for a specific form of utility function. Future work includes further study of the optimal arbitrage problem for batched decentralized exchanges.