Factory
#
Code#
AddressAlgebraFactory
is deployed at 0x411b0fAcC3489691f28ad58c47006AF5E3Ab3A28
on the Polygon mainnet.
#
Events#
OwnerEmitted when the owner of the factory is changed
newOwner
The owner after the owner was changed
#
VaultAddressEmitted when the vault address is changed
newVaultAddress
The vault address after the address was changed
#
PoolEmitted when a pool is created
token0
The first token of the pool by address sort ordertoken1
The second token of the pool by address sort orderpool
The address of the created pool
#
FarmingAddressEmitted when the farming address is changed
newFarmingAddress
The farming address after the address was changed
#
FeeConfigurationEmitted when the farming address is changed
newFarmingAddress
The farming address after the address was changed
#
Read-Only Functions#
ownerReturns the address of the current factory owner. Can be changed by the current owner via setOwner
#
poolDeployerReturns the address of the poolDeployer
#
farmingAddressIs retrieved from the pools to restrict calling certain functions not by a tokenomics contract Returns the tokenomics contract address
#
vaultAddress#
poolByPairReturns 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
tokenA
The contract address of either token0 or token1tokenB
The contract address of the other token
Returns
pool
The pool address
#
State-Changing Functions#
createPoolCreates 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
tokenA
One of the two tokens in the desired pooltokenB
The other of the two tokens in the desired pool
Returns
pool
The address of the newly created pool
#
setOwnerUpdates the owner of the factory. Must be called by the current owner
Params
_owner
The new owner of the factory
#
setFarmingAddressUpdates tokenomics address on the factory
Params
_farmingAddress
The new tokenomics contract address
#
setVaultAddressUpdates vault address on the factory
Params
_vaultAddress
The new vault contract address
#
setBaseFeeConfigurationChanges 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
alpha1
max value of the first sigmoidalpha2
max value of the second sigmoidbeta1
shift along the x-axis for the first sigmoidbeta2
shift along the x-axis for the second sigmoidgamma1
horizontal stretch factor for the first sigmoidgamma2
horizontal stretch factor for the second sigmoidvolumeBeta
shift along the x-axis for the outer volume-sigmoidvolumeGamma
horizontal stretch factor the outer volume-sigmoidbaseFee
minimum possible fee