Function: calculateVaultFinalPayoff(address vaultAddress)
Calculates the final payoff for a given vault.
Inputs
vaultAddressControl: Fully controlled.
Constraints: The vault must have a state of
TradeExpiredorPayoffCalculated.Impact: The vault's state and metadata may potentially be updated.
Branches and code coverage (including function calls)
Intended branches
Should calculate the correct payoff when a knock-in event has not occurred.
Should calculate the correct payoff when a knock-in event has occurred.
Negative behaviour
Should revert if the vault is in an invalid state.