Used to calculate the originating utilization for an asset.
Uo=bo+1−boUd+2
Where:
Uo=
the originating utilization ratio
Ud+2=
the utilization delta payment 2 utilization-modifying transactions after loan origination
bo+1=
the block of the next utilization-modifying transaction
bo=
the loan origination block
Utilization Tracker Delta *depreciated*
Used to calculate the utilization tracker delta of a transaction. This allows the protocol to measure an asset's average utilization ratio over a period of time.
Ud=Bi−1+Li−1Li−1∗(bi−bi−1)
Where:
Ud=
the utilization tracker delta
Li−1=
the total number of liability tokens at the pre-transaction ledger state of the last utilization-modifying transaction
Bi−1=
the total pool balance at the pre-transaction ledger state of the last utilization-modifying transaction
bi=
the block of the last utilization-modifying transaction
bi−1=
the block of the second-to-last utilization-modifying transaction
Utilization Adjustment *depreciated*
Used to calculate the necessary utilization ratio delta adjustment.
the place of the furthest back incorrect utilization delta payment
UΔl=
the place of the utilization delta payment of the last utilization-modifying transaction
Li−2=
the total number of liability tokens at the pre-transaction ledger state of the utilization-modifying transaction 2 utilization-modifying transactions ago
Bi−2=
the total pool balance at the pre-transaction ledger state of the utilization-modifying transaction 2 utilization-modifying transactions ago
bi−1=
the block of second-to-last utilization-modifying transaction
bi−2=
the block of the third-to-last utilization-modifying transaction
Udi=
the utilization delta payment of the last utilization-modifying transaction
Uai=
the utilization adjustment payment of the last utilization-modifying transaction
Average Utilization Ratio *depreciated*
Used to calculate the average utilization ratio for a loan.
UA=bi−boBc−Bo+Ud+1+Ua+bc−biU
Where:
UA=
the average utilization ratio
Bc=
the current utilization tracker balance
Bo=
the utilization tracker balance at the time of loan origination
Ud+1=
The utilization delta payment of the next utilization tracker transaction (this will be applied in the next utilization modifying transaction, but it needs applied now to get an accurate average utilization)
Ua=
the utilization ratio adjustment
bi=
the block of the last utilization delta payment
bo=
the block at loan origination
U=
the current utilization ratio
bc=
the current block
Accrued Interest Tracker Updates
Used to calculate accrued interest tracker updates
Iu=(bi−bi−1)(byI(U)B)
Iu=
Accrued interest tracker update amount
bi=
The block the last accrued interest tracker update occured on
bi−1=
The block the accrued interest tracker update before last occured on
Average blocks per year. Hardcoded variable. Assumed to be 6,307,200 (5-sec ledger close time).
B=
Accrued interest tracker balance
Liability Token Calculations
Equations used to calculate the value of liability tokens and user liabilities.
Liability Tokens Issued
The number of liability tokens issued to a user when they borrow from the pool.
L=Ib+IuB
L=
liability tokens issued
B=
Borrow amount
Ib=
Accrued Interest tracker balance for the asset being borrowed
Iu=
Estimated next accrued interest tracker balance
Liability Token Value
The value of a single liability token. Used when calculating the value of a user's liability.
V=Ib+Iu
V=
The value of a liability token
Ib=
Accrued Interest tracker balance for the asset being borrowed
Iu=
Estimated next accrued interest tracker balance
Liabilities Outstanding
Liabilities Outstanding for a given asset
Lo=To∗V
Lo=
liabilities outstanding
To=
liability tokens outstanding
V=
liability token value
Interest Rate Calculations
Interest rates change based on the interest threshold and rates below.
T1=
threshold one; initially set to 0.75
T2=
threshold two; initially set to 0.90
T3=
threshold three; initially set to 0.95
R0=
rate zero; initially set to 0.20
R1=
rate one; initially set to 1.5
R2=
rate two; initially set to 7.5
R3=
rate three; initially set to 15
Base Interest Rate
Used to calculate the current interest rate when the utilization rate is below
T1
.
I0(U)=b+U∗R0
Where:
I0=
the base interest rate
U=
the utilization ratio
b=
the base rate constant (low
U
). It is set by a pool data entry and controls the base interest rate for an asset; initially set to 0.05
Interest Rate - Threshold One
Used to calculate the current interest rate when the utilization rate is above
T1
.
I1(U)=(U−T1)R1+I0(T1)
Where:
I1=
interest rate one
U=
the utilization ratio
I0=
the base interest rate
Interest Rate - Threshold Two
Used to calculate the interest rate when the utilization rate is above
T2
.
I2(U)=(U−T2)R2+I1(T2)
Where:
I2=
interest rate two
U=
the utilization ratio
I1=
interest rate one
Interest Rate - Threshold Three
Used to calculate the interest rate when the utilization rate is above
T3
.
I3(U)=(U−T3)R3+I2(T3)
Where:
I3=
interest rate three
U=
the utilization ratio
I2=
interest rate two
Average Interest Rate
Calculated using the above interest rate equations, but
U
becomes an aggregated utilization ratio.
Originating Interest Rate
Calculated using the above interest rate equations, but
U
becomes an originating utilization ratio.
Stable Rate
Used to calculate the stable interest rate for a loan.
Is=Io(1+(1.05−Uo))
Where:
Is=
the stable rate
Io=
the originating interest rate
Uo=
the utilization ratio at the time the loan was originated
Minimum Collateral Requirement
Used to calculate the minimum collateral required for a loan.
Vc=FˉVl∗1.02
Where:
Vc=
the minimum collateral value requirement
Vl=
the value of the loan
Fˉ=
the average liquidation factor of the selected collateral types
Pool Token Calculations
Pool Token Issuance
Used to calculate the number of pool tokens issued to a user account.
Oi=Bc+L−BnBn∗Oo
Where:
Oi=
the number of pool tokens to be issued to the user
Bn=
the asset balance the user deposited
Oo=
the current number of outstanding pool tokens
Bc=
the current asset balance amount
L=
the current number of outstanding liability tokens
Pool Token Value
Used to calculate the value of a pool token
A=Tt(B+L)
Where:
V=
the value of a pool token
B=
the asset balance in the pool
L=
the total number of liability tokens outstanding
Tt=
the total number of pool tokens
Maximum Liquidation Amount
Used to calculate the maximum amount of a loan's value the liquidator is allowed to liquidate in order to reach a health factor of 1.02.
ΔVl=Iˉ∗Fwˉ−1.02Faˉ∗Vc−1.02∗Vl
Where:
ΔVl=
the maximum allowable liquidation amount
Faˉ=
the average liquidation for the account's collateral balances
Vc=
the collateral value
Vl=
the liability value
Iˉ=
the average liquidation incentive for the collateral assets being withdrawn
Fwˉ=
the average liquidation factor for the collateral assets being withdrawn
Health Factor
Used to calculate an account's health factor.
H=∑i=1∣L∣Vli∑i=1∣C∣Fi∗Vci
Where:
H=
the account's health factor
∣C∣=
the number of collateral assets
Fi=
the liquidation factor for asset
i
Vci=
the collateral value of collateral asset
i
∣L∣=
the number of outstanding loans
Vli=
the liability value of loaned asset
i
Maximum Liability
Used to calculate the maximum liability an account can hold at one time.
Vl=1.02∑i=1∣C∣FiVci
Where:
Vl=
the maximum liability value for an account
∣C∣=
the number of collateral assets
Fi=
the liquidation factor for asset
i
Vci=
the collateral value of collateral asset
i
YBX Issuance
Used to calculate how much YBX to issue.
I=(T−O)R
Where:
I=
the number of YBX issued
T=
the total number of YBX tokens to be issued; 1,500,000,000
O=
the total number of YBX tokens outstanding
R=
the total YBX issuance rate; initially 0.0075
Issuance Ratio
Used to calculate how much YBX to issue per liability or pool token
R=OA∗T
Where:
R=
the issuance ratio for a given liability or pool token
A=
the issuance allocation for the given liability or pool token
T=
the total number of YBX tokens to be issued for the period
O=
the total number of the given liability or pool token in claimable balances
Pessimistic Block-Weighted Average Position Size
Used to calculate the pessimistic block-average position size for a given collateral or liability position. Used to calculate YBX issuance for a position
S=(b2−b0)S1∗(b2−b1)+S0∗(b1−b0)
Where:
S=
the positions pessimistic block-weighted average size
S1=
the most recent position size
S0=
the previous position size
b2=
the block of the most recent issuance update payment
b1=
the block the position was last modified on
b0=
the greater of the block of the last issuance update payment prior to the position being modified and the block the position was last modified on before the most recent modification.
YieldBlox Default Protection Amount
Used to calculate how much of the user's liability should be taken on as pool debt as part of the Default Protection Program.
R=Vl−IaˉVc
R=
the YieldBlox Default Protection amount
Vl=
the liability value
Vc=
the collateral value
Iaˉ=
the average liquidation incentive for the account's collateral balances