Quickswap Documentation
  • πŸ‰What is Quickswap?
  • Overview
    • ♻️Quickswap AMM
    • πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦Ecosystem Participants
    • ✨Key Features
    • πŸ”Swap
    • πŸ’¦Pools
    • πŸ‘¨β€πŸŒΎFarms
    • 🀝Bonds
    • βš–οΈPerps
    • 🐲Dragon's Lair
    • πŸ›οΈGovernance
    • πŸ—ΊοΈRoadmap
    • πŸ“²Social Media
    • πŸ“Contracts & Addresses
  • Tokens
    • πŸͺ™QUICK
    • πŸͺ™DD
  • Networks & Wallets
    • ⛓️Supported Chains
    • πŸ’³Supported Wallets
  • How To Guides
    • πŸ”How To Swap
      • ℹ️dLIMIT Guide
      • ℹ️dTWAP Guide
    • πŸ’§LP (Liquidity Providing)
    • πŸ‘©β€πŸŒΎFarm
    • πŸ₯©Stake
  • πŸ’»Technical Reference
    • πŸ‘©β€πŸ’»API
      • API Overview
      • Entities
      • Queries
    • πŸ“œSmart Contracts
      • 2️⃣V2
        • Factory
        • Pair
        • Pair (ERC-20)
        • Library
        • Router02
        • Router01
        • Common Errors
      • 3️⃣V3
        • Position Manager
        • Factory
        • Pool Deployer
        • Quoter
        • V3 Migrator
        • Farming Center
        • Limit Farming
        • Pool
        • Audits
    • ⌨️SDK
      • Getting Started
      • Token
      • Pair
      • Route
      • Trade
      • Fractions
      • Fetcher
      • Other Exports
    • ❔Guides
      • Interface Integration
        • Using the API
        • Query Parameters
        • Iframe Integration
      • Javascript SDK
        • SDK Quick start
        • Fetching Data
        • Pricing
        • Trading
        • Pair Addresses
      • Smart Contract Integration
        • Smart Contract Quick Start
        • Implement A Swap
        • Providing Liquidity
        • Building An Oracle
        • Flash Swaps
        • V2 Pair Addresses
        • Supporting Meta Transactions
        • V3 Pool Addresses
    • πŸ”ŽSubgraphs
    • ℹ️Glossary
    • πŸ“–Core Concepts
      • Swaps
      • Pools
      • Flash Swaps
      • Oracles
    • βš–οΈAdvanced Topics
      • Fees
      • Pricing
      • Understanding Returns
      • Security
      • Math
      • Research
Powered by GitBook
On this page
  • Factory
  • Code
  • Address
  • Events
  • Owner#
  • VaultAddress
  • Pool
  • FarmingAddress
  • FeeConfiguration
  • Read-Only Functions#
  • owner#
  • poolDeployer
  • farmingAddress
  • vaultAddress
  • poolByPair
  • State-Changing Functions
  • createPool
  • setOwner
  • setFarmingAddress
  • setVaultAddress
  • setBaseFeeConfiguration
  1. Technical Reference
  2. Smart Contracts
  3. V3

Factory

PreviousPosition ManagerNextPool Deployer

Last updated 1 year ago

Factory

Code

Address

AlgebraFactory is deployed at 0x411b0fAcC3489691f28ad58c47006AF5E3Ab3A28 on the Polygon .

Events

Owner

event Owner(address indexed newOwner);

Emitted when the owner of the factory is changed

  • newOwner The owner after the owner was changed

VaultAddress

event VaultAddress(address indexed newVaultAddress);

Emitted when the vault address is changed

  • newVaultAddress The vault address after the address was changed

Pool

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

Emitted when a pool is created

  • token0 The first token of the pool by address sort order

  • token1 The second token of the pool by address sort order

  • pool The address of the created pool

FarmingAddress

event FarmingAddress(address indexed newFarmingAddress);

Emitted when the farming address is changed

  • newFarmingAddress The 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

  • newFarmingAddress The farming address after the address was changed

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

  • tokenA The contract address of either token0 or token1

  • tokenB The contract address of the other token

Returns

  • pool The 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

  • tokenA One of the two tokens in the desired pool

  • tokenB The other of the two tokens in the desired pool

Returns

  • pool The 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

  • _owner The new owner of the factory

setFarmingAddress

function setFarmingAddress(address _farmingAddress) external;

Updates tokenomics address on the factory

Params

  • _farmingAddress The new tokenomics contract address

setVaultAddress

function setVaultAddress(address _vaultAddress) external;

Updates vault address on the factory

Params

  • _vaultAddress The 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

  • alpha1 max value of the first sigmoid

  • alpha2 max value of the second sigmoid

  • beta1 shift along the x-axis for the first sigmoid

  • beta2 shift along the x-axis for the second sigmoid

  • gamma1 horizontal stretch factor for the first sigmoid

  • gamma2 horizontal stretch factor for the second sigmoid

  • volumeBeta shift along the x-axis for the outer volume-sigmoid

  • volumeGamma horizontal stretch factor the outer volume-sigmoid

  • baseFee minimum possible fee

Read-Only Functions

owner

πŸ’»
πŸ“œ
3️⃣
AlgebraFactory.sol
mainnet
#
#
#