Factory
Factory
Code
Address
AlgebraFactory is deployed at 0x411b0fAcC3489691f28ad58c47006AF5E3Ab3A28 on the Polygon mainnet.
Events
Owner#
event Owner(address indexed newOwner);
Emitted when the owner of the factory is changed
newOwnerThe owner after the owner was changed
VaultAddress
event VaultAddress(address indexed newVaultAddress);
Emitted when the vault address is changed
newVaultAddressThe vault address after the address was changed
Pool
event Pool(address indexed token0, address indexed token1, address 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
event FarmingAddress(address indexed newFarmingAddress);
Emitted when the farming address is changed
newFarmingAddressThe farming address after the address was changed
FeeConfiguration
event FeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee);
Emitted when the farming address is changed
newFarmingAddressThe farming address after the address was changed
Read-Only Functions#
owner#
function owner() external view returns (address);
Returns the address of the current factory owner. Can be changed by the current owner via setOwner
poolDeployer
function poolDeployer() external view returns (address);
Returns the address of the poolDeployer
farmingAddress
function farmingAddress() external view returns (address);
Is retrieved from the pools to restrict calling certain functions not by a tokenomics contract Returns the tokenomics contract address
vaultAddress
function vaultAddress() external view returns (address);
poolByPair
function poolByPair(address tokenA, address tokenB) external view returns (address pool);
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
function createPool(address tokenA, address tokenB) external returns (address pool);
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
function setOwner(address _owner) external;
Updates the owner of the factory. Must be called by the current owner
Params
_ownerThe new owner of the factory
setFarmingAddress
function setFarmingAddress(address _farmingAddress) external;
Updates tokenomics address on the factory
Params
_farmingAddressThe new tokenomics contract address
setVaultAddress
function setVaultAddress(address _vaultAddress) external;
Updates vault address on the factory
Params
_vaultAddressThe new vault contract address
setBaseFeeConfiguration
function setBaseFeeConfiguration(uint16 alpha1, uint16 alpha2, uint32 beta1, uint32 beta2, uint16 gamma1, uint16 gamma2, uint32 volumeBeta, uint16 volumeGamma, uint16 baseFee) external;
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
Last updated