# Operator Learning and Neural SDEs for Solving SPIDE in Liquidity Modeling ## Introduction and Problem Statement ### Motivation and Project Aim Modeling liquidity profiles in decentralized finance (DeFi), specifically on platforms like *Uniswap*, presents a fundamental challenge due to the coupled effects of market noise and agent behavior. This research proposes to *adapt* existing **Operator Learning** and **Neural Stochastic Differential Equations (Neural SDEs)** to the framework of **Stochastic Partial Integro-Differential Equations (SPIDE)**. The goal is to enable *data-driven identification* of the fundamental operators governing observed liquidity dynamics. ### SPIDE Framework We define the SPIDE governing the liquidity function $u_t(x)$ in the interval $[-L, L]$ as: $$ du_t(x) = \left\{\mathcal{L} u_t - \mathcal{G}(x)[u_t] \right\}dt + \mathcal{S}(x)[u_t] dW_t $$ with an initial condition $u_0(x)$. In this framework: * $\mathcal{L}$ is a differential operator representing local effects like diffusion. * $\mathcal{G}$ and $\mathcal{S}$ are linear non-local operators defined by their respective kernels: $$\mathcal{G}(x)[u] := \int G(x, y) u(y) dy, \quad \mathcal{S}(x)[u] := \int S(x, y) u(y) dy$$ The objective is to "learn" the operators $\mathcal{L}$, $\mathcal{G}$, and $\mathcal{S}$ directly from Uniswap liquidity data. ## Foundational Methods ### Operator Learning and DeepONet *Operator Learning* shifts the focus from learning finite-dimensional mappings to learning mappings between *infinite-dimensional function spaces*. This allows a trained network to approximate solution functions for various input conditions nearly instantaneously. The **Deep Operator Network (DeepONet)** architecture is employed to decompose this approximation into two components: 1. **Branch Net**: Processes the input function $u$ at discrete sensor locations. 2. **Trunk Net**: Processes the output domain coordinates $(t, x)$ to provide a basis of functions. ![image](https://hackmd.io/_uploads/BJ1dzQ9WZl.png) The final output is the dot product of these two networks, allowing the model to generalize across input functions while respecting the spatial-temporal structure of the output domain. ### Neural SDEs and Scalable Training *Neural SDEs model* system dynamics by combining deterministic drift $f_{\theta}$ and stochastic diffusion $g_{\phi}$ parameterized by neural networks: $$ dX_t = f_{\theta}(X_t) dt + g_{\phi}(X_t) dW_t $$ To ensure computational tractability for high-dimensional SPIDEs, we adopt the **Scalable Adjoint Method** developed by *Li et al. (2020)*. Key advantages include: * **Adjoint SDE**: Calculates gradients by evolving backward in time, keeping memory costs independent of the number of solver steps. * **Stochastic Gradients**: Handles noise efficiently through the reparameterization trick. * **Variational Inference**: Provides a framework for uncertainty quantification in risk-sensitive financial modeling. ## Proposed Research and Implementation The project integrates **DeepONet** into the **Neural SDE** framework to replace standard vector-based drift and diffusion functions with operators acting on functions $u_t$. ### Key Implementation Tasks 1. **Operator-SDE Parameterization**: The unknown operators ($\mathcal{L}$, $\mathcal{G}$, $\mathcal{S}$) will be parameterized via DeepONet. The learning task focuses on optimizing the kernel functions $G(x, y)$ and $S(x, y)$ within the network architecture. 2. **SPIDE Adjoint Sensitivity**: We will derive a custom set of coupled adjoint SPIDEs to allow memory-efficient backpropagation through the integro-differential solver. 3. **Variational Loss Function**: A loss function $\mathcal{L}_{\text{total}}$ will be defined using the **Evidence Lower Bound (ELBO)**. This ensures the model effectively learns the distribution of the stochastic liquidity profiles. ## References * Kovachki, N., Li, Z., Liu, B., Azizzadenesheli, K., Bhattacharya, K., Stuart, A., & Anandkumar, A. (2023). Neural operator: Learning maps between function spaces with applications to PDEs. Journal of Machine Learning Research, 24(1), Article 89. * Li, X., Wong, T. L., Chen, R. T. Q., & Duvenaud, D. K. (2020). Scalable gradients and variational inference for stochastic differential equations. In Proceedings of the 2nd Symposium on Advances in Approximate Bayesian Inference (Vol. 118, pp. 1–28). PMLR. https://proceedings.mlr.press/v118/li20a.html * Lu, L., Jin, P., Pang, G., Zhang, Z., & Karniadakis, G. E. (2021). Learning nonlinear operators via DeepONet based on the universal approximation theorem of operators. Nature Machine Intelligence, 3(3), 218–229. https://doi.org/10.1038/s42256-021-00302-5