IPOR Swaps

Interest Rate Derivatives in IPOR as a whole refer to any derivative instrument that uses an IPOR Index value as a contract reference. In the future, there could be multiple types of derivative instruments and contracts that use the IPOR Index as a benchmark rate.

Interest Rate Swap

The IPOR Interest Rate Swap (IRS) is the cornerstone derivative product of IPOR. The IRS allows a market participant to be a Payer or Receiver and take a contract against the liquidity pool. For more detailed information about participants and contracts, reference here.

Once a Payer or Receiver agrees to a contract quoted by the AMM, they will pay the collateral amount (margin), the contract fee, and applicable network fees (i.e., in the case of Ethereum, some ETH must be used to pay for network gas fees) to enter into a derivative smart contract. The liquidity pool will reserve an equal collateral to cover all payoff obligations. Over time the contract will manage the positions and payoffs. Once closed, it will pay the respective sum(s) to the parties.

What is notional?

Notional is the total value of the position that the market participant takes. This should not be confused with collateral. The notional value of derivative contracts is higher than the market value depending on the amount of leverage.

Swap Directions

The IPOR Protocol currently allows the opening of so-called vanilla swaps. That means that traders and LPs are exchanging two streams of cash flow:

  • Interest calculated based on the fixed interest rate

  • Interest calculated based on the floating (sometimes termed variable) interest rate. (see IBT to learn how the floating is tracked )

Let's consider two possible directions of the interest rate swap that you can open on the IPOR protocol:

  • Pay fixed, receive floating.

  • Receive fixed, pay floating.

In Pay Fixed, you are responsible for paying the fixed interest on the notional of your trade, and the AMM will be paying you the floating interest rate determined by IPOR (every time where floating rate is concerned, the IPOR is used). The net difference between what you pay and receive is your P&L.

In Receive Fixed, the flow is reversed.

Let's use an example of a trader who wants to hedge their loan using the IPOR rate as a benchmark between different platforms.

  1. The trader takes a loan of 1.000.000 USDC at a 3.00% floating rate (at the time of opening) and is liable to pay interest on this loan.

  2. Trader opens swap Pay Fixed - Receive Floating at 3.12% (the fixed rate).

  3. Scenario 1: At the maturity of the loan/swap, interest rates were, on average, 3.95%

    1. The trader had to pay additional interest on their loan.

    2. The trader accrued interest on the swap that should cover most of their loss in the form of extra borrowing costs on the loan.

  4. Scenario 2: At the maturity of the loan/swap, interest rates were, on average, 2.55%

    1. The trader paid a lower interest on their loan (compared to what they would have paid at 3.00% - the original rate)

    2. The trader has accrued a loss on their derivative that should be covered by the savings he made on the loan.

Calculating the Payoff

A trader's payoff at the time of the derivative closing is determined by the difference between their fixed and floating legs. In both floating and fixed cases, the Notional Amount of the derivative is used to calculate the amount of interest.

Fixed leg interest

αfix=NeRfixΔTT\alpha_{fix} = N * e^{ \frac{R_{fix} \cdot \Delta T}{T}}

Floating leg interest

αfloating=NIBTn1IBTn\alpha_{floating} = \frac {N}{IBT_{n-1}} * IBT_{n}

The net payout depends on the leg.

Pay fixed - Receive Floating.

αnet=αfloatingαfix\alpha_{net} = \alpha_{floating} - \alpha_{fix}

Receive fixed - Pay Floating

αnet=αfixαfloating\alpha_{net} = \alpha_{fix}-\alpha_{floating}

Note that IBT{n-1} is the value of IBT at the time when the swap was opened, and IBT{n} is the IBT's price at the time of swap closing. N is the notional amount, and IR is the fixed interest rate at which the swap was opened.

Spread

Spread is one way for the AMM to control the risk and essentially price it to the traders. By exchanging one rate for another with the pool, traders effectively transfer risk to the liquidity pool. That service provided by the AMM and Liquidity pool is priced in the form of a spread. For more details, refer to the spread section of this documentation.

Fees

