IPoolFactory

Git Source

Inherits: IPoolFactoryEvents

Functions

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

deployPool

Deploy a new option pool

function deployPool(PoolKey calldata k) external payable 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(PoolKey calldata k) external view returns (UD60x18);

Parameters

NameTypeDescription
kPoolKeyThe pool key

Returns

NameTypeDescription
<none>UD60x18The initialization fee (18 decimals)

Errors

PoolFactory__IdenticalAddresses

error PoolFactory__IdenticalAddresses();

PoolFactory__OptionExpired

error PoolFactory__OptionExpired(uint256 maturity);

PoolFactory__OptionMaturityExceedsMax

error PoolFactory__OptionMaturityExceedsMax(uint256 maturity);

PoolFactory__OptionMaturityNot8UTC

error PoolFactory__OptionMaturityNot8UTC(uint256 maturity);

PoolFactory__OptionMaturityNotFriday

error PoolFactory__OptionMaturityNotFriday(uint256 maturity);

PoolFactory__OptionMaturityNotLastFriday

error PoolFactory__OptionMaturityNotLastFriday(uint256 maturity);

PoolFactory__OptionStrikeEqualsZero

error PoolFactory__OptionStrikeEqualsZero();

PoolFactory__OptionStrikeInvalid

error PoolFactory__OptionStrikeInvalid(UD60x18 strike, UD60x18 strikeInterval);

PoolFactory__PoolAlreadyDeployed

error PoolFactory__PoolAlreadyDeployed(address poolAddress);

PoolFactory__TransferNativeTokenFailed

error PoolFactory__TransferNativeTokenFailed();

PoolFactory__ZeroAddress

error PoolFactory__ZeroAddress();

Structs

PoolKey

struct PoolKey {
    address base;
    address quote;
    address oracleAdapter;
    UD60x18 strike;
    uint256 maturity;
    bool isCallPool;
}