Function: calculateCurrentYield(address vaultAddress)
Updates the metadata of the vault specified by vaultAddress
to account for any yield accumulated up until the current day. The accumulated amount is stored in the metadata's totalCouponPayoff
property. If the trade has already expired, then the vault's status is set to TradeExpired
.
Inputs
vaultAddress
Control: Fully controlled.
Constraints: Vault's status must be set to
Traded
.Impact: Updates this vault's metadata.
Branches and code coverage (including function calls)
Intended branches
Should set
vaultStatus
toTradeExpired
if time is past trade expiry.Should calculate the
totalCouponPayoff
correctly.Should not calculate
totalCouponPayoff
if the trade has already expired.
Negative behaviour
Must revert if the
vaultStatus
is not set toTraded
.