The AMM charges a couple of fees that are summed up at the time the swap is opened:

  • The opening fee is calculated based on the notional of the swap. The DAO sets the fee's rate. Part of the opening fee is paid to the LP pool as compensation for underwriting the derivative's risk and part is set aside in the protocol's treasury.

Forumula for calculating the opening fee

NotionalfeeRate(TimeToMaturityInDays/365)Notional * feeRate * (TimeToMaturityInDays/365)
  • Base flat fee - the rate is set by the DAO. Proceeds from the flat base fee are used predominantly to subsidize the oracle. Once the oracle starts generating more ways to be supported, this fee will be phased out.

Maturity

IPOR Protocol offers swaps with a 28-day (or four weeks), 60 or 90 day tenors. This means that the swap will be up for liquidation once 28, 60 or 90 days have elapsed since the derivative has been opened. The contract is open for liquidation 6 hours before reaching maturity. It will continue to accrue interest until it is either closed by the trader or liquidated by a third party.

Closing and Liquidations

In V2 of IPOR swaps, new mechanism is introduced. Before reaching maturity swaps can be closed by the owner by opening an offsetting swap in the opposite direction. This process is called unwinding.

The two swaps, originally opened and the offsetting one, as pair have a fixed known up-font payoff which, can be calculated immediately when the offsetting position is opened. This is why, offseting position is purely virtual. AMM opens and immediately closes it after the total payoff is calculated.

The whole process is wrapped into one action, and from the perspective of the user, the process is a one-click unwind of the swap.

The cost of unwinding depends on the spread on the opposite leg. If the demand is high, then the cost of unwinding would be higher; if there is little demand cost of unwinding would be marginal.

Formula to calculate the paoff when unwinding reads as follows:

Pay fixed Receive Floating

PnLtoDate=IBTqtyIBTpriceNeRΔTTyearPnL_{toDate} =IBT_{qty} \cdot IBT_{price}- N \cdot e^{\frac{R \cdot \Delta T }{T_{year}}}
payoffreceiveFixed=Collateral+PnLtoDate+N(e(RUrFixTmTyeare(RpFixTmTyear)openingFeepayoff_{receiveFixed} = Collateral + PnL_{toDate} + N \cdot (e ^ {\frac{(R_{UrFix} * T_{m}}{T_{year}}} - e ^ {\frac{(R_{pFix} * T_{m}}{T_{year}}}) - openingFee

Receive fixed Pay floating

PnLtoDate=NeRΔTTyearIBTqtyIBTpricePnL_{toDate} = N \cdot e^{\frac{R \cdot \Delta T }{T_{year}}} - IBT_{qty} \cdot IBT_{price}
payoffreceiveFixed=Collateral+PnLtoDate+N(e(RrFixTmTyeare(RUpFixTmTyear)openingFeepayoff_{receiveFixed} = Collateral + PnL_{toDate} + N \cdot (e ^ {\frac{(R_{rFix} * T_{m}}{T_{year}}} - e ^ {\frac{(R_{UpFix} * T_{m}}{T_{year}}}) - openingFee

Where:

N- notional

Tm- Time to maturity

Tyear - time in the year

R_pFix - currently offered payFixed rate R_rFix - currently offered receiveFixed rate R_UpFix -fixed rate of the pay fixed receive floating swap at the time of unwinding R_UrFix -fixed rate of the receive fixed pay floating swap at the time of unwinding

At maturity, the swap can be closed without the offsetting position.

When a trader decides to close the position, they will be reimbursed the liquidation deposit charged when the derivative is opened.

Besides being closed by the owner, the IPOR Protocol allows the closing of the derivatives by the community given certain conditions:

  • The derivative is within 1 hour of reaching its maturity until full maturity (allowing small bandwidth described in the Configuration Parameters)

  • The derivative has lost all its collateral

  • The derivative has made 100% profit on collateral

After the swap has reached its maturity, it can only be closed by the owner or an appointed in-house liquidation engine.

The winnings and losings are capped at 2X or 0 as there is currently no simple way to enforce a margin top-up by the trader on the blockchain, resulting in an asymmetrical payoff risk against the pool if the contracts were allowed to exceed these limits.

Last updated