Algebra Integral
HomepageSocialsIntegrate
  • Overview
    • What is Algebra?
    • Who Are These Docs For
    • Why Concentrated Liquidity & Modularity Matter
    • Partners & Ecosystem
    • Audits & Security
    • Social Media & Communities
  • Introducing Algebra Integral to Founders & Business Teams
    • Overview of Algebra Integral
      • How It Works: Core + Plugins
      • V3 vs. V4: Key Differences
      • Integral vs. Uniswap V4: Key Differences
    • Benefits of Modular Architecture
      • Perks for DEXes
      • Perks for Builders
      • Perks for Users
  • Modularity: Use Cases
  • Plugin Marketplace
  • Algebra Partner Support
  • User Guide Template For DEXes
    • Concentrated Liquidity & Modular Architecture Basics
      • Glossary
      • How Concentrated Liquidity & Modular Architecture Work
      • Benefits of Modular Concentrated Liquidity AMM for Users
        • Perks for Liquidity Providers
        • Perks for Projects
        • Perks for Traders
      • Fee Mechanics
        • Static Fee
        • Dynamic Fee
        • Sliding Fee
        • Dynamic Fee Based on Trading Volume
        • Managed Swap Fee
        • Whitelist Fee Discount
      • Farming
      • Farming FAQ
  • Price Ranges and Liquidity Strategies
    • What Are Price Ranges
    • Basic Price Range Presets
    • Advanced Range Presets
    • How Price Moves Affect Liquidity
    • Impermanent Loss: Concepts & Mitigation
    • Matching Your Liquidity Strategy to Market Moves
    • Swap & LP Strategies with Price Ranges
    • Liquidity Scenarios & Risk Profiles
  • Liquidity Provisioning: Tutorials & FAQs
    • Adding Liquidity
      • Manual Mode
      • Automated Mode
    • Managing & Adjusting Positions
    • How APR is Calculated
    • FAQ for LPs
  • Algebra Integral / Technical Reference
    • Intro
    • Audits
    • Integration Process
      • Specification and API of contracts
        • Algebra Pool
        • Algebra Factory
        • Swap Router
        • Nonfungible Position Manager
        • Quoter
        • QuoterV2
        • TickLens
      • Interaction with pools
        • Getting data from pools
      • Subgraphs and analytics
        • Examples of queries
      • Technical Guides
        • Intro
        • Swaps
          • Single swaps
          • Multihop swaps
        • Providing liquidity
          • Setting up your contract
          • Mint a new position
          • Collect fees
          • Decrease liquidity
          • Increase liquidity
          • Final Contract
        • Flashloans
          • Setting up your contract
          • Calling flash
          • Flash callback
          • Final contract
      • Migration from UniswapV3
      • FAQ
    • Core Logic
      • Pool overview
      • Swap calculation
      • Liquidity and positions
      • Ticks
        • Ticks search tree
      • Reserves
      • Flash
      • Plugins
      • AlgebraFactory and roles
    • Plugins
      • Overview
      • Farming
      • Adaptive Fee
      • Sliding Fee
      • Whitelist Discount Fee
      • Safety Switch
      • Position Limit Orders
      • Managed Swap Fee
      • FAQ
    • Guides
      • Plugin Development
      • Plugin Testing
      • Plugin Deployment
    • Changes V1
    • Changes V1.1
    • Changes v1.2
  • Changes v1.2.1
  • Other
    • Archived Documentation
Powered by GitBook
On this page
  • Pool creation
  • Access control and role mechanism
  1. Algebra Integral / Technical Reference
  2. Core Logic

AlgebraFactory and roles

The AlgebraFactory contract is the central contract in the Algebra Integral protocol and is responsible for creating new liquidity pools and managing access to sensitive actions.

Pool creation

With Algebra Factory, any user can create a pool for a token pair. Only one liquidity pool can exist for each token pair.

When created, the pool will have default values for a number of settings (default values can be changed in Algebra Factory).

If a plugin factory is connected to Algebra Factory, the corresponding plugin will be created and connected for the new pool.

It is important to note that Algebra Factory is not a direct pool creator (important for calculating addresses using create2). Algebra Factory creates pools using a special smart contract called AlgebraPoolDeployer.

Access control and role mechanism

Algebra Factory uses OpenZeppelin's implementation of the role mechanism (AccessControlEnumerable). Because of this, Algebra Factory can be used as a role manager for various smart contracts in the protocol.

It is important to note that for most secure owner actions Algebra Factory is superuser and has access rights. For security reasons, it is recommended to use a more granular role policy for different tasks and pass the title owner of Algebra Factory to a multisig / DAO / special smart contract.

Standard roles in the Core part of the Algebra Integral protocol:

  • POOLS_ADMINISTRATOR - the owner of this role can change parameters in pools. This includes the right to change plugins and plugin settings in the pool.

  • COMMUNITY_FEE_WITHDRAWER - the holder of this role can retrieve accumulated communityFee from the AlgebraCommunityVault.

The AccessControlEnumerable mechanism allows you to create new roles and use them for protocol needs.

PreviousPluginsNextPlugins