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
Type | Name | Description |
---|---|---|
uint256 | BIPS | Private constant, |
uint256 | WAD | Private constant, |
uint256 | RAY | Private constant, |
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).
Type | Name | Description |
---|---|---|
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
Type | Name | Description |
---|---|---|
uint256 | eV | EMA-based value given prior and current conditions. |
juniorProportion()
juniorProportion()
Calculates proportion of yield attributable to junior tranche.
Type | Name | Description |
---|---|---|
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
Type | Name | Description |
---|---|---|
uint256 | jP | Yield attributable to junior tranche in RAY. |
seniorProportion()
seniorProportion()
Calculates proportion of yield distributable which is attributable to the senior tranche.
Type | Name | Description |
---|---|---|
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
Type | Name | Description |
---|---|---|
uint256 | sP | Proportion of yD attributable to senior tranche. |
seniorProportionBase()
seniorProportionBase()
Calculates proportion of yield attributed to senior tranche (no extenuating circumstances).
Type | Name | Description |
---|---|---|
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
Type | Name | Description |
---|---|---|
uint256 | sPB | Proportion of yield attributed to senior tranche in RAY. |
seniorProportionShortfall()
seniorProportionShortfall()
Calculates proportion of yield attributed to senior tranche (shortfall occurence).
Type | Name | Description |
---|---|---|
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
Type | Name | Description |
---|---|---|
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.
Type | Name | Description |
---|---|---|
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
Type | Name | Description |
---|---|---|
uint256 | yT | yield target for the senior and junior tranche combined. |
Last updated