ICardinalityJob
Inherits: IKeep3rJob
Functions
poolManagerFactory
Returns the pool manager factory
function poolManagerFactory() external view returns (IPoolManagerFactory _poolManagerFactory);
Returns
Name | Type | Description |
---|---|---|
_poolManagerFactory | IPoolManagerFactory | The pool manager factory |
minCardinalityIncrease
Returns the minimum increase of cardinality allowed
function minCardinalityIncrease() external view returns (uint16 _minCardinalityIncrease);
Returns
Name | Type | Description |
---|---|---|
_minCardinalityIncrease | uint16 | The 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
Name | Type | Description |
---|---|---|
_poolManager | IPoolManager | The pool manager of the pool for which the cardinality will be increased |
_increaseAmount | uint16 | The 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
Name | Type | Description |
---|---|---|
_poolManager | IPoolManager | The pool manager of the pool for which the cardinality will be increased |
_increaseAmount | uint16 | The increased amount of the pool cardinality |
Returns
Name | Type | Description |
---|---|---|
_workable | bool | If 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
Name | Type | Description |
---|---|---|
_poolManager | IPoolManager | The pool manager of the pool for which the cardinality will be increased |
_increaseAmount | uint16 | The increased amount of the pool cardinality |
_keeper | address | The address of the keeper |
Returns
Name | Type | Description |
---|---|---|
_workable | bool | If the job is workable with the given inputs |
setMinCardinalityIncrease
Changes the min amount of cardinality increase per work
function setMinCardinalityIncrease(uint16 _minCardinalityIncrease) external;
Parameters
Name | Type | Description |
---|---|---|
_minCardinalityIncrease | uint16 | The new minimum number of slots |
setPoolManagerFactory
Changes the pool manager factory
function setPoolManagerFactory(IPoolManagerFactory _poolManagerFactory) external;
Parameters
Name | Type | Description |
---|---|---|
_poolManagerFactory | IPoolManagerFactory | The 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
Name | Type | Description |
---|---|---|
_poolManager | IPoolManager | The pool manager of the pool for which the cardinality will be increased |
Returns
Name | Type | Description |
---|---|---|
_minCardinalityIncrease | uint256 | The 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();