The PTokenFactory contract is for creating new pools.
Before creating a new pToken, the factory will check the conditions necessary to create a new pool, and if the asset meets all the conditions, the pToken will be created, otherwise, the function will return an error.
function createPToken(address underlying_) external returns (uint)
underlying_: The underlying asset address.
RETURN: 0 on success, otherwise an Error code
Erc20 underlying = Erc20(0xToken...);
PTokenFactory factory = PTokenFactory(0xABCD...);
require(factory.createPToken(address(underlying)) == 0, "something went wrong");
One of the main requirements for creating a new pToken is the availability of sufficient liquidity on Uniswap v2 or other DEX (clones Uniswap v2). This function checks liquidity and returns true if it is greater than or equal to the minUniswapLiquidity parameter.
function checkPair(address asset) public view returns (bool)