ICardinalityJob

Git Source

Inherits: IKeep3rJob

Functions

poolManagerFactory

Returns the pool manager factory

function poolManagerFactory() external view returns (IPoolManagerFactory _poolManagerFactory);

Returns

NameTypeDescription
_poolManagerFactoryIPoolManagerFactoryThe pool manager factory

minCardinalityIncrease

Returns the minimum increase of cardinality allowed

function minCardinalityIncrease() external view returns (uint16 _minCardinalityIncrease);

Returns

NameTypeDescription
_minCardinalityIncreaseuint16The minimum number of slots increases allowed

work

The function worked by the keeper, which will increase the pool cardinality

Requires enough WETH deposited for this pool to reimburse the gas consumption to the keeper

function work(IPoolManager _poolManager, uint16 _increaseAmount) external;

Parameters

NameTypeDescription
_poolManagerIPoolManagerThe pool manager of the pool for which the cardinality will be increased
_increaseAmountuint16The amount by which the cardinality will be increased

isWorkable

Checks if the job can be worked in the current block

function isWorkable(IPoolManager _poolManager, uint16 _increaseAmount) external view returns (bool _workable);

Parameters

NameTypeDescription
_poolManagerIPoolManagerThe pool manager of the pool for which the cardinality will be increased
_increaseAmountuint16The increased amount of the pool cardinality

Returns

NameTypeDescription
_workableboolIf the job is workable with the given inputs

isWorkable

Checks if the job can be worked in the current block by a specific keeper

function isWorkable(IPoolManager _poolManager, uint16 _increaseAmount, address _keeper)
    external
    returns (bool _workable);

Parameters

NameTypeDescription
_poolManagerIPoolManagerThe pool manager of the pool for which the cardinality will be increased
_increaseAmountuint16The increased amount of the pool cardinality
_keeperaddressThe address of the keeper

Returns

NameTypeDescription
_workableboolIf the job is workable with the given inputs

setMinCardinalityIncrease

Changes the min amount of cardinality increase per work

function setMinCardinalityIncrease(uint16 _minCardinalityIncrease) external;

Parameters

NameTypeDescription
_minCardinalityIncreaseuint16The new minimum number of slots

setPoolManagerFactory

Changes the pool manager factory

function setPoolManagerFactory(IPoolManagerFactory _poolManagerFactory) external;

Parameters

NameTypeDescription
_poolManagerFactoryIPoolManagerFactoryThe address of the new pool manager factory

getMinCardinalityIncreaseForPool

Calculates the minimum possible cardinality increase for a pool

function getMinCardinalityIncreaseForPool(IPoolManager _poolManager)
    external
    view
    returns (uint256 _minCardinalityIncrease);

Parameters

NameTypeDescription
_poolManagerIPoolManagerThe pool manager of the pool for which the cardinality will be increased

Returns

NameTypeDescription
_minCardinalityIncreaseuint256The minimum possible cardinality increase for the pool

Events

MinCardinalityIncreaseChanged

Emitted when the minimum cardinality increase amount allowed is changed

event MinCardinalityIncreaseChanged(uint16 _minCardinalityIncrease);

PoolManagerFactoryChanged

Emitted when the pool manager factory is changed

event PoolManagerFactoryChanged(IPoolManagerFactory _poolManagerFactory);

Worked

Emitted when the job is worked

event Worked(IPoolManager _poolManager, uint16 _increaseAmount);

Errors

CardinalityJob_MinCardinality

Thrown when the proposed cardinality increase is too low

error CardinalityJob_MinCardinality();

CardinalityJob_InvalidPoolManager

Thrown when working with an invalid pool manager

error CardinalityJob_InvalidPoolManager();