APY Calculation

The worst APY that you can get with NillaConnect is the underlying pool's APY, so in other words, using NillaConnect is like using any other lending/borrowing protocols, but you just have a chance of getting better rates!

NillaConnect uses the 3-step slope model to derive its P2P APY. However, since matching P2P results in 100% capital utilization, the utilization rate will not be used as a factor to calculate APY like in the traditional P2P model.

Instead, NillaConnect implements its own interest rate model, where the underlying pool’s (eg. Aave, Compound) real time interest rate is used as a base for the calculation of our P2P APY. NillaConnect's interest rate model is calculated modularly using the length of time that the N-Account is open as the factor to calculate the APY further from the base rate.

The base rate is calculated as:

R=(Supplyuc)+(Borrowu(1c))R = (Supply_u*c)+(Borrow_u*(1-c))

Where:

RR= real time base interest rate from the underlying pool

SupplyuSupply_u= the real time supply rate of the underlying pool

BorrowuBorrow_u= the real time borrow rate of the underlying pool

cc= a constant which represents the index cursor taking the value between {0,1}, ensuring the base rate is between the underlying pool's borrow and supply rate, and determining where the base rate will be between the underlying pool's spread

The P2P APY is given as:

y=mx+by=mx+b

where:

yy= the P2P APY

mm= slope

xx= the period that the N-Account is opened for (in days)

bb = a constant

The APY calculation is divided into 3 phases.

Phase 1

Phase 1 takes place in the early stages of the borrower's open position. In this phase, both borrowers and suppliers enjoy the same P2P rate, which is in between the spreads of the underlying pool, thus, creating a win-win situation between the two parties.

The P2P APY in this phase is defined as:

The P2P APY is given as:

y=mx+by = mx+b

Where:

mm= 0

xx= the period that the N-Account is opened for (in days)

b=Rb=R (the base rate)

This means that the rate remains locked in between the spreads of the underlying pool's rates until the end of phase 1.

Phase 2

Phase 2 introduces a mild gamification aspect into the play. In this phase, the borrower's APY will start to increase until it reaches the borrow rate of the underlying pool. However, borrowers can slow down this increase by staking NLL tokens. More NLL tokens staked means that the Max APY in a phase is decreased according to a multiplier - meaning that the more NLL tokens staked, the less the multiplier is, which is used to multiply the max APY to calculate a new slope that slows down the increase of the APY.

For borrowers with NO NLL tokens staked (original curve):

yb=m2bx+b2by_b=m_2bx+b_2b

Where:

yby_b= the P2P APY that the borrowers use without NLL tokens staked

m2bm_2b= the slope derived from the max APY (underlying pool’s borrow rate) at the end of phase 2

xx= the period that the N-Account is opened for (in days)

b2bb_2b= the constant for borrowers without staked NLL tokens

For borrowers WITH NLL tokens staked (new curve):

This new curve is adjusted for the multiplier so it has a lower max APY and therefore, a new slope, which means a slower increase in the APY over the duration of this phase.

yb=m2bx+b2by_b^*=m_2^*bx+b_2^*b

Where:

yby_b^*= the P2P APY adjusted for staked NLL tokens

m2bm_2^*b= the new slope adjusted by the change in max APY due to the staking of NLL tokens, which means m2b=m2bz2bm_2^*b=m_2b*z_2b

xx= the period that the N-Account is opened for (in days)

b2bb_2^*b= a new constant from the equation adjusted for the staked NLL tokens

Borrower's multiplier for phase 2:

z2b=1(ubnb)z_2b=1-(u_b*n_b)

Where:

z2bz_2b= the borrower’s multiplier which takes value between {0.5,1}

ubu_b= a constant representing the rate at which the multiplier (zb) decreases as more NLL tokens are staked.

nbn_b= the amount of NLL tokens staked in the protocol. More NLL tokens staked, means less multiplier, and therefore, a decrease in Borrower’s P2P APY (yb).

If nb=0n_b=0, then z2b=1z_2b=1

Max APY for phase 2:

y2=(m2bz2b)x+b2by^*_2=(m_2b*z_2b)x+b_2b

Where:

y2y^*_2= the maximum APY used to calculate the slope for the new line for phase 2

m2bm_2b= the slope from the original curve

z2bz_2b= the borrower’s multiplier which takes value between {0.5,1}

xx= the period that the N-Account is opened for (in days)

b2bb_2b= the constant for borrowers without staked NLL tokens

We know that the max APY always occurs at the last period of phase 2. From here, we use the max APY to determine the new slope (m2bm^*_2b) and the new constant (b2bb^*_2b) to derive the equation for the new line that takes staked NLL tokens into account into the gamification of the reduction in interest rate. The max APY equation cannot be used as the line equation directly as it still contains elements from the original curve which would be inconsistent with the changed max APY, therefore, a new linear equation has to be created for this to work.

For Suppliers

In phase 2, the supplier’s APY is still at the original P2P rate:

ys=mx+by_s = mx+b

Where:

mm= 0

xx= the period that the N-Account is opened for (in days)

b=Rb=R (the base rate)

This is where the P2P rate between the counterparties starts to diverge, thus creating a spread. This spread is intended to incentivize borrowers to repay the funds after a certain period of time. The spread will be distributed among:

  1. The supplier themselves (30%-40%)

  2. NLL token stakers (30%)

  3. The protocol (30%-40%)

A share of the spread is distributed to the supplier themselves in order to incentivize them to stay for the higher yield. However, with the borrower’s gamification, it means that if the borrower(s) stake more NLL tokens, the max APY decreases, which results in a lower spread, leading to a lower share of spread to the supplier(s). This is where the supplier-side gamification comes in – suppliers can stake NLL tokens to retain their share of the spread or increase it to no more than 40% of the distribution.

Original spread:

S=ybysS=y_b-y_s

Where:

yby_b= the original borrower’s APY given that they do not stake any NLL tokens

ysy_s= the supplier's APY

New spread:

S=ybysS_*=y^*_b-y_s

Where:

yby^*_b= the new borrower’s APY after they have NLL tokens staked, which yb<yby^*_b<y_b

ysy_s= the supplier's APY

Thus S<SS_*<S always. With the decreasing spread, the supplier can retain their spread by staking NLL tokens to boost their spread multiplier, which is multiplied to the new spread SS_*

The supplier's multiplier:

zs=(usns)+1z_s=(u_s*n_s)+1

Where:

zsz_s= the supplier’s multiplier which takes value over {1}

usu_s= the constant representing the rate at which the multiplier (zs) increases as more NLL tokens are staked

nsn_s= the amount of NLL tokens staked in the protocol. More NLL tokens staked, means higher multiplier, and therefore, an increase in the supplier’s spread share

If ns=0n_s=0, then zs=1z_s=1 and the supplier receives the decreased spread share

Supplier's spread share

SszsS_**s*z_s

Where:

SS_*= the new spread

ss= the supplier's share of spread

zsz_s= the supplier’s multiplier which takes value over {1}

Phase 3

This is the phase where a considerable amount of time has passed and we want to strongly incentivize borrowers to repay the funds while also reinforcing supplier’s incentives to stay with the increasing spread and thus increasing share to the suppliers. This entails a predetermined maximum APY for each asset, which will be used to calculate the linear equation for the final curve.

For borrowers

The gamification from phase 2 continues, meaning that the original predetermined maximum APY can be decreased with the multiplier just like in phase 2.

For borrowers with NO NLL tokens staked (original curve):

yb=m3bx+b3by_b=m_3bx+b_3b

Where:

yby_b= the P2P APY that the borrowers use without NLL tokens staked

m3bm_3b= the slope derived from the max APY (underlying pool’s borrow rate) at the end of phase 2

xx= the period that the N-Account is opened for (in days)

b3bb_3b= the constant for borrowers without staked NLL tokens

For borrowers WITH NLL tokens staked (new curve):

This new curve is adjusted for the multiplier so it has a lower max APY and therefore, a new slope, which means a slower increase in the APY over the duration of this phase.

yb=m3bx+b3by_b^*=m_3^*bx+b_3^*b

Where:

yby_b^*= the P2P APY adjusted for staked NLL tokens

m3bm_3^*b= the new slope adjusted by the change in max APY due to the staking of NLL tokens, which means m3b=m3bz3bm_3^*b=m_3b*z_3b

xx= the period that the N-Account is opened for (in days)

b3bb_3^*b= a new constant from the equation adjusted for the staked NLL tokens

Borrower's multiplier for phase 3

z3b=z2b/2z_3b=z_2b/2

Where:

z3bz_3b= the borrower’s multiplier in phase 3 which takes value between {0.5,1}

z2bz_2b= the borrower’s multiplier in phase 2 which takes value between {0.5,1}

Max APY for phase 3:

y3=(m3bz3b)x+b3by^*_3=(m_3b*z_3b)x+b_3b

Where:

y3y^*_3= the maximum APY used to calculate the slope for the new line for phase 3

m3bm_3b= the slope from the original curve

z3bz_3b= the borrower’s multiplier which takes value between {0.5,1}

xx= the period that the N-Account is opened for (in days)

b3bb_3b= the constant for borrowers without staked NLL tokens

For suppliers

In phase 3, the supplier’s APY will now increase proportionally to the borrower’s APY.

ys=m3sx+b3sy_s=m_3sx+b_3s

Where the maximum supplier APY is predetermined to be able to find the slope m3s and eventually the constant b3s for the supplier’s linear equation in phase 3. Phase 3 uses the same spread formula as phase 2.

The New spread < Original spread always. To retain the spread, the supplier’s multiplier is multiplied to the new spread.

The supplier's multiplier:

zs=(usns)+1z_s=(u_s*n_s)+1

Where:

zsz_s= the supplier’s multiplier which takes value over {1}

usu_s= the constant representing the rate at which the multiplier (zs) increases as more NLL tokens are staked

nsn_s= the amount of NLL tokens staked in the protocol. More NLL tokens staked, means higher multiplier, and therefore, an increase in the supplier’s spread share

If ns=0n_s=0, then zs=1z_s=1 and the supplier receives the decreased spread share

Supplier's spread share

SszsS_**s*z_s

Where:

SS_*= the new spread

ss= the supplier's share of spread

zsz_s= the supplier’s multiplier which takes value over {1}

Last updated