К мультиагентному RL-симулятору OTC-рынков
Nelson Vadori (corresponding author), Leo Ardon, Sumitra Ganesh, Thomas Spooner, Selim Amrouni, Jared Vann, Mengda Xu, Tucker Balch, Manuela Veloso · J.P. Morgan AI Research · Zeyu Zheng · University of Michigan and J.P. Morgan AI Research · ревизия 1 августа 2023
Оригинал: Vadori, N., Ardon, L., Ganesh, S., Spooner, T., Amrouni, S., Vann, J., Xu, M., Zheng, Z., Balch, T. and Veloso, M. «Towards Multi-Agent Reinforcement Learning driven Over-The-Counter Market Simulations», v2 — arxiv.org/abs/2210.07184 (PDF).
Рис. 1–20 воспроизведены из оригинальной публикации. Доказательства теорем, алгоритмические детали и дополнительные эксперименты — в приложении PDF.
Ключевые слова: multi-agent reinforcement learning, over-the-counter markets, market making, calibration, shared policy.
Классификация arXiv: cs.MA
Аннотация
Мы изучаем игру между агентами-поставщиками ликвидности (LP) и агентами-потребителями ликвидности (LT), взаимодействующими на OTC-рынке; типичный пример — валютный рынок (FX). Показываем, что подходящий дизайн параметризованных семейств функций награды в сочетании с обучением shared policy — эффективное решение. Играя друг против друга, агенты на базе глубокого RL вырабатывают эмерджентное поведение относительно широкого спектра целей: P&L, оптимальное исполнение и доля рынка. В частности, LP естественным образом учатся балансировать хеджирование и skewing — асимметричное выставление bid и ask как функцию инвентаря.
Дополнительно вводим новый RL-алгоритм калибровки, хорошо справляющийся с наложением ограничений на равновесие игры. На теоретической стороне доказываем скорости сходимости для мультиагентного policy gradient при предположении транзитивности, близком к обобщённым порядковым потенциальным играм.
1. Введение
Контекст рынка
Фокус — дилерский рынок (OTC), где торгуется одна ценная бумага. Примеры: валютный рынок — крупнейший финансовый рынок в мире; безопасность можно мыслить как евродоллар. В отличие от типичных акций, торговля между участниками не происходит на единой централизованной бирже: рынок децентрализован — агент торгует через приватное подключение к дилеру или через агрегатор ликвидности (Oomen 2017). Природа взаимодействий делает рынок частично наблюдаемым. Агенты также имеют доступ к ECN (Electronic Communication Networks) — референсная цена и площадка для срочной торговли при хеджировании. Для евродоллара пример ECN — EBS с tick size 0,5 bp. Обзор FX: Schrimpf and Sushko (2019a,b).
Агенты рынка
Участников можно разделить на Liquidity Providers (LP) — маркетмейкеры, транслирующие цены LT; и Liquidity Takers (LT), торгующих с LP по спекулятивным или экзогенным мотивам. Задача LP — управлять net inventory после сделок с LT: через skewing (асимметричная корректировка bid/ask, internalization) или externalization на ECN. Литература часто фокусируется на risk-penalized P&L, но LP также преследуют market share — долю суммарного LT-потока, нетривиально оцениваемую из-за частичной наблюдаемости OTC.
Схематично LP и LT максимизируют компромисс между risk-penalized P&L и чисто объёмной целью. В работе захватываем для каждого класса спектр таких целей.
Цель и desiderata
Цель — OTC-симуляция как формальная $n$-player partially observable general sum Markov game между LP, LT и ECN, где все агенты обучают оптимальные политики, играя друг против друга (MARL). Симуляция позволяет изучать what-if сценарии: влияние risk aversion конкурентов на market share, изменение связности. Это отличается от stochastic optimal control для одного LP (Guéant 2017; Barzykin et al. 2021, 2023), где остальной рынок — статистическая сущность «rest of the world».
Центральный вопрос — как задать характеристики агентов, включая utility functions. Мы можем знать flow response curve LP или средний market share — тогда нужно подобрать гиперпараметры симулятора. Вводим новый RL-подход к калибровке.
Игра близка к Bank et al. (2021). Desiderata:
- Desiderata 1. Учёт графа связности между агентами.
- Desiderata 2. Спектр целей реальных дилерских рынков.
- Desiderata 3. Обучение из правил игры и экспериментирования.
- Desiderata 4. Калибровка под наблюдения конкретных агентов.
Desiderata 2: цели LP — от P&L до market share; LT — от P&L до заданного объёма. Supertype-design эффективно обучает политики под эти компромиссы, включая optimal execution. Desiderata 3: политики возникают из игры. Desiderata 4: ограничения на эмерджентное поведение через баланс типов — нетривиально совместить с оптимальностью политик.
Наши вклады
- Формализация игры LP–LT через типы и супертипы (разд. 2.1); RL-обучение политик под спектр целей (разд. 2.2).
- ECN на LOB с continuous-time limit и нейросетевой non-Markov экстензией (разд. 2.3).
- Shared equilibrium, скорости сходимости policy gradient; potential-Hamiltonian decomposition (разд. 3).
- RL-алгоритм калибровки CALSHEQ (разд. 4–5).
- Эмерджентный баланс hedging/skewing у LP.
Связанные работы
Market making: Garman (1976), Amihud and Mendelson (1980), Ho and Stoll (1981), Avellaneda and Stoikov (2008), Guéant et al. (2013); adverse selection — Glosten and Milgrom (1985). Дилерские рынки: Guéant (2017), Bank et al. (2021), Barzykin et al. (2021, 2023). RL на LOB: Chan and Shelton (2001), Spooner et al. (2018); конкуренция — Cont and Xiong (2022); близкие MARL-работы — Ganesh et al. (2019), Ardon et al. (2021).
MARL: нет гарантий Nash в general sum partially observable Markov games с непрерывными пространствами. Markov potential games (Leonardos et al. 2021); мы — generalized ordinal potential games (Monderer and Shapley 1996). Parameter sharing (Gupta et al. 2017; Foerster et al. 2016), CTDE; PPO с 60–90 CPU (Yu et al. 2021). Калибровка ABM: Avegliano and Sichman (2019), Lamperti et al. (2018); наш dual-RL calibrator.
2. Мультиагентная модель симуляции на супертипах
2.1. Типы и супертипы агентов
Partially Observable Markov Game. Класс агента $\kappa \in \{\mathrm{LP}, \mathrm{LT}\}$. Игра среди $n_{\mathrm{LP}}$ LP и $n_{\mathrm{LT}}$ LT на горизонте $T$; $n_{\mathrm{tot}} = n_{\mathrm{LP}} + n_{\mathrm{LT}}$, $n_{\mathrm{ECN}}$ — число ECN. Связность задаётся входным графом: два элемента взаимодействуют только если связаны; агенты одного класса всегда отключены друг от друга. Время дискретизовано (шаг, например, 1 с) для совместимости с RL. Симуляция траектории — episode; агрегированная utility — cumulative reward.
На каждом $t \in [0,T]$: LP транслируют bid/ask и долю инвентаря для хеджа на ECN; LT выбирают размер и направление сделки; исполнение — по лучшей цене среди связанных LP и ECN. Это multi-stage (Stackelberg) игра: LT играют в ответ на LP. Формализация — $n$-player partially observable Markov game (Hansen et al. 2004).
Типы и супертипы. Внутри класса агенты различаются utility (reward). Agent type $\lambda_i^\kappa$ включает risk aversion, trade-off между P&L, market share и целевым объёмом, связность. Типы — параметризованное семейство reward functions. Supertype $\Lambda_i^\kappa$ — параметры распределения типов; типы семплируются в начале episode и фиксируются. Это позволяет масштабировать симуляцию и добавлять шум, помогающий сходимости (Hambly et al. 2021).
Формально: каждому агенту $i$ присвоен supertype $\Lambda_i^\kappa \in \mathcal{S}_{\Lambda_i^\kappa}$; в начале episode $\lambda_i^\kappa \sim p_{\Lambda_i^\kappa}$; начальные состояния $s_0^{(i,\kappa)} \sim \mu_0^{\lambda_i^\kappa}$. Reward $R^\kappa$ и transition kernel $T$ удовлетворяют Assumption 2.1 (Type symmetry): инвариантность к перестановкам аргументов — ожидаемая награда зависит только от supertype при фиксированных политиках.
Горизонт $T$ детерминирован и конечен — политики time-dependent; время включается в состояние. Расширение на случайный $T$ (episodic) или $T=+\infty$ с discount $\zeta < 1$ — прямолинейно.
2.2. Эффективное обучение спектра поведений через RL
2.2.1. Shared policy, conditioned on agent type
При одинаковых action/state spaces эффективно использовать одну shared policy $\pi$ на всех агентов (Foerster et al. 2016; Gupta et al. 2017) — парадигма CTDE. Два класса — две shared policies. Тип $\lambda_i^\kappa$ включается в локальное состояние:
\[ \pi^\kappa(da \mid s, \lambda) := P\!\left(a_t^{(i,\kappa)} \in da \mid s_t^{(i,\kappa)} = s,\, \lambda_i^\kappa = \lambda\right), \quad \pi^\kappa \in \mathcal{X}^\kappa. \]Из-за partial observability оптимальные действия зависят от истории private states; на практике историю кодирует LSTM (Gupta et al. 2017). Ожидаемая награда агента $i$:
\[ V_{\Lambda_i^\kappa}(\pi^{\mathrm{LP}}, \pi^{\mathrm{LT}}) := \mathbb{E}\left[\sum_{t=0}^{T} \zeta^t R^\kappa(\cdot)\right], \]где $\zeta \in [0,1]$ — discount. Цель — Nash equilibria; эмпирическая сходимость через RL (разд. 3.2, 5). При фиксированной $\pi^{\mathrm{LT}}$ анализируем equilibria LP с shared policy (разд. 3.1). Агенты не знают supertype profile $\Lambda$ (в отличие от Bayesian games с common knowledge type prior).
2.2.2. RL-дизайн OTC-агентов
Далее $n_{\mathrm{ECN}}=1$; $P_t$ — mid-price ECN. Utility LP и LT — компромисс risk-penalized P&L и объёмной компоненты (market share для LP; trade targets для LT).
P&L агента. Декомпозиция:
\[ \mathrm{PnL}_t = \mathrm{PnL}^{\mathrm{inv}}_t + \mathrm{PnL}^{\mathrm{spread}}_t + \ell(q_t), \]где $\mathrm{PnL}^{\mathrm{inv}}_t = \sum_{i=1}^{t} q_i(P_i - P_{i-1})$, spread P&L — локальная прибыль сделок относительно mid; $\ell(q_t)$ — terminal inventory penalty (здесь $\ell \equiv 0$). Сделки LP–LT на OTC — market orders: LP транслируют price curves (bid/ask как функция объёма).
Liquidity Provider. Market share $m_t^i$ — доля LT-объёма, привлечённого LP $i$; running average $\bar{m}_t$. Target $m^{\mathrm{target}}$ (здесь $=1$). Reward:
\[ R^{\mathrm{LP}}_{t+1} := \omega \cdot \eta \cdot \Delta \mathrm{PnL}^{\gamma}_{t+1} - (1-\omega) \cdot \Delta M_{t+1}(m^{\mathrm{target}}), \] \[ \mathrm{PnL}^{\gamma}_t := \mathrm{PnL}_t - \gamma \sum_{k=1}^{t} |\Delta \mathrm{PnL}^{\mathrm{inv}}_k|, \quad \eta > 0,\; \omega \in [0,1]. \]$\gamma$ — risk aversion (L1-penalty на inventory P&L variation). LP строит цены от референса ECN:
\[ P_t^a(q) = P_t + x_t(q) + \tfrac{1}{2}\epsilon_{t,\mathrm{spread}}\, x_t + \epsilon_{t,\mathrm{skew}}\, x_t, \quad P_t^b(q) = P_t - x_t(q) - \tfrac{1}{2}\epsilon_{t,\mathrm{spread}}\, x_t + \epsilon_{t,\mathrm{skew}}\, x_t. \]$\epsilon_{t,\mathrm{spread}} \geq -1$ — симметричный spread tweak; $\epsilon_{t,\mathrm{skew}} \in \mathbb{R}$ — skewing/internalization. Действия LP: $(\epsilon_{t,\mathrm{spread}}, \epsilon_{t,\mathrm{skew}}, \epsilon_{t,\mathrm{hedge}})$, где hedge fraction $\epsilon_{t,\mathrm{hedge}} \in [0,1]$ — market order на ECN. Состояния: $P_t$, $q_t$, $T_t$, $\bar{m}_t$, ликвидность top-$m$ уровней ECN, cost of hedging. Тип: $(\gamma, \eta, \omega, m^{\mathrm{target}})$ и доли связанных LT supertypes.
Liquidity Taker. LT выбирает buy/sell $q^{\mathrm{LT}}$ или no trade $\{1,-1,0\}$. Reward:
\[ R^{\mathrm{LT}}_{t+1} := \omega \cdot \eta \cdot \Delta \mathrm{PnL}^{\gamma}_{t+1} - (1-\omega) \cdot \Delta Q_{t+1}(q^a, q^b), \] \[ Q_{t+1}(q^a, q^b) := \tfrac{1}{2}\sum_{j \in \{a,b\}} |\bar{q}_t^j - q^j|, \quad \bar{q}_t^j = \tfrac{1}{t+1}\sum_{k=0}^{t} \mathbf{1}_{\{a_k = j\}}. \]При $0 < \omega < 1$ и высоком $\eta$ — optimal execution: достичь $(q^a, q^b)$ при максимизации P&L. LT с $\omega=0$ — flow LTs; с $\omega=1$ — PnL LTs.
| Класс | LP | LT |
|---|---|---|
| Состояния $s_t$ | $P_t$, $q_t$, $T_t$, $\bar{m}_t$, ликвидность ECN, cost of hedging | $P_t$, $q_t$, $T_t$, $\bar{q}_t^a$, $\bar{q}_t^b$, cost of trading $q^{\mathrm{LT}}$ |
| Тип $\lambda$ | $\gamma, \eta, \omega, m^{\mathrm{target}}$, доли LT supertypes | $\gamma, \eta, \omega, q^a, q^b, q^{\mathrm{LT}}$, доли LP supertypes |
| Действия $a_t$ | $\epsilon_{\mathrm{spread}}$, $\epsilon_{\mathrm{skew}}$, $\epsilon_{\mathrm{hedge}}$ | $\{1,-1,0\}$ |
| Reward $R_{t+1}$ | $\omega \eta \Delta \mathrm{PnL}^\gamma - (1-\omega)\Delta M$ | $\omega \eta \Delta \mathrm{PnL}^\gamma - (1-\omega)\Delta Q$ |
2.3. Модель ECN
2.3.1. Базовая (vanilla) модель
ECN — референсная цена и площадка хеджа. LOB эволюционирует от заявок LP, LT и ECN-агента. ECN-агент строит список market/limit/cancel orders по модели (7)–(8); LOB не следует этим уравнениям напрямую — только от реальных заявок.
Фиксированная price grid с tick $\xi$ (для EBS eurodollar $\xi = 0{,}5$ bp). Snapshot LOB — пары векторов объёмов на bid/ask. Калибровка на level-2 data (top $m=5$ уровней); экстраполяция дальних уровней $e^{-\alpha k}$.
Вектор $S_{n+1}$ размерности $2m+2$: относительные изменения объёмов $(\delta_{i,n})$, spread и mid-price change (в тиках):
\[ S_{n+1} := \big((\delta_{i,n})_{i \in [1,2m]},\; \xi^{-1}(P_{n+1}^a - P_{n+1}^b),\; \xi^{-1}(P_{n+1} - P_n)\big). \]Динамика объёма на уровне $i$:
\[ \Delta V_{i,n} = V_{i,n+1} - V_{i,n} = -\delta_{i,n}^- V_{i,n} + \delta_{i,n}^+, \quad \delta_{i,n}^+ := \max(\delta_{i,n},0),\; \delta_{i,n}^- := \max(-\delta_{i,n},0) \in [0,1]. \]Гибридная multiplicative-absolute формулировка обеспечивает стабильность: $\lim_{n \to \infty} \mathbb{E}[V_{i,n}] < +\infty$.
Theorem 2.2. Continuous-time limit динамики (8) — multivariate Ornstein–Uhlenbeck с квадратичной covariance structure $Q(V^*_t - \mu^\infty)$, обобщающей Cont and Müller (2021) (случай $\sigma^+ = 0$). Proposition 2.3 — long-range mean $\mu_i^\infty = \mu_i^+ / \mu_i^-$. Corollary 2.4 — univariate OU с $Q(x) = \sigma_\infty^2 + \sigma_-^2 x^2 + 2\sigma_-(\sigma_- \mu^\infty - \rho \sigma_+) x$. Proposition 2.6 — self-exciting/self-inhibiting regimes в зависимости от $(\sigma_\pm, \mu_\pm, \rho)$. Доказательства — приложение PDF.
2.3.2. Нейросетевая экстензия
Недостаток vanilla: snapshot variations $S_t$ независимы и i.i.d. Нейросетевая экстензия (Ha and Schmidhuber 2018): LSTM кодирует историю $(S_j)_{j \in [t-k+1,t]}$ ($k=20$) в latent 32; конкатенация с $S_t$ и MDN выдаёт параметры Gaussian mixture ($n_{\mathrm{mix}}=5$ компонент): weights, means, variances, correlations.
| Модель | Train | Validation | Test |
|---|---|---|---|
| Vanilla | 8.89 | 6.23 | 8.94 |
| Neural w/ fixed correlation | 18.32 | 15.79 | 15.64 |
| Neural w/ shared correlation | 23.40 | 21.90 | 21.63 |
3. Игровой анализ и свойства сходимости
3.1. Shared equilibria: сходимость shared-policy learning при стационарных LT
LT не обучаются: $\pi^{\mathrm{LT}}$ фиксирована — часть среды. LP разных типов обучаются под shared policy. Аналогия: шахматы — алгоритм должен быть хорош и за белых, и за чёрных.
Shared policy gradient (Gupta et al. 2017):
\[ \nabla^{\mathrm{shared}}_{\theta,B} = \frac{1}{n_{\mathrm{LP}}} \sum_{i=1}^{n_{\mathrm{LP}}} g_i^B. \]Proposition 3.1. $\nabla^{\mathrm{shared}}_{\theta,\infty} = \nabla_1 \widehat{V}(\pi_\theta, \pi_\theta)$, где $\widehat{V}(\pi_1, \pi_2) := \mathbb{E}_{\alpha \sim U[1,n_{\mathrm{LP}}]}[\widetilde{V}_{\Lambda_\alpha^{\mathrm{LP}}}(\pi_1, \pi_2)]$ — utility случайно выбранного агента, улучшающего политику при фиксированных остальных.
Definition 3.3 (Shared Equilibrium). Shared (resp. $\epsilon$-shared) equilibrium $\pi^*$ — symmetric Nash (resp. $\epsilon$-Nash) на pure strategy space $\mathcal{X}^{\mathrm{LP}}$ с payoff $\widehat{V}$ — Functional Form Game (Balduzzi et al. 2019). Self-play по (11) — механизм policy sharing.
При $\Lambda_i^{\mathrm{LP}} := \lambda_i^{\mathrm{LP}} := i$ shared equilibria совпадают с Nash underlying game. При общих supertypes — symmetric Bayesian Nash equilibria. Parameter sharing интерполирует $\pi(\cdot \mid \cdot, \lambda)$ по типу через generalization нейросети.
Assumption 3.4 (Extended transitivity). Существует bounded $\Phi: \mathcal{S} \to \mathbb{R}$: если $u(y,x) - u(x,x) > \epsilon$, то $\Phi(y) - \Phi(x) > \delta_\epsilon$. Связь с generalized ordinal potential games (Monderer and Shapley 1996). Theorem 3.7: при extended transitivity существует $\epsilon$-shared equilibrium, достижимое за конечное число self-play шагов; при конечных spaces — exact shared equilibrium.
Theorem 3.9. Projected Gradient Ascent с direct parametrization: число итераций $N = O\!\left(\frac{\mathrm{diam}(\Phi)}{\phi}\cdot \frac{D_\epsilon^2 |S^{\mathrm{LP}}||S^{\lambda^{\mathrm{LP}}}|}{\alpha(2-\alpha\beta) \cdot \epsilon^2}\right)$ для $\epsilon$-shared equilibrium. Theorems 3.13, 3.14 — softmax + log-barrier при multiplicative noise; сходимость с высокой вероятностью при большом $K = |S^{\mathrm{LP}}||S^{\lambda^{\mathrm{LP}}}||A^{\mathrm{LP}}|$. Доказательства — PDF.
3.2. Эмпирический анализ компонент игры
Differentiable games (Letcher et al. 2019): game gradient $G = (\nabla_{\theta_i} V_i)$, Jacobian $J_{ij} = \nabla^2_{\theta_i,\theta_j} V_i$. Декомпозиция $J = S^* + A^*$ — potential vs Hamiltonian. Definition 3.17: Hamiltonian weight $\omega^A(\theta) = \|A^{eT} G\| / (\|A^{eT} G\| + \|S^e G\|)$; potential weight $\omega^S = 1 - \omega^A$. Self-interactions исключены из $S$ для fair comparison.
4. Калибровка супертипов к целевым равновесиям
Калибровка — подбор supertype profile $\Lambda := (\Lambda^{\mathrm{LP}}, \Lambda^{\mathrm{LT}})$ под внешние targets на shared equilibrium. Baseline — Bayesian optimization (BO): surrogate GP, но большие скачки $\Lambda$ мешают shared policy адаптироваться; BO замедляется из-за роста covariance matrix.
CALSHEQ (Algorithm 1): RL calibrator agent выбирает increments $\delta\Lambda$; обучается на slower timescale ($\alpha_n^{\mathrm{cal}} = o(\alpha_n^{\mathrm{shared}})$) — two-timescale SA (Borkar 1997). Reward calibrator:
\[ r_{\mathrm{cal}} = \sum_{k=1}^{K} w_k\, \ell_k^{-1}\!\left(f_*^{(k)} - f_{\mathrm{cal}}^{(k)}((z_t)_{t \geq 0})\right). \]Objective: $V^{\mathrm{calib}}(\pi_n, \pi_n^\Lambda) := \mathbb{E}[r_{\mathrm{cal}}]$. Updates (22)–(23) для shared policy и calibrator. Theorem 4.7: при assumptions 4.1–4.6 iterates сходятся a.s. к $(f_{\mathrm{eq}}(\theta^{*\Lambda}), \theta^{*\Lambda})$. Extended transitivity calibrator game (Assumption 4.3) заменяет global asymptotic stability ODE. Детали assumptions и proof — PDF.
5. Эксперименты
Shared LP, LT и calibrator policies — PPO (clip 0.3, KL target 0.01, lr $10^{-4}$). Episodes $T=100$, $B=60$ parallel runs, batch $n_{\mathrm{agents}} \cdot T \cdot B$. FC net 2×256, tanh. Discount $\zeta=1$. RLlib на AWS C5.24xlarge (96 CPU), ~0.5 day/experiment.
5.1. Калибровка
Setup. Стационарные LT: buy/sell с равной вероятностью ($\omega=0$, $q^a=q^b=0.5$). 500 LT в 10 supertypes ($q^{\mathrm{LT}}=i$). LP: $\omega=1$, 2 supertypes, 5–10 LP, 20–23 параметра калибровки. Targets: market share supertype 1, percentiles распределения per-trade quantity (9 percentiles × supertypes). BO baseline: $M=100$ policy iterations между BO steps, UCB $\kappa=0.5$, Matérn kernel.
CALSHEQ превосходит BO по: (1) calibrator reward — плавнее и быстрее; (2) LP rewards не diverge; (3) плавная эволюция $\Lambda$ (fig. 29–32 в PDF). Ablation (fig. 25 в PDF): CALSHEQ_no_state (без state, прямой sample $\Lambda$) существенно хуже.
5.2. Эмерджентное поведение агентов
Обучаем $\pi^{\mathrm{LT}}$ и $\pi^{\mathrm{LP}}$; варьируем атрибуты первого LP: connectivity к flow/PnL LT, P&L weight, risk aversion $\gamma \in [0,2]$. Base: 2 LP supertypes ($\gamma=0.5$, 1 и 2 агента); 12 flow LT + 2 PnL LT; fully connected.
Метрики после 100 episodes на фиксированном типе. Flow response $F(\epsilon)$ — средний поток при цене $\epsilon$. Skewing intensity — slope регрессии $\epsilon_{t,\mathrm{skew}} = f(q_t)$.
Skewing. Больше flow LT connectivity → интенсивнее skewing (fig. 10–11): flow LT дают постоянный поток ликвидности. Выше risk aversion → интенсивнее skewing и ниже $|q_t|$ (fig. 9). Выше P&L weight → слабее skewing (cost P&L). Больше PnL LT connectivity → интенсивнее skewing (аналог risk aversion через inventory P&L penalty).
Hedging. Hedge fraction растёт с risk aversion и PnL LT connectivity; падает с P&L weight и flow LT connectivity (fig. 12) — internalization через skewing дешевле.
Pricing. Выше P&L weight или PnL LT connectivity → менее competitive pricing (fig. 15). Больше flow LT connectivity → competitive pricing (больше revenue).
Inventory holding time. Растёт с P&L weight; падает с risk aversion и flow LT connectivity (fig. 13–14).
Flow, market share, P&L. PnL LT flow падает резче при росте P&L weight (fig. 16). Market share и P&L — fig. 17–18: trade-off P&L vs market share при variation $\omega$.
6. Заключение
Формализовали взаимодействия LP и LT на дилерском рынке как multi-stage, multi-type stochastic game. Показали, что параметризованные семейства reward + shared policy learning позволяют RL-агентам вырабатывать эмерджентное поведение под спектр целей (P&L, optimal execution, market share). LP естественно балансируют hedging и skewing. Введён RL-алгоритм калибровки CALSHEQ, эффективно накладывающий ограничения на равновесие. Теоретически — скорости сходимости multi-agent policy gradient при extended transitivity, связанной с generalized ordinal potential games.
Благодарности. Arnaud Floesser, Cathy Lin, Chi Nzelu и FX ATS team, J.P. Morgan CIB.
Disclaimer. Документ подготовлен J.P. Morgan AI Research для информационных целей, не является investment research/advice.
Литература
- Agarwal, A., Kakade, S. M., Lee, J. D., and Mahajan, G. (2021). On the theory of policy gradient methods: Optimality, approximation, and distribution shift. J. Mach. Learn. Res., 22(1).
- Amihud, Y. and Mendelson, H. (1980). Dealership market: Market-making with inventory. Journal of financial economics, 8(1):31–53.
- Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M. W., Pfau, D., TomSchaul, Shillingford, B., and Freitas, N. D. (2016). Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems.
- Ardon, L., Vadori, N., Spooner, T., Xu, M., Vann, J., and Ganesh, S. (2021). Towards a fully RL-based market simulator. Proceedings of the 2nd International Conference on AI in Finance.
- Avegliano, P. and Sichman, J. S. (2019). Using surrogate models to calibrate agent-based model parameters under data scarcity. In AAMAS.
- Avellaneda, M. and Stoikov, S. (2008). High-frequency trading in a limit order book. Quantitative
- Finance, 8(3):217–224.
- Balduzzi, D., Garnelo, M., Bachrach, Y., Czarnecki, W., Perolat, J., Jaderberg, M., and Graepel, T. (2019). Open-ended learning in symmetric zero-sum games. In Chaudhuri, K. and Salakhutdinov, R., editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 434–443, Long Beach, California, USA. PMLR.
- Bank, P., Ekren, I., and Muhle-Karbe, J. (2021). Liquidity in competitive dealer markets. Mathematical Finance.
- Barzykin, A., Bergault, P., and Guéant, O. (2021). Market making by an fx dealer: tiers, pricing ladders and hedging rates for optimal risk control. http://arxiv.org/abs/2112.02269.
- Barzykin, A., Bergault, P., and Guéant, O. (2023). Algorithmic market making in foreign exchange cash markets with hedging and market impact. Mathematical Finance, 33(1):41–79. Benaïm, M. (1999). Dynamics of stochastic approximation algorithms. Le Séminaire de Probabilités XXXIII. Lecture Notes in Math., 1709:1–68.
- Bergault, P. and Guéant, O. (2021). Size matters for otc market makers: general results and dimensionality reduction techniques. Mathematical Finance, 31(1).
- Borkar, V. S. (1997). Stochastic approximation with two time scales. Systems & Control Letters.
- Brown, G. W. (1951). Iterative solution of games by fictitious play. Activity Analysis of Production and Allocation.
- Bubeck, S. (2015). Convex optimization: Algorithms and complexity. Found. Trends Mach. Learn., 8(3–4):231–357.
- Candogan, O., Menache, I., Ozdaglar, A., and Parrilo, P. A. (2011). Flows and Decompositions of Games: Harmonic and Potential Games. Mathematics of Operations Research, 36(3):474–503.
- Cao, Y., Chen, T., Wang, Z., and Shen, Y. (2019). Learning to optimize in swarms. In Advances in Neural Information Processing Systems.
- Cartea, A., Jaimungal, S., and Penalva, J. (2015). Algorithmic and high-frequency trading. Cambridge University Press.
- Chan, N. T. and Shelton, C. (2001). An electronic Market-Maker. Technical Report, MIT AI Lab.
- Cont, R. and Müller, M. S. (2021). A stochastic partial differential equation model for limit order book dynamics. SIAM Journal on Financial Mathematics, 12(2):744–787.
- Cont, R. and Xiong, W. (2022). Dynamics of market making algorithms in dealer markets: Learning and tacit collusion.
- Czarnecki, W. M., Gidel, G., Tracey, B., Tuyls, K., Omidshafiei, S., Balduzzi, D., and Jaderberg, M. (2020). Real world games look like spinning tops. In Larochelle, H., Ranzato, M., Hadsell, R.,
- Balcan, M., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 17443–17454. Curran Associates, Inc.
- Dalal, G., Szörényi, B., Thoppe, G., and Mannor, S. (2018). Finite sample analysis of two-timescale stochastic approximation with applications to reinforcement learning. In Proc. Conference on Learning Theory (COLT).
- Darley, V., Outkin, A., Plate, T., and Gao, F. (2000). Sixteenths or pennies? observations from a simulation of the nasdaq stock market. In Proceedings of the IEEE/IAFE/INFORMS 2000 Conference on Computational Intelligence for Financial Engineering (CIFEr) (Cat. No.00TH8520), pages 151–154.
- Das, S. (2005). A learning market-maker in the Glosten-Milgrom model. In Quantitative Finance.
- Das, S. (2008). The effects of market-making on price dynamics. In Proceedings of the 7th international joint conference on Autonomous agents and multiagent systems - Volume 2, pages 887–894. International Foundation for Autonomous Agents and Multiagent Systems.
- Duersch, P., Oechssler, J., and Schipper, B. (2012). Pure strategy equilibria in symmetric two-player zero-sum games. In Int J Game Theory, volume 41, pages 553–564.
- Eiben, A., Horvath, M., Kowalczyk, W., and Schut, M. (2007). Reinforcement learning for online control of evolutionary algorithms. Engineering Self-Organising Systems, pages 151–160.
- Ethier, S. and Kurtz, T. (1986). Markov Processes: Characterization and Convergence. Wiley.
- Finn, C., Levine, S., and Abbeel, P. (2016). Guided cost learning: Deep inverse optimal control via policy optimization. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, page 49–58. JMLR.org.
- Foerster, J. N., Assael, Y. M., de Freitas, N., and Whiteson, S. (2016). Learning to communicate with deep multi-agent reinforcement learning. Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 2145–2153.
- Ganesh, S., Vadori, N., Xu, M., Zheng, H., Reddy, P., and Veloso, M. (2019). Reinforcement learning for market making in a multi-agent dealer market. NeurIPS 2019 Workshop on Robust AI in Financial Services.
- Garman, M. B. (1976). Market microstructure. Journal of financial economics, 3(3):257–275.
- Ghoshal, S. and Roberts, S. (2016). Optimal FX market making under inventory risk and adverse selection constraints. Technical report, Working paper.
- Glosten, L. R. and Milgrom, P. R. (1985). Bid, ask and transaction prices in a specialist market with heterogeneously informed traders. Journal of financial economics, 14(1):71–100. Guéant, O. (2017). Optimal market making. Applied Mathematical Finance. Guéant, O., Lehalle, C.-A., and Fernandez-Tapia, J. (2013). Dealing with the inventory risk: a solution to the market making problem. Mathematics and Financial Economics, 7(4):477–507.
- Gupta, J. K., Egorov, M., and Kochenderfer, M. (2017). Cooperative multi-agent control using deep reinforcement learning. In Autonomous Agents and Multiagent Systems, pages 66–83. Springer International Publishing.
- Ha, D. and Schmidhuber, J. (2018). Recurrent world models facilitate policy evolution. Advances in Neural Information Processing Systems (NeurIPS).
- Hambly, B. M., Xu, R., and Yang, H. (2021). Policy gradient methods find the nash equilibrium in n-player general-sum linear-quadratic games. https://dx.doi.org/10.2139/ssrn.3894471.
- Hansen, E. A., Bernstein, D. S., and Zilberstein, S. (2004). Dynamic programming for partially observable stochastic games. AAAI.
- Hefti, A. (2017). Equilibria in symmetric games: theory and applications. Theoretical Economics, 12:979–1002.
- Ho, T. and Stoll, H. R. (1981). Optimal dealer pricing under transactions and return uncertainty. Journal of financial economics, 9(1):47–73.
- Jumadinova, J. and Dasgupta, P. (2010). A comparison of different automated market-maker strategies. In 12th Workshop on Agent-Mediated Electronic Commerce, pages 141–154.
- Konda, V. R. and Tsitsiklis, J. (2004). Convergence rate of linear two-timescale stochastic approximation. The Annals of Applied Probability, 14(2):796–819.
- Lamperti, F., Roventini, A., and Sani, A. (2018). Agent-based model calibration using machine learning surrogates. Journal of Economic Dynamics and Control, 90:366–389.
- Lanctot, M., Zambaldi, V., Gruslys, A., Lazaridou, A., Tuyls, K., Perolat, J., Silver, D., and Graepel, T. (2017). A unified game-theoretic approach to multiagent reinforcement learning. In Guyon, I.,
- Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 30.
- Leal, L., Lauriere, M., and Lehalle, C.-A. (2022). Learning a functional control for high-frequency finance. Quantitative Finance, 22(11):1973–1987.
- Leonardos, S., Overman, W., Panageas, I., and Piliouras, G. (2021). Global convergence of multiagent policy gradient in markov potential games. Advances in Neural Information Processing Systems (NeurIPS).
- Leslie, D. S. and Collins, E. (2002). Convergent multiple-timescales reinforcement learning algorithms in normal form games. Annals of App. Prob.
- Letcher, A., Balduzzi, D., Racaniere, S., Martens, J., Foerster, J., Tuyls, K., and Graepel, T. (2019). Differentiable Game Mechanics. Journal of Machine Learning Research.
- Li, K. and Malik, J. (2017). Learning to Optimize. ICLR.
- Li, Z. and Wellman, M. P. (2020). Structure learning for approximate solution of Many-Player games. In AAAI, pages 2119–2127.
- Li, Z. and Wellman, M. P. (2021). Evolution Strategies for Approximate Solution of Bayesian Games. Proceedings of the AAAI Conference on Artificial Intelligence.
- Liang, E., Liaw, R., Nishihara, R., Moritz, P., Fox, R., Goldberg, K., Gonzalez, J., Jordan, M., and
- Stoica, I. (2018). RLlib: Abstractions for distributed reinforcement learning. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 3053–3062.
- Lim, Y.-S. and Gorse, D. (2018). Reinforcement learning for High-Frequency market making. In ESANN.
- Lockhart, E., Lanctot, M., Pérolat, J., Lespiau, J.-B., Morrill, D., Timbers, F., and Tuyls, K. (2019). Computing approximate equilibria in sequential adversarial games by exploitability descent. In Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI).
- Lowe, R., Wu, Y., Tamar, A., Harb, J., Abbeel, P., and Mordatch, I. (2017). Multi-agent actor-critic for mixed cooperative-competitive environments. Neural Information Processing Systems (NIPS).
- Mahajan, A., Rashid, T., Samvelyan, M., and Whiteson, S. (2019). Maven: Multi-agent variational exploration. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc.
- McMahan, H. B., Gordon, G. J., and Blum, A. (2003). Planning in the presence of cost functions controlled by an adversary. In Proceedings of the Twentieth International Conference on International Conference on Machine Learning, ICML’03, page 536–543. AAAI Press.
- Mescheder, L., Nowozin, S., and Geiger, A. (2017). The Numerics of GANs. NeurIPS.
- Mnih, V., Badia, A. P., Mirza, M., Graves, A., Harley, T., Lillicrap, T. P., Silver, D., and Kavukcuoglu, K. (2016). Asynchronous methods for deep reinforcement learning. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, page 1928–1937. JMLR.org.
- Monderer, D. and Shapley, L. S. (1996). Potential Games. Games and Economic Behavior, 14:124–143.
- Oomen, R. (2017). Execution in an aggregator. Quantitative Finance, 17(3).
- Perrin, S., Lauriere, M., Perolat, J., Elie, R., Geist, M., and Pietquin, O. (2022). Generalization in mean field games by learning master policies. AAAI.
- Ramponi, G. and Restelli, M. (2021). Newton optimization on helmholtz decomposition for continuous games. AAAI.
- Rashid, T., Samvelyan, M., de Witt, C. S., Farquhar, G., Foerster, J. N., and Whiteson, S. (2018). Qmix - monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning.
- Salimans, T., Ho, J., Chen, X., and Sutskever, I. (2017). Evolution Strategies as a Scalable Alternative to Reinforcement Learning. https://arxiv.org/abs/1703.03864.
- Schrimpf, A. and Sushko, V. (2019a). FX trade execution: complex and highly fragmented. BIS Quarterly Review, December 2019.
- Schrimpf, A. and Sushko, V. (2019b). Sizing up global foreign exchange markets. BIS Quarterly
- Review, December 2019.
- Schulman, J., Levine, S., Abbeel, P., Jordan, M., and Moritz, P. (2015). Trust region policy optimization. In Bach, F. and Blei, D., editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1889–1897.
- Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. (2017). Proximal Policy Optimization Algorithms. https://arxiv.org/abs/1707.06347.
- Shen, Z., Ribeiro, A., Hassani, H., Qian, H., and Mi, C. (2019). Hessian aided policy gradient. Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research.
- Spooner, T., Fearnley, J., Savani, R., and Koukorinis, A. (2018). Market making via reinforcement learning. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS ’18, page 434–442, Richland, SC. International Foundation for Autonomous Agents and Multiagent Systems.
- Spooner, T. and Savani, R. (2020). Robust market making via adversarial reinforcement learning. In
- Bessiere, C., editor, Proceedings of the Twenty-Ninth International Joint Conference on Artificial
- Intelligence, IJCAI-20, pages 4590–4596. International Joint Conferences on Artificial Intelligence Organization. Special Track on AI in FinTech.
- Srinivas, N., Krause, A., Kakade, S., and Seeger, M. (2016). Gaussian process optimization in the bandit setting: No regret and experimental design. ICML.
- Srinivasan, S., Lanctot, M., Zambaldi, V., Pérolat, J., Tuyls, K., Munos, R., and Bowling, M. (2018). Actor-critic policy optimization in partially observable multiagent environments. In Advances in Neural Information Processing Systems (NeurIPS).
- Sunehag, P., Lever, G., Gruslys, A., Czarnecki, W. M., Zambaldi, V. F., Jaderberg, M., Lanctot, M., Sonnerat, N., Leibo, J. Z., Tuyls, K., and Graepel, T. (2018). Value-decomposition networks for cooperative multi-agent learning based on team reward. In International Conference on Autonomous Agents and Multiagent Systems.
- Tamar, A., Di Castro, D., and Mannor, S. (2012). Policy gradients with variance related risk criteria. In ICML.
- Tamar, A. and Mannor, S. (2013). Variance adjusted actor critic algorithms. ArXiv, abs/1310.3697.
- Tyurin, I. S. (2011). On the convergence rate in lyapunov’s theorem. Theory of Probability & Its
- Applications, 55(2):253–270.
- Vadori, N., Ganesh, S., Reddy, P., and Veloso, M. (2020). Calibration of Shared Equilibria in General Sum Partially Observable Markov Games. Advances in Neural Information Processing Systems (NeurIPS).
- Wah, E., Wright, M., and Wellman, M. P. (2017). Welfare effects of market making in continuous double auctions. Journal of Artificial Intelligence Research, 59:613–650.
- Wu, J., Hu, W., Xiong, H., Huan, J., Braverman, V., and Zhu, Z. (2020). On the noisy gradient descent that generalizes as SGD. In III, H. D. and Singh, A., editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning
- Research, pages 10367–10376. PMLR.
- Yu, C., Velu, A., Vinitsky, E., Wang, Y., Bayen, A., and Wu, Y. (2021). The surprising effectiveness of ppo in cooperative, multi-agent games. https://arxiv.org/abs/2103.01955.
- Zheng, S., Trott, A., Srinivasa, S., Naik, N., Gruesbeck, M., Parkes, D. C., and Socher, R. (2020). The AI Economist: Improving equality and productivity with AI-driven tax policies. https://arxiv.org/abs/2004.13332.
Оригинал статьи: Vadori et al., «Towards Multi-Agent Reinforcement Learning driven Over-The-Counter Market Simulations», arXiv:2210.07184