> For the complete documentation index, see [llms.txt](https://sharwa.gitbook.io/sharwa-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharwa.gitbook.io/sharwa-docs/for-devs/margin-account/core-contracts/modularswaprouter/hegicmodule.sol.md).

# HegicModule.sol

This contract responsible working with American-style options (powered by Hegic).

## How to Get the Intrinsic Value of an Option in USDC

```solidity
    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

```solidity
    function getPayOffAmount(uint tokenID) private view returns (uint) {
        (, IHegicStrategy strategy, , , ) = operationalTreasury.lockedLiquidity(tokenID);
        return strategy.payOffAmount(tokenID);
    } 
```
