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
vaultAddressControl: 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
vaultStatustoTradeExpiredif time is past trade expiry.Should calculate the
totalCouponPayoffcorrectly.Should not calculate
totalCouponPayoffif the trade has already expired.
Negative behaviour
Must revert if the
vaultStatusis not set toTraded.