PoolFactory

Git Source

Inherits: IPoolFactory, OwnableInternal, ReentrancyGuard

State Variables

DIAMOND

address internal immutable DIAMOND;

POOL_FACTORY_DEPLOYER

address internal immutable POOL_FACTORY_DEPLOYER;

Functions

constructor

constructor(address diamond, address poolFactoryDeployer);

isPool

Returns whether the given address is a pool

function isPool(address contractAddress) external view returns (bool);

Parameters

NameTypeDescription
contractAddressaddressThe address to check

Returns

NameTypeDescription
<none>boolWhether the given address is a pool

getPoolAddress

Returns the address of a valid pool, and whether it has been deployed. If the pool configuration is invalid the transaction will revert.

function getPoolAddress(PoolKey calldata k) external view returns (address pool, bool isDeployed);

Parameters

NameTypeDescription
kPoolKeyThe pool key

Returns

NameTypeDescription
pooladdressThe pool address
isDeployedboolWhether the pool has been deployed

_getPoolAddress

Returns the address of a pool using the encoded poolKey

function _getPoolAddress(bytes32 poolKey) internal view returns (address);

deployPool

Deploy a new option pool

function deployPool(PoolKey calldata k) external payable nonReentrant returns (address poolAddress);

Parameters

NameTypeDescription
kPoolKeyThe pool key

Returns

NameTypeDescription
poolAddressaddressThe address of the deployed pool

initializationFee

DEPRECATED: Calculates the initialization fee for a pool

function initializationFee(IPoolFactory.PoolKey calldata k) public pure returns (UD60x18);

Parameters

NameTypeDescription
kIPoolFactory.PoolKeyThe pool key

Returns

NameTypeDescription
<none>UD60x18The initialization fee (18 decimals)

_safeTransferNativeToken

Safely transfer native token to the given address

function _safeTransferNativeToken(address to, uint256 amount) internal;

_revertIfAddressInvalid

Revert if the base and quote are identical or if the base, quote, or oracle adapter are zero

function _revertIfAddressInvalid(PoolKey calldata k) internal pure;

_revertIfOptionStrikeInvalid

Revert if the strike price is not a multiple of the strike interval

function _revertIfOptionStrikeInvalid(UD60x18 strike) internal pure;

_revertIfOptionMaturityInvalid

Revert if the maturity is invalid

function _revertIfOptionMaturityInvalid(uint256 maturity) internal view;