# Singular Arbitrage in G3Ms
This note details the problem of a singular arbitrageur trading against a G3M. It formulates the arbitrageur's objective as a stochastic control problem and outlines a method for solving it using the Hamilton-Jacobi-Bellman Variational Inequality (HJB-VI).
### Notations
Throughout this note, we use the following notation:
### AMM-related variables
* $x$: Quantity of the risky asset in the AMM.
* $y$: Quantity of the numéraire asset in the AMM.
* $w$: Weight parameter assigned to risky asset.
* $\ell$: Total liquidity in the pool.
* $P$: Price of the risky asset with respect to the numéraire as determined by the AMM.
* $1-\gamma$: Transaction cost parameter.
### Market variables
* $S$: Exogenous reference price of the risky asset, typically obtained from an external market.
## Control Problem Formulation
### Scenario
The arbitrageur trades against a G3M and a reference market simultaneously without holding any inventory. That is, the arbitrageur buys/sells from the AMM and sells/buys to the reference market simultaneously. This reflects a typical arbitrage strategy of exploiting temporary price discrepancies between different venues. We assume the reference market has no price impact, which simplifies the problem and allows us to focus purely on the price discrepancies.
### Arbitrage Control
The arbitrageur's actions determine the AMM inventory of the assets through *bounded variation processes (singular controls)*:
\begin{split}
dx_t &= d \tilde{L}_t - d \tilde{U}_t \\
dy_t &= P_t (\gamma^{-1} d \tilde{U}_t - \gamma d \tilde{L}_t) = \frac{w y_t}{(1-w) x_t} (\gamma^{-1} d \tilde{U}_t - \gamma d \tilde{L}_t)
\end{split}
Here,
* $x_t$ is the quantity of the risky asset in the AMM.
* $y_t$ is the quantity of the numeraire in the AMM.
* $P_t = \frac{w y_t}{(1-w) x_t}$ is the price reported by the AMM.
* $\tilde{L}_t$ and $\tilde{U}_t$ are right-continuous (with left-hand limits), non-negative, and non-decreasing processes with $\tilde{L}_0 = \tilde{U}_0 = 0$. These processes represent the arbitrageur's selling and buying actions.
The arbitrageur's goal is to maximize the expected **long-term average arbitrage profit** (or ergodic profit):
$$
\sup_{L, U} \liminf_{T \to \infty} \frac{1}{T} \mathbb{E} \left[ \int_0^T (\gamma P_t - S_t) d \tilde{L}_t + (S_t - \gamma^{-1} P_t) d \tilde{U}_t \right]
$$
### Change of Coordinate
Instead of using inventories $(x,y)$, we parametrize the system in terms of the *price-liquidity pair* $(P,\ell)$. The resulting dynamics are described as follows:
\begin{split}
d \ln P_t &= dU_t - dL_t \\
d \ln \ell_t &= (1-\gamma) \left\{ \frac{w(1-w)}{w + \gamma(1-w)} dU_t + \frac{w(1-w)}{\gamma w + (1-w)} dL_t \right\} \\
d \ln x_t &= \frac{1-w}{\gamma w + (1-w)} dL_t - \frac{\gamma(1-w)}{w + \gamma(1-w)} dU_t \\
d \ln y_t &= \frac{w}{w + \gamma(1-w)} dU_t - \frac{\gamma w}{\gamma w + (1-w)} dL_t
\end{split}
where the new control variables, $U_t$ and $L_t$, are related to the original trading strategy $(\tilde{U}_t, \tilde{L}_t)$ by:
$$
d\tilde{L}_t = \frac{1-w}{\gamma w + (1-w)} x_t dL_t, \quad
d\tilde{U}_t= \frac{\gamma (1-w)}{w + \gamma(1-w)} x_t dU_t
$$
The objective function can therefore be reformulated in terms of the new controls:
$$
\liminf_{T \to \infty} \frac{1}{T} \mathbb{E}\left[ \int_0^T \ell_t P^w_t \left\{ c_L \left(\gamma - \frac{S_t}{P_t} \right) dL_t + c_U \left(\gamma \frac{S_t}{P_t} - 1\right) dU_t \right\} \right]
$$
Here $c_L = \frac{w^{1-w} (1-w)^w}{\gamma w + (1-w)}$ and $c_U = \frac{w^{1-w} (1-w)^w}{w + \gamma(1-w)}$.
### Mispricing Process and Modified Objective
Define the *mispricing process* $Z_t$ as the log-ratio of the external price to the AMM price:
$$
Z_t = \ln \frac{S_t}{P_t}
$$
We suppose the mispricing process $Z_t$ follows the below controlled dynamics:
$$
dZ_t = \mu (Z_t) dt + \sigma (Z_t) dW_t + dL_t - dU_t
$$
where $W_t$ is a one-dimensional standard Brownian motion, and $\mu$ and $\sigma$ are suitable functions such that a weak solution $Z_t$ exists and is unique.
*Remark.* We impose this dynamic for the sake of tractability. This implies that the (logarithm of the) exogenous reference price is driven by the mispricing itself, which may not be intuitive at first glance. Nevertheless, this formulation covers two important cases of interest:
* *Geometric Brownian Motion (GBM):* This arises in the context of LPs in yield-generating staking derivatives and its underlying.
* *Ornstein-Uhlenbeck (OU) Process:* This is relevant for LPs in stablecoin pairs, where the mispricing tends to revert to a mean.
To make the model closer to a realistic situation, we add a mispricing penalty term, $h(z)$, which penalizes large deviations of the AMM price from the reference market price. We assume $h(z)$ is a **non-positive** function (since it is a penalty, it should reduce the profit).
The objective, including the penalty term, is given by:
$$
\sup_{L,U} \liminf_{T \to \infty} \frac{1}{T} \mathbb{E}\left[ \int_0^T \ell_t P^w_t \left\{ h(Z_t) + c_L (\gamma - e^{Z_t}) dL_t + c_U (\gamma e^{Z_t} - 1) dU_t \right\} \right]
$$
The term $\ell_t P^w_t$ (LP wealth) grows exponentially and thus leads to an unbounded objective. Therefore, we *adjust the objective* to maximize the arbitrage profit *per unit of liquidity wealth* by removing $\ell_t P^w_t$ from the integrand:
$$
\lambda_0 = \sup_{L,U} \liminf_{T \to \infty} \frac{1}{T} \mathbb{E}\left[ \int_0^T h(Z_t) + c_L (\gamma - e^{Z_t}) dL_t + c_U (\gamma e^{Z_t} - 1) dU_t \right]
$$
### HJB Equation
To solve the ergodic problem for $\lambda_0$, we consider the discounted infinite-horizon and the finite-horizon problems. The value functions $v_r(z,p,\ell)$ and $v_T(z,p,\ell)$ for these related problems are defined as:
\begin{align}
\sup_{L, U} &\ \mathbb{E} \left[ \int_0^\infty e^{-rt} \left\{ h(Z_t) + c_L \left(\gamma - e^{Z_t} \right) dL_t + c_U \left(\gamma e^{Z_t} - 1\right) dU_t \right\} \mid (Z_0, \ell_0, P_0) = (z, \ell, p) \right] \\
\sup_{L, U} &\ \mathbb{E} \left[ \int_0^T h(Z_t) + c_L \left(\gamma - e^{Z_t} \right) dL_t + c_U \left(\gamma e^{Z_t} - 1\right) dU_t \mid (Z_0, \ell_0, P_0) = (z, \ell, p) \right]
\end{align}
The reduced value function $v$ (representing $v_r$ or $v_T$) satisfies the HJB variational inequality (HJB-VI):
\begin{split}
0 = \max \left\{\mathcal{L} v + h(z), v_z - c_L (\gamma - e^z), v_z - c_U(\gamma e^z - 1) \right\}
\end{split}
The term $\mathcal{L}v$ includes the time derivative term for the finite-horizon case and the discount factor for the infinite-horizon case. Thus, the infinitesimal generator $\mathcal{L}$ is defined as:
$$
\mathcal{L} v = \begin{cases}
\frac12 \sigma^2(z) v''(z) + \mu(z) v'(z) - rv(z) &\quad \text{if } v=v_r \\
v_t + \frac12 \sigma^2(z) v_{zz} + \mu(z) v_z &\quad \text{if } v=v_T
\end{cases}
$$
### Goals and Expected Results
We aim to:
* Find the optimal long-term average arbitrage profit $\lambda_0$ and the corresponding optimal control policy $(L^*,U^*)$.
* Determine the corresponding long-term liquidity growth rate of $\ell^*_t$.
#### Theorem (Expected)
Under suitable assumptions, the following assertions hold:
1. There exist two boundaries,$0<a_*<b_*<\infty$, such that the optimal mispricing process, $z_t$, for the ergodic control problem is a *reflected diffusion process* on the interval $[a_*,b_*]$. The optimal control policy is given by $L_* = l_{a_*}$ and $U_* = l_{b_*}$, where $l_{a_*}$ and $l_{b_*}$ denote the local time processes at the boundaries $a_*$ and $b_*$, respectively.
2. The maximum long-term average profit $\lambda_0$ is related to the discounted and finite-horizon value functions by the following limits: $$\lambda_0 = \lim_{r \to 0^+} rV_r(z) = \lim_{T \to \infty} \frac{V_T(z)}{T}$$
## Ergodic Results
In this section, we present the required results for the ergodic setup. The solution to the ergodic control problem is a pair $(\lambda_0, v_0)$, where $\lambda_0$ is the optimal long-term average profit and $v_0$ is the value function, which satisfies a stationary HJB-VI.
First, consider the **uncontrolled mispricing process** (with no arbitrage actions):
$$
d Z^0_t = \mu (Z^0_t) dt + \sigma (Z^0_t) dW_t
$$
This is a one-dimensional diffusion process. We can characterize its behavior using the *scale and speed densities*, which are fundamental to the theory of one-dimensional diffusions. They are given by:
$$
s(z) := \exp \left\{ -\int^z_1 \frac{2 \mu(a)}{\sigma^2(a))} da \right\}, \quad
m(z) := \frac{1}{\sigma^2(z)s(z))}.
$$
The *infinitesimal generator* of the process $Z^0$ is a second-order differential operator that describes the average rate of change of a function of the process. It is given by:
$$
\mathcal{L}f(z)
:= \frac12 \sigma^2(z) f''(z) + \mu(z) f'(z)
= \frac12 \frac{d}{dM} \left( \frac{df(x)}{ds} \right)
$$
The HJB-VI for the ergodic problem seeks a pair $(\lambda_0, u_0)$, where $\lambda$ is the maximum average profit and $u(z)$ is the relative value function, satisfying the following equation:
$$
0 = \max \left\{ \mathcal{L}v(z)+h(z)-\lambda_0, v'(z) - c_L (\gamma - e^z), v' - c_U(\gamma e^z - 1) \right\}
$$
The terms in the max operator correspond to the three possible states:
1. Do nothing (no arbitrage).
2. Sell (arbitrage).
3. Buy (arbitrage).
The optimal policy for a one-dimensional singular control problem is often a **reflected diffusion process** on an interval $[a,b]$. This means the arbitrageur will only intervene at the boundaries of this interval.
#### Expected Theorem
Suppose there exists a nnegative function $u \in C^2([0,\infty))$ and a nonnegative number $\lambda$ that solves the HJB-VI. Then $\lambda_0 < \lambda$.
## To-Do
* Rigorously check the equivalence of the abelian limit $\lambda_0 = \lim_{r \to 0^+} rV_r(z)$ and the Cesàro limit $\lambda_0 = \lim_{T \to \infty} \frac{V_T(z)}{T}$.
* Conduct detailed (numerical) computations to solve the HJB-VI for GBM and OU.
## References
* Dai, M., & Yi, F. (2009). Finite-horizon optimal investment with transaction costs: A parabolic double obstacle problem. Journal of Differential Equations, 246(4), 1445–1469. https://doi.org/10.1016/j.jde.2008.11.003
* Gwee, J., & Zervos, M. (2025). A risk-sensitive ergodic singular stochastic control problem. arXiv. https://doi.org/10.48550/arXiv.2509.09835
* Kunwai, K., Xi, F., & Yin, G. (2022). On an ergodic two-sided singular control problem. Applied Mathematics & Optimization, 86(3), Article 26. https://doi.org/10.1007/s00245-022-09881-0
* Šiška, D., & Cao, J. (2024). Ergodic optimal liquidations in DeFi. arXiv. https://doi.org/10.48550/arXiv.2411.19637