Maverick Docs
  • Introducing Maverick
  • Getting Started
    • 🖥️The Maverick V2 UI
    • 👛Connect a Wallet
    • ⛓️Choose a Network
    • 🪙Approving Tokens
  • Guides
    • 🤝Traders
      • How to Make a Swap
    • 💰Liquidity Providers
      • Understanding Liquidity Provision
      • Understanding Modes
      • How to Add Liquidity
      • How to Deploy a New Pool
      • How to Check Position Balances
      • How to Manage Liquidity in a Pool
      • How to Migrate from V1 to V2
      • Understanding Permanent Loss
      • Liquidity Strategies
    • ⚡Incentives
      • Understanding Boosted Positions
      • Understanding Incentives
      • How to Join a Boosted Position
      • How to Create a Boosted Position
      • How to Manage a Boosted Position
      • How to Add Incentives
    • 🎡veFlywheel
      • veFlywheel Basics
      • Guide to veFlywheel Emissions
      • How to Vote to Direct Emissions
    • 👩‍🏫Advanced Tutorials
      • Single-Sided Incentives
  • Technical Reference
    • Contract Addresses
      • V1 Contract Addresses
      • V2 Contract Addresses
    • Maverick V1
      • V1 Whitepaper
      • V1 Contracts
        • Router
        • Pool
        • Factory
        • SlimRouter
    • Maverick V2
      • V2 Whitepaper
      • V2 Contracts
        • Maverick V2 Common Contracts
          • base
            • IMulticall
            • IPayableMulticall
            • Multicall
            • PayableMulticall
          • interfaces
            • IMaverickV2AddLiquidityCallback
            • IMaverickV2Factory
            • IMaverickV2FactoryAdmin
            • IMaverickV2FlashLoanCallback
            • IMaverickV2Pool
            • IMaverickV2PoolAdmin
            • IMaverickV2SwapCallback
          • libraries
            • ArrayOperations
            • Constants
            • Math
            • PoolLib
            • TickMath
            • TransferLib
        • Maverick V2 AMM Contracts
          • poollib
            • Bin
            • Delta
            • Deployer
            • DeployerPermissioned
            • SwapMath
            • Twa
          • MaverickV2Factory
          • MaverickV2Pool
          • MaverickV2PoolPermissioned
        • Maverick V2 Reward Contracts
          • interfaces
            • IMaverickV2IncentiveMatcher
            • IMaverickV2IncentiveMatcherFactory
            • IMaverickV2Reward
            • IMaverickV2RewardFactory
            • IMaverickV2RewardRouter
            • IMaverickV2RewardVault
            • IMaverickV2VotingEscrowBase
            • IMaverickV2VotingEscrow
            • IMaverickV2VotingEscrowFactory
            • IMaverickV2VotingEscrowLens
            • IMaverickV2VotingEscrowWSync
          • libraries
            • IncentiveMatcherDeployer
            • RewardDeployer
            • VotingEscrowDeployer
            • VotingEscrowWSyncDeployer
          • rewardbase
            • IRewardAccounting
            • RewardAccounting
          • votingescrowbase
            • HistoricalBalance
            • IHistoricalBalance
            • ILegacyVeMav
            • VotingEscrow
          • MaverickV2IncentiveMatcher
          • MaverickV2IncentiveMatcherFactory
          • MaverickV2Reward
          • MaverickV2RewardFactory
          • MaverickV2RewardRouter
          • MaverickV2RewardVault
          • MaverickV2VotingEscrow
          • MaverickV2VotingEscrowFactory
          • MaverickV2VotingEscrowLens
          • MaverickV2VotingEscrowWSync
        • Maverick V2 Supplemental Contracts
          • base
            • Checks
            • IChecks
            • IMigrateBins
            • MigrateBins
          • boostedpositionbase
            • BoostedPositionBase
            • IBoostedPositionBase
            • ImmutableArrayGetter
          • interfaces
            • IMaverickV2BoostedPosition
            • IMaverickV2BoostedPositionFactory
            • IMaverickV2LiquidityManager
            • IMaverickV2PoolLens
            • IMaverickV2Position
            • IMaverickV2Quoter
            • IMaverickV2Router
            • IPositionImage
          • libraries
            • BoostedPositionDeployerDynamic
            • BoostedPositionDeployerStatic
            • BytesLib
            • LiquidityUtilities
            • PackLib
            • Path
            • PoolInspection
          • liquiditybase
            • ArgPacker
            • IArgPacker
          • paymentbase
            • IERC20PermitAllowed
            • IPayment
            • ISelfPermit
            • IState
            • IWETH9
            • Payment
            • SelfPermit
            • State
          • positionbase
            • INft
            • Nft
          • routerbase
            • CallbackOperations
            • ExactOutputSlim
            • ICallbackOperations
            • IExactOutputSlim
            • IPushOperations
            • IRouterErrors
            • PushOperations
          • MaverickV2BoostedPositionDynamic
          • MaverickV2BoostedPositionFactory
          • MaverickV2BoostedPositionStatic
          • MaverickV2LiquidityManager
          • MaverickV2PoolLens
          • MaverickV2Position
          • MaverickV2Quoter
          • MaverickV2Router
          • PositionImage
      • V2 API Documentation
      • V2 Testnet Guide
        • Get Sepolia ETH & Test Tokens
        • How to Create a Boosted Position in V2
        • How to Add & Match Incentives
        • How to Create a veFlywheel
    • Development FAQ
    • Finding LP Balances
  • MAV token
    • MAV Token & Tokenomics
    • veMAV & MAV Staking
    • How to Stake MAV
    • Syncing V1 veMAV
    • Airdrop Information
      • Maverick Ecosystem Rewards Pre-Season Airdrop
      • Maverick Governance & S1 Airdrops
  • Further Information
    • Frequently Asked Questions
    • Glossary
    • Security
    • Maverick Wallets
    • Dune Analytics
    • Rebasing Tokens
    • Restricted Territories
    • Delphi Digital Report
Powered by GitBook
On this page
  • Table of Contents
  • Contract Details
  • Events
  • PoolCreated
  • SetFactoryProtocolFeeRatio
  • SetFactoryOwner
  • Functions
  • create()
  • lookup()
  • owner()
  • position()
  • protocolFeeRatio()
  • isFactoryPool(IPool pool)
  1. Technical Reference
  2. Maverick V1
  3. V1 Contracts

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.

PreviousPoolNextSlimRouter

Last updated 1 year ago

Table of Contents

Contract Details

  • Name : IFactory

  • Solidity Version : ^0.8.0

  • SPDX License-Identifier : GPL-2.0-or-later

  • Factory is Deployed to

    • Ethereum:

    • ZKSync Era:

  • Code:

Events

PoolCreated

Event emitted when a new pool is created.

event PoolCreated(
    address poolAddress,
    uint256 fee,
    uint256 tickSpacing,
    int32 activeTick,
    int256 lookback,
    uint64 protocolFeeRatio,
    IERC20 tokenA,
    IERC20 tokenB
);
  • Parameters :

    • poolAddress : The address of the created pool

    • fee : The rate in prbmath 60x18 decimal format

    • tickSpacing : The bin width represented as 1.0001^tickSpacing

    • activeTick : The initial active tick of the pool

    • lookback : The time-weighted average price (TWAP) lookback in whole seconds

    • protocolFeeRatio : The ratio of the swap fee that is kept for the protocol

    • tokenA : The ERC20 token A used in the pool

    • tokenB : The ERC20 token B used in the pool

SetFactoryProtocolFeeRatio

Event emitted when the protocol fee ratio is updated.

event SetFactoryProtocolFeeRatio(uint64 protocolFeeRatio);
  • Parameters :

    • protocolFeeRatio : The new protocol fee ratio

SetFactoryOwner

Event emitted when the owner of the factory is updated.

event SetFactoryOwner(address owner);
  • Parameters :

    • owner : The new owner address

Functions

create()

Creates a new pool.

function create(
    uint256 _fee,
    uint256 _tickSpacing,
    int256 _lookback,
    int32 _activeTick,
    IERC20 _tokenA,
    IERC20 _tokenB
) external returns (IPool);
  • Parameters :

    • _fee : The rate in prbmath 60x18 decimal format

    • _tickSpacing : The bin width represented as 1.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 the IPool interface representing the created pool

lookup()

Looks up an existing pool based on the specified parameters.

function lookup(
    uint256 fee,
    uint256 tickSpacing,
    int256 lookback,
    IERC20 tokenA,
    IERC20 tokenB
) external view returns (IPool);
  • Parameters :

    • fee : The rate in prbmath 60x18 decimal format

    • tickSpacing : The bin width represented as 1.0001^tickSpacing

    • lookback : The time-weighted average price (TWAP) lookback in whole seconds

    • tokenA : The ERC20 token A used in the pool

    • tokenB : The ERC20 token B used in the pool

  • Returns :

    • IPool : An instance of the IPool interface representing the found pool, or a zero address if no pool matches the parameters

owner()

Retrieves the address of the factory owner.

function owner() external view returns (address);
  • Returns :

    • address : The address of the factory owner

position()

Retrieves the IPosition interface associated with the factory.

function position() external view returns (IPosition);
  • Returns :

    • IPosition : An instance of the IPosition interface associated with the factory

protocolFeeRatio()

Retrieves the current protocol fee ratio.

function protocolFeeRatio() external view returns (uint64);
  • Returns :

    • The current protocol fee ratio in uint64.

isFactoryPool(IPool pool)

Checks if a pool is owned by the factory.

function isFactoryPool(IPool pool) external view returns (bool);
  • Parameters :

    • pool : An instance of the IPool interface representing the pool to check.

  • Returns :

    • A boolean indicating whether the pool is owned by the factory.

0xEb6625D65a0553c9dBc64449e56abFe519bd9c9B
0x2C1a605f843A2E18b7d7772f0Ce23c236acCF7f5
Github
Contract Details
Events
PoolCreated
SetFactoryProtocolFeeRatio
SetFactoryOwner
Functions
create()
lookup()
owner()
position()
protocolFeeRatio()
isFactoryPool()