Overview
In these notes we introduce the ideas behind the IPOR Protocol’s liquidity pool risk analysis performed by market simulation
In IPOR cancelable swaps, the liquidity pool provides capital to the Automated Market Maker (AMM) underwriting interest rate swaps for parties willing to swap fixed or floating interest rates. The intended behaviour is to design the AMM and its market in such a way that its spreads will skew towards more desirable trades, incentivising a balance of the books. Over the long run, its fees and dynamic spreads calculation should make the venue attractive for all market participants.
In these notes, we will dive into one version of the stochastic control optimisation methods employed to study the pool’s behaviour (for an introduction to stochastic control see [3]).
In order to study different risk profiles of the pool, we will essentially iterate over the following steps:
<aside> 💡 1. Model the market, i.e., model: a. IPOR rates as a hull-white with jump diffusion (see [1] ) b. Agents as Hawkes processes (see [2] ) c. Spreads following Longstaff-Schwartz pricing (see [1])
Build a simulation engine on a private deployment of the Ethereum blockchain (running the same smart contracts as in mainnet)
Use dynamic programming to optimise the different risk metrics and objective functions.
Report analysis and iterate over steps to refine model.
</aside>
In the rest of these notes, we will do a quick overview of the main steps in our analysis and discuss some of our preliminary findings.
One way to look at our problem is that we want to optimise the expected absolute SOAP at a time in the future:
$$ min_{(\gamma,L, spreads)} \{| E[SOAP_T]|\} $$
Where the model is given by:
$$ dI_t = \alpha(\theta_t - I_t)\,dt + \sigma_tdW_t + J dN_t \\ dSOAP_t = dSOAP_t^{fix} + dSOAP_t^{flt} \\ SOAP_t^{leg} = \sum C_i \cdot L_i \cdot sign(leg) \cdot (I_t - fix_i), (\forall i \in \mathbb{C})\\ Open_t^{leg} \sim HP(\lambda_{leg}) \\ Cancel_t^{leg} \sim Exp(|I_t - \text{vwa}R_t^{leg}|) \\ dWealth_t = (dOpen_t^{fix} + dOpen_t^{flt}) \cdot \gamma $$
Where $I_t$ is the IPOR rate at time $t$, $SOAP$ is the sum of all payoffs (the unrealised PnL of the liquidity pool), and $leg \in \{payFix, receiveFix\}$ with $sign(leg) = 1$ if $leg = payFix$, $-1$ otherwise. The set of all open contracts is denoted by $\mathbb{C}$, $C_i$ and $L_i$ are the collateral and leverage for contract $i$. While $L$ (no subscript $i$) is the maximum allowed leverage and $\gamma$ is the fees per contract. $HP$ stands for Hawkes Process (see [2] for more details on HP), $\lambda_{leg}$ is the intensity in which the HP triggers. The Cancel rate of contracts (optionality being exercised) is given by an exponential distribution that increases as the contracts are out of the money ($\text{vwar}R_t^{leg}$ is the volume weighted average rate of the pool at time $t$, split per leg ). Finally, the wealth of the pool is given by the number of contracts open times the fees.
Let’s see some of the results we obtain by running our calibrated model on our simulation engine.
First we simulate 90 days of IPOR rates as a Hull-White process, and Hawkes processes for the opening of contracts. See the plot below for the result: