<aside> ◻️ This methodology document covers the construction of the on-chain pricing mechanism for Inter-Protocol Offered Rate (IPOR) cancellable swaps on candidate stablecoins together with the off-chain benchmark model used as a reference benchmark.

</aside>

Introduction

This document is concerned with the challenge of pricing cancellable swaps referenced against the IPOR Index. Traditionally, one would collect market data on instruments priced on the target rates and use the data to bootstrap a yield curve against which standard valuation methods could be employed. However, the DeFi lending platforms that IPOR is referenced against are not yet sufficiently mature to admit futures markets and similar products. Consequently, IPOR has utilized a data driven approach to build pricing models for constructing an on-chain spread pricing model for cancellable swaps.

This white paper describes this pricing approach for IPOR swaps.

Here is a quick step-by-step summary of our pricing strategy:

<aside> ➕ Here are the main steps for building the IPOR spread AMM formula. For each token (USDT, USDC, DAI, etc..) we do the following:

Step 1: Build an interest rate curve by fitting an interest rate model to historical IPOR

Step 2: Price the fair value of IPOR SWAPs via dynamic programming (Longstaff-Schwartz). [Output]: a spread rule $S_{leg}(\sigma^2, r_t- \theta)$ as a function of volatility ($\sigma^2$ ) and IPOR rate ($r_t$) distance to the historical mean ($\theta$).

Step 3: Fit a step-wise linear function ($f_{leg}(\sigma^2, r_t- \theta)$) to the output of step 2, i.e., $S_{leg} \approx f_{leg}$, where $f_{leg}$ is of the form: $\qquad f_\text{leg}(x,y) = \max(B_1^{leg}+V_1\,x+M_1\,y,\,\,B_2+V_2\,x+M_2\,y)$

Step 4: The $f_{leg}$ ‘s parameters ($B,V, M$ from step 3) are input as parameters on the AMM smart contract.

</aside>

The Model and Swap Product

The stochastic process we utilize to model IPOR rates is the Hull-White jump-diffusion model, which describes the IPOR rate $r_t$ described in detail in [1]. A (non-cancellable) swap product locks the holder of this contract into exchanging floating IPOR rate $r_t$ for a fixed rate $r_{\text{fix}}$ for a specified time $T$. With rates fixed at periods $t_i$, the coupon on each period is

$$ C_{t_i} = \begin{cases}r_{t_i}-r_\text{fix}, & \text{pay fixed}\\ r_\text{fix}-r_{t_i}, & \text{receive fixed}\end{cases} $$

for $i\in\{1, N\}$ with $t_N=T$. Clearly the coupons $C_{t_i}$ can be positive or negative depending on the path, where the positive values are advantageous for the holder of the swap and negative values are disadvantageous.

A cancellable swap permits the holder to monetize this to their advantage by allowing the product to run when in positive territory, but with the added feature that the holder can cancel the swap without penalty if coupons are likely to be more negative than positive.

Reference Value of IPOR

Before defining the Reference value for IPOR let us define the moving average notation for the index as follows.

We denote by $\left[ EMA_t\right]$ the exponential moving average, and we denote by $r_t$ the IPOR rate at the current block height (only the present matters). We define the exponential moving average in details in the appendix.

For the pay-fix leg, the reference value of IPOR is the current value of IPOR if it is higher than the moving average of IPOR, while for the pay-float leg, the reference value of IPOR is the value of IPOR if it is lower than the moving average of IPOR. As given below:

<aside> 🤖 Reference Value ($Ref_{leg,n}$) $IPOR$ reference value at height $h$ if given by: $Ref_{leg,t} = \begin{cases} max(r_t, EMA_t) & \text{if Leg is pay} \\ min(r_t, EMA_t) & \text{if Leg is receive} \\ \end{cases} \quad$

</aside>

Justification The idea behind using a reference value for IPOR ($Ref_{leg, t}$) instead of using IPOR itself is to decrease the risk of situations where jumps on IPOR value occur, but those new values are not yet stablished or supported by the market. If the quotes by the AMM were to quickly follow jumps in IPOR, the AMM (Automated Market Maker) could be hit with trades at levels that would not be supported for long, leading to unnecessary losses. See the next example:

<aside> 🤖 Example [Bad trade without reference value] Imagine a situation where IPOR value equal to 5% in which the AMM quotes a pay-float leg at 4.5%. Remember that if someone were to enter a $100 pay-float contract with the AMM at this moment, the payoff would be calculated as $100 x (4.5% - 5%) = -0.50. However, imagine that the IPOR jumped from 5% to 10% and that the change will last only 1 block. If the new quote on the pay-float leg were to follow this change immediately (i.e., if the AMM were not using the reference value moving average for its quoting), the new pay-float quote would be 9.5%.

If someone were to enter a $100 contract at that moment, the initial payoff would be the same as before $100 x (9.5% - 10%) = -$0.50, however, because the new value would be supported for only one block, IPOR value would go back to 5% and the payoff for this contract would change to $100 x (9.5% - 5%) = $4.50 (ignoring compounding for simplification), being an immediate loss to the AMM.

</aside>