Factory
This documentation provides an overview of the IFactory.sol. This contract defines the functions and events for creating and managing pools on Maverick AMM.
Table of Contents
Contract Details
Name : IFactory
Solidity Version : ^0.8.0
SPDX License-Identifier : GPL-2.0-or-later
Factory
is Deployed toZKSync Era:
0x2C1a605f843A2E18b7d7772f0Ce23c236acCF7f5
Code: Github
Events
PoolCreated
Event emitted when a new pool is created.
Parameters :
poolAddress
: Theaddress
of the created poolfee
: The rate inprbmath 60x18
decimal formattickSpacing
: The bin width represented as1.0001^tickSpacing
activeTick
: The initial active tick of the poollookback
: The time-weighted average price (TWAP) lookback in whole secondsprotocolFeeRatio
: The ratio of the swap fee that is kept for the protocoltokenA
: TheERC20
token A used in the pooltokenB
: TheERC20
token B used in the pool
SetFactoryProtocolFeeRatio
Event emitted when the protocol fee ratio is updated.
Parameters :
protocolFeeRatio
: The new protocol fee ratio
SetFactoryOwner
Event emitted when the owner of the factory is updated.
Parameters :
owner
: The new owneraddress
Functions
create()
Creates a new pool.
Parameters :
_fee
: The rate inprbmath 60x18
decimal format_tickSpacing
: The bin width represented as1.0001^tickSpacing
_lookback
: The time-weighted average price (TWAP) lookback in whole seconds_activeTick
: The initial active tick of the pool_tokenA
: The ERC20 token A to be used in the pool_tokenB
: The ERC20 token B to be used in the pool
Returns :
IPool
: An instance of theIPool
interface representing the created pool
lookup()
Looks up an existing pool based on the specified parameters.
Parameters :
fee
: The rate inprbmath 60x18
decimal formattickSpacing
: The bin width represented as1.0001^tickSpacing
lookback
: The time-weighted average price (TWAP) lookback in wholeseconds
tokenA
: TheERC20
token A used in the pooltokenB
: TheERC20
token B used in the pool
Returns :
IPool
: An instance of theIPool
interface representing the found pool, or azero
address if no pool matches the parameters
owner()
Retrieves the address of the factory owner.
Returns :
address
: Theaddress
of the factory owner
position()
Retrieves the IPosition interface associated with the factory.
Returns :
IPosition
: An instance of theIPosition
interface associated with the factory
protocolFeeRatio()
Retrieves the current protocol fee ratio.
Returns :
The current protocol fee ratio in
uint64
.
isFactoryPool(IPool pool)
Checks if a pool is owned by the factory.
Parameters :
pool
: An instance of theIPool
interface representing the pool to check.
Returns :
A
boolean
indicating whether the pool is owned by the factory.
Last updated