HegicModule.sol
This contract responsible working with American-style options (powered by Hegic).
How to Get the Intrinsic Value of an Option in USDC
function getOptionValue(uint id) public returns (uint positionValue) {
if (isOptionActive(id) && getExpirationTime(id) > block.timestamp) {
uint profit = getPayOffAmount(id);
positionValue = assetExchangerUSDCetoUSDC.getInputPositionValue(profit);
}
}
How to Get the intrinsic value of an option in USDC.e
function getPayOffAmount(uint tokenID) private view returns (uint) {
(, IHegicStrategy strategy, , , ) = operationalTreasury.lockedLiquidity(tokenID);
return strategy.payOffAmount(tokenID);
}
Last updated