Factory
Code#
Address#
AlgebraFactory is deployed at 0x411b0fAcC3489691f28ad58c47006AF5E3Ab3A28 on the Polygon mainnet.
Events#
Owner#
Emitted when the owner of the factory is changed
newOwnerThe owner after the owner was changed
VaultAddress#
Emitted when the vault address is changed
newVaultAddressThe vault address after the address was changed
Pool#
Emitted when a pool is created
token0The first token of the pool by address sort ordertoken1The second token of the pool by address sort orderpoolThe address of the created pool
FarmingAddress#
Emitted when the farming address is changed
newFarmingAddressThe farming address after the address was changed
FeeConfiguration#
Emitted when the farming address is changed
newFarmingAddressThe farming address after the address was changed
Read-Only Functions#
owner#
Returns the address of the current factory owner. Can be changed by the current owner via setOwner
poolDeployer#
Returns the address of the poolDeployer
farmingAddress#
Is retrieved from the pools to restrict calling certain functions not by a tokenomics contract Returns the tokenomics contract address
vaultAddress#
poolByPair#
Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist. tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
Params
tokenAThe contract address of either token0 or token1tokenBThe contract address of the other token
Returns
poolThe pool address
State-Changing Functions#
createPool#
Creates a pool for the given two tokens and fee. tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments are invalid.
Params
tokenAOne of the two tokens in the desired pooltokenBThe other of the two tokens in the desired pool
Returns
poolThe address of the newly created pool
setOwner#
Updates the owner of the factory. Must be called by the current owner
Params
_ownerThe new owner of the factory
setFarmingAddress#
Updates tokenomics address on the factory
Params
_farmingAddressThe new tokenomics contract address
setVaultAddress#
Updates vault address on the factory
Params
_vaultAddressThe new vault contract address
setBaseFeeConfiguration#
Changes initial fee configuration for new pools. Changes coefficients for sigmoids: α / (1 + e^( (β-x) / γ)) alpha1 + alpha2 + baseFee (max possible fee) must be <= type(uint16).max, gammas must be > 0
Params
alpha1max value of the first sigmoidalpha2max value of the second sigmoidbeta1shift along the x-axis for the first sigmoidbeta2shift along the x-axis for the second sigmoidgamma1horizontal stretch factor for the first sigmoidgamma2horizontal stretch factor for the second sigmoidvolumeBetashift along the x-axis for the outer volume-sigmoidvolumeGammahorizontal stretch factor the outer volume-sigmoidbaseFeeminimum possible fee