// 1) Import IOptionAMMFactory interface
import "../interfaces/IOptionAMMPool.sol";
// 2) Instantiate optionAMMPool using the address you
// got from the previous step
IOptionAMMPool optionAMMPool = IOptionAMMPool(optionAMMPoolAddress);
In this example we will perform a buyExactAOuput action.
3) Call the getOptionTradeDetailsExactAOutput with
the option amount you will want to buy as an input
uint256 amountBIn - The amount of tokenB in order to buy amountOfOptions
uint256 newIV - The new pool Implied volatility, also known as sigma
uint256 amountOfOptions = 100000; // The option decimals can be found calling option.decimals()
(uint256 amountBIn, uint256 newIV, , ,) = optionAMMPool.getOptionTradeDetailsExactAOutput(amountOfOptions);