ZivoeMath.sol
Mathematics for Yield Distributions
Introduction
This contract facilitates mathematics, intended solely for the YDL.
Note: This contract is deployed and tracked via ZivoeYDL, see ZivoeYDL.sol and for further information on the derivation of the equations, see
State Variables
uint256
BIPS
Private constant, 10000
uint256
WAD
Private constant, 10**18
uint256
RAY
Private constant, 10**27
Sections
ema() - Calculates the current EMA (exponential moving average).
juniorProportion() - Calculates proportion of yield attributable to junior tranche.
seniorProportion() - Calculates proportion of yield distributble which is attributable to the senior tranche.
seniorProportionBase() - Calculates proportion of yield attributed to senior tranche (no extenuating circumstances).
seniorProportionShortfall() - Calculates proportion of yield attributed to senior tranche (shortfall occurence).
yieldTarget() - Calculates amount of annual yield required to meet target rate for both tranches.
Read Functions
ema()
ema()
Calculates the current EMA (exponential moving average).
uint256
bV
The base value (typically an EMA from prior calculations).
uint256
cV
The current value, which is factored into bV.
uint256
N
Number of steps to average over.
Returns
uint256
eV
EMA-based value given prior and current conditions.
juniorProportion()
juniorProportion()
Calculates proportion of yield attributable to junior tranche.
uint256
eSTT
ema-based supply of zSTT (units = WEI)
uint256
eJTT
ema-based supply of zJTT (units = WEI)
uint256
sP
Proportion of yield attributable to seniors (units = RAY)
uint256
Q
senior to junior tranche target ratio (units = BIPS)
Returns
uint256
jP
Yield attributable to junior tranche in RAY.
seniorProportion()
seniorProportion()
Calculates proportion of yield distributable which is attributable to the senior tranche.
uint256
yD
yield distributable (units = WEI)
uint256
yT
ema-based yield target (units = WEI)
uint256
eSTT
ema-based supply of zSTT (units = WEI)
uint256
eJTT
ema-based supply of zJTT (units = WEI)
uint256
Y
target annual yield for senior tranche (units = BIPS)
uint256
Q
multiple of Y (units = BIPS)
uint256
T
# of days between distributions (units = integer)
Returns
uint256
sP
Proportion of yD attributable to senior tranche.
seniorProportionBase()
seniorProportionBase()
Calculates proportion of yield attributed to senior tranche (no extenuating circumstances).
uint256
yD
yield distributable (units = WEI)
uint256
eSTT
ema-based supply of zSTT (units = WEI)
uint256
Y
target annual yield for senior tranche (units = BIPS)
uint256
T
# of days between distributions (units = integer)
Returns
uint256
sPB
Proportion of yield attributed to senior tranche in RAY.
seniorProportionShortfall()
seniorProportionShortfall()
Calculates proportion of yield attributed to senior tranche (shortfall occurence).
uint256
eSTT
ema-based supply of zSTT (units = WEI)
uint256
eJTT
ema-based supply of zJTT (units = WEI)
uint256
Q
multiple of Y (units = BIPS)
Returns
uint256
sPS
Proportion of yield attributed to senior tranche in RAY.
yieldTarget()
yieldTarget()
Calculates amount of annual yield required to meet target rate for both tranches.
uint256
eSTT
ema-based supply of zSTT (units = WEI)
uint256
eJTT
ema-based supply of zJTT (units = WEI)
uint256
Y
target annual yield for senior tranche (units = BIPS)
uint256
Q
multiple of Y (units = BIPS)
uint256
T
# of days between distributions (units = integer)
Returns
uint256
yT
yield target for the senior and junior tranche combined.
Last updated