IMaverickV2Factory

Functions

deployParameters

Called by deployer library to initialize a pool.

function deployParameters()
    external
    view
    returns (
        uint64 feeAIn,
        uint64 feeBIn,
        uint32 lookback,
        int32 activeTick,
        uint64 tokenAScale,
        uint64 tokenBScale,
        IERC20 tokenA,
        IERC20 tokenB,
        uint16 tickSpacing,
        uint8 kinds,
        address accessor
    );

create

Create a new MaverickV2Pool with symmetric swap fees.

Parameters

Name
Type
Description

fee

uint64

Fraction of the pool swap amount that is retained as an LP in D18 scale.

tickSpacing

uint16

Tick spacing of pool where 1.0001^tickSpacing is the bin width.

lookback

uint32

Pool lookback in second in D2 scale.

tokenA

IERC20

Address of tokenA.

tokenB

IERC20

Address of tokenB.

activeTick

int32

Tick position that contains the active bins.

kinds

uint8

1-15 number to represent the active kinds 0b0001 = static; 0b0010 = right; 0b0100 = left; 0b1000 = both. E.g. a pool with all 4 modes will have kinds = b1111 = 15

create

Create a new MaverickV2Pool.

Parameters

Name
Type
Description

feeAIn

uint64

Fraction of the pool swap amount for tokenA-input swaps that is retained as an LP in D18 scale.

feeBIn

uint64

Fraction of the pool swap amount for tokenB-input swaps that is retained as an LP in D18 scale.

tickSpacing

uint16

Tick spacing of pool where 1.0001^tickSpacing is the bin width.

lookback

uint32

Pool lookback in second in D2 scale.

tokenA

IERC20

Address of tokenA.

tokenB

IERC20

Address of tokenB.

activeTick

int32

Tick position that contains the active bins.

kinds

uint8

1-15 number to represent the active kinds 0b0001 = static; 0b0010 = right; 0b0100 = left; 0b1000 = both. e.g. a pool with all 4 modes will have kinds = b1111 = 15

createPermissioned

Create a new MaverickV2PoolPermissioned with symmetric swap fees.

Parameters

Name
Type
Description

fee

uint64

Fraction of the pool swap amount that is retained as an LP in D18 scale.

tickSpacing

uint16

Tick spacing of pool where 1.0001^tickSpacing is the bin width.

lookback

uint32

Pool lookback in second in D2 scale.

tokenA

IERC20

Address of tokenA.

tokenB

IERC20

Address of tokenB.

activeTick

int32

Tick position that contains the active bins.

kinds

uint8

1-15 number to represent the active kinds 0b0001 = static; 0b0010 = right; 0b0100 = left; 0b1000 = both. E.g. a pool with all 4 modes will have kinds = b1111 = 15

accessor

address

Only address that can access the pool's public write functions.

createPermissioned

Create a new MaverickV2PoolPermissioned.

Parameters

Name
Type
Description

feeAIn

uint64

Fraction of the pool swap amount for tokenA-input swaps that is retained as an LP in D18 scale.

feeBIn

uint64

Fraction of the pool swap amount for tokenB-input swaps that is retained as an LP in D18 scale.

tickSpacing

uint16

Tick spacing of pool where 1.0001^tickSpacing is the bin width.

lookback

uint32

Pool lookback in second in D2 scale.

tokenA

IERC20

Address of tokenA.

tokenB

IERC20

Address of tokenB.

activeTick

int32

Tick position that contains the active bins.

kinds

uint8

1-15 number to represent the active kinds 0b0001 = static; 0b0010 = right; 0b0100 = left; 0b1000 = both. E.g. a pool with all 4 modes will have kinds = b1111 = 15

accessor

address

only address that can access the pool's public write functions.

updateProtocolFeeRatioForPool

Update the protocol fee ratio for a pool. Can be called permissionlessly allowing any user to sync the pool protocol fee value with the factory protocol fee value.

Parameters

Name
Type
Description

pool

IMaverickV2Pool

The pool for which to update.

updateProtocolLendingFeeRateForPool

Update the protocol lending fee rate for a pool. Can be called permissionlessly allowing any user to sync the pool protocol lending fee rate value with the factory value.

Parameters

Name
Type
Description

pool

IMaverickV2Pool

The pool for which to update.

claimProtocolFeeForPool

Claim protocol fee for a pool and transfer it to the protocolFeeReceiver.

Parameters

Name
Type
Description

pool

IMaverickV2Pool

The pool from which to claim the protocol fee.

isTokenA

bool

A boolean indicating whether tokenA (true) or tokenB (false) is being collected.

claimProtocolFeeForPool

Claim protocol fee for a pool and transfer it to the protocolFeeReceiver.

Parameters

Name
Type
Description

pool

IMaverickV2Pool

The pool from which to claim the protocol fee.

isFactoryPool

Bool indicating whether the pool was deployed from this factory.

protocolFeeReceiver

Address that receives the protocol fee when users call claimProtocolFeeForPool.

isFactoryPoolPermissioned

Bool indicating whether the pool was deployed from this factory.

lookupPermissioned

Lookup a pool for given parameters.

lookupPermissioned

Lookup a pool for given parameters.

lookupPermissioned

Lookup a pool for given parameters.

lookup

Lookup a pool for given parameters.

lookup

Lookup a pool for given parameters.

lookup

Lookup a pool for given parameters.

owner

Get the current factory owner.

protocolFeeRatioD3

Proportion of protocol fee to collect on each swap. Value is in 3-decimal format with a maximum value of 0.25e3.

protocolLendingFeeRateD18

Fee rate charged by the protocol for flashloans. Value is in 18-decimal format with a maximum value of 0.02e18.

poolAddress

Address of a permissionless pool.

poolAddress

Address of a permissioned pool.

Events

PoolCreated

SetFactoryProtocolFeeRatio

SetFactoryProtocolLendingFeeRate

SetFactoryProtocolFeeReceiver

Errors

FactoryInvalidProtocolFeeRatio

FactoryInvalidLendingFeeRate

FactoryProtocolFeeOnRenounce

FactorAlreadyInitialized

FactorNotInitialized

FactoryInvalidTokenOrder

FactoryInvalidFee

FactoryInvalidKinds

FactoryInvalidTickSpacing

FactoryInvalidLookback

FactoryInvalidTokenDecimals

FactoryPoolAlreadyExists

FactoryAccessorMustBeNonZero

Structs

DeployParameters

Last updated