API reference v2.0
Introduction
core
periphery
IAlgebraFactory

IAlgebraFactory

IAlgebraFactory

The interface for the Algebra Factory

Developer note: Credit to Uniswap Labs under GPL-2.0-or-later license: https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces

Events

RenounceOwnershipStart

event RenounceOwnershipStart(uint256 timestamp, uint256 finishTimestamp)

Emitted when a process of ownership renounce is started

NameTypeDescription
timestampuint256The timestamp of event
finishTimestampuint256The timestamp when ownership renounce will be possible to finish

RenounceOwnershipStop

event RenounceOwnershipStop(uint256 timestamp)

Emitted when a process of ownership renounce cancelled

NameTypeDescription
timestampuint256The timestamp of event

RenounceOwnershipFinish

event RenounceOwnershipFinish(uint256 timestamp)

Emitted when a process of ownership renounce finished

NameTypeDescription
timestampuint256The timestamp of ownership renouncement

Pool

event Pool(address token0, address token1, address pool)

Emitted when a pool is created

NameTypeDescription
token0addressThe first token of the pool by address sort order
token1addressThe second token of the pool by address sort order
pooladdressThe address of the created pool

FarmingAddress

event FarmingAddress(address newFarmingAddress)

Emitted when the farming address is changed

NameTypeDescription
newFarmingAddressaddressThe farming address after the address was changed

DefaultFeeConfiguration

event DefaultFeeConfiguration(struct AlgebraFeeConfiguration newConfig)

Emitted when the default fee configuration is changed Developer note: See the AdaptiveFee library for more details

NameTypeDescription
newConfigstruct AlgebraFeeConfigurationThe structure with dynamic fee parameters

DefaultCommunityFee

event DefaultCommunityFee(uint8 newDefaultCommunityFee)

Emitted when the default community fee is changed

NameTypeDescription
newDefaultCommunityFeeuint8The new default community fee value

Functions

POOLS_ADMINISTRATOR_ROLE

function POOLS_ADMINISTRATOR_ROLE() external view returns (bytes32) view external

role that can change communityFee and tickspacing in pools

Returns:

NameTypeDescription
[0]bytes32

hasRoleOrOwner

function hasRoleOrOwner(bytes32 role, address account) external view returns (bool) view external

Developer note: Returns `true` if `account` has been granted `role` or `account` is owner.

NameTypeDescription
rolebytes32
accountaddress

Returns:

NameTypeDescription
[0]bool

owner

function owner() external view returns (address) view external

Returns the current owner of the factory Developer note: Can be changed by the current owner via transferOwnership(address newOwner)

Returns:

NameTypeDescription
[0]addressThe address of the factory owner

poolDeployer

function poolDeployer() external view returns (address) view external

Returns the current poolDeployerAddress

Returns:

NameTypeDescription
[0]addressThe address of the poolDeployer

farmingAddress

function farmingAddress() external view returns (address) view external

Developer note: Is retrieved from the pools to restrict calling certain functions not by a tokenomics contract

Returns:

NameTypeDescription
[0]addressThe tokenomics contract address

communityVault

function communityVault() external view returns (address) view external

Returns the current communityVaultAddress

Returns:

NameTypeDescription
[0]addressThe address to which community fees are transferred

defaultCommunityFee

function defaultCommunityFee() external view returns (uint8) view external

Returns the default community fee

Returns:

NameTypeDescription
[0]uint8Fee which will be set at the creation of the pool

poolByPair

function poolByPair(address tokenA, address tokenB) external view returns (address pool) view external

Returns the pool address for a given pair of tokens, or address 0 if it does not exist Developer note: tokenA and tokenB may be passed in either token0/token1 or token1/token0 order

NameTypeDescription
tokenAaddressThe contract address of either token0 or token1
tokenBaddressThe contract address of the other token

Returns:

NameTypeDescription
pooladdressThe pool address

renounceOwnershipStartTimestamp

function renounceOwnershipStartTimestamp() external view returns (uint256 timestamp) view external

Returns:

NameTypeDescription
timestampuint256The timestamp of the beginning of the renounceOwnership process

createPool

function createPool(address tokenA, address tokenB) external returns (address pool) external

Creates a pool for the given two tokens Developer note: tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. The call will revert if the pool already exists or the token arguments are invalid.

NameTypeDescription
tokenAaddressOne of the two tokens in the desired pool
tokenBaddressThe other of the two tokens in the desired pool

Returns:

NameTypeDescription
pooladdressThe address of the newly created pool

setFarmingAddress

function setFarmingAddress(address newFarmingAddress) external external

Developer note: updates tokenomics address on the factory

NameTypeDescription
newFarmingAddressaddressThe new tokenomics contract address

setDefaultCommunityFee

function setDefaultCommunityFee(uint8 newDefaultCommunityFee) external external

Developer note: updates default community fee for new pools

NameTypeDescription
newDefaultCommunityFeeuint8The new community fee, must be <= MAX_COMMUNITY_FEE

setDefaultFeeConfiguration

function setDefaultFeeConfiguration(struct AlgebraFeeConfiguration newConfig) external external

Changes initial fee configuration for new pools Developer note: changes coefficients for sigmoids: α / (1 + e^( (β-x) / γ)) alpha1 + alpha2 + baseFee (max possible fee) must be <= type(uint16).max and gammas must be > 0

NameTypeDescription
newConfigstruct AlgebraFeeConfigurationnew default fee configuration. See the #AdaptiveFee.sol library for details

startRenounceOwnership

function startRenounceOwnership() external external

Starts process of renounceOwnership. After that, a certain period of time must pass before the ownership renounce can be completed.

stopRenounceOwnership

function stopRenounceOwnership() external external

Stops process of renounceOwnership and removes timer.