Pool Factory API

This a factory smart-contract for deploying Marginly pools.

MarginlyFactory

Deploys Marginly and manages ownership and control over pool

marginlyPoolImplementation

address marginlyPoolImplementation

uniswapFactory

address uniswapFactory

Address of uniswap factory

swapRouter

address swapRouter

Address of uniswap swap router

feeHolder

address feeHolder

Swap fee holder

WETH9

address WETH9

Address of wrapped ETH

techPositionOwner

address techPositionOwner

Technical position address

getPool

mapping(address => mapping(address => mapping(uint24 => address))) getPool

Returns 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) public

createPool

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

Return Values

changeSwapRouter

function changeSwapRouter(address newSwapRouter) external

Changes swap router address used by Marginly pools

Parameters

renounceOwnership

function renounceOwnership() public

Leaves 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