Pool Factory API
This a factory smart-contract for deploying Marginly pools.
MarginlyFactory
Deploys Marginly and manages ownership and control over pool
marginlyPoolImplementation
address marginlyPoolImplementationuniswapFactory
address uniswapFactoryAddress of uniswap factory
swapRouter
address swapRouterAddress of uniswap swap router
feeHolder
address feeHolderSwap fee holder
WETH9
address WETH9Address of wrapped ETH
techPositionOwner
address techPositionOwnerTechnical position address
getPool
mapping(address => mapping(address => mapping(uint24 => address))) getPoolReturns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
quoteToken and baseToken may be passed in either token0/token1 or token1/token0 order
constructor
constructor(address _marginlyPoolImplementation, address _uniswapFactory, address _swapRouter, address _feeHolder, address _WETH9, address _techPositionOwner) publiccreatePool
function createPool(address quoteToken, address baseToken, uint24 uniswapFee, struct MarginlyParams params) external returns (address pool)Creates a pool for the two given tokens and fee
tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments are invalid.
Parameters
quoteToken
address
One of the two tokens in the desired pool
baseToken
address
The other of the two tokens in the desired pool
uniswapFee
uint24
Fee for uniswap pool
params
struct MarginlyParams
pool parameters
Return Values
pool
address
The address of the newly created pool
changeSwapRouter
function changeSwapRouter(address newSwapRouter) externalChanges swap router address used by Marginly pools
Parameters
newSwapRouter
address
address of new swap router
renounceOwnership
function renounceOwnership() publicLeaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner.
NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
Last updated
