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
  • What Are Plugins?
  • The Future of DEX Functionality
  • How Plugins Connect: The Hook System
  1. Introducing Algebra Integral to Founders & Business Teams
  2. Overview of Algebra Integral

How It Works: Core + Plugins

PreviousOverview of Algebra IntegralNextV3 vs. V4: Key Differences

Last updated 18 hours ago

Schematically, the Algebra architecture for a specific pair can be represented as a core, which is a crucial part that stores the pair’s liquidity and implements the swap logic. In addition, there are exchangeable modules, known as plugins, that interact with the pool.

  • Core — Immutable logic for liquidity storage and swap calculations. Secure, audited, and unchangeable.

  • Plugins — Interchangeable smart contracts that extend pool functionality and can be updated independently of the Core.

This design ensures that the most sensitive operations (like token storage and pricing math) remain secure, while peripheral features can evolve quickly to support emerging use cases.

The Algebra ‘Integral’ architecture offers extensive customization options for the logic of all protocol pools, including individual pools. Plugins play an important role in this customization.

What Are Plugins?

Technically, plugins are peripheral smart contracts connected to individual liquidity pools. A plugin can:

  • Adjust swap fees dynamically based on volatility

  • Act as an on-chain oracle

  • Implement farming or reward systems

  • Perform additional custom checks

  • Interact with external contracts

  • Introduce business logic like KYC or whitelisting

Plugins cannot access user funds directly, nor can they modify the Core’s pricing logic — maintaining user trust and protocol integrity.

Note: Currently, one plugin can be initialized per pool. Future architecture will support multiple plugins via a Proxy Plugin system.

The Future of DEX Functionality

Algebra Integral is more than a protocol — it’s a foundation for long-term innovation. Future plugin modules may include:

  • Elastic and dynamic fee markets

  • Gas discount or reimbursement systems

  • KYC/whitelist/blacklist integration

  • LVR (Loss vs Rebalancing) mitigation tools

  • Anti-JIT liquidity solutions

  • Support for perpetuals and advanced derivatives

How Plugins Connect: The Hook System

Each pool can be connected to a smart contract that aligns with the plugin specification for the Algebra Protocol. By utilizing hooks (calls from a pool before or after specific actions), a plugin can extend, enhance, or modify the standard behavior of liquidity pools. Hooks include:

  • beforeInitialize / afterInitialize

  • beforeModifyPosition / afterModifyPosition

  • beforeSwap / afterSwap

  • beforeFlash / afterFlash

This event-driven architecture ensures Plugins can operate seamlessly with the Pool, reacting to changes and executing custom logic exactly when needed.

On the other hand, it is also possible to operate without any plugins, creating a pure AMM without unnecessary functionality from the protocol. This flexibility allows for easy adaptation to external requirements and enables maximum gas savings by disabling secondary logic when not needed.

The protocol has the capability to replace plugins for pools at any time, allowing for continuous development and the addition of functionality based on user or partner needs. As a result, Algebra AMM can be configured in various ways to accommodate specific market or environmental requirements. However, it maintains a solid and proven core of concentrated liquidity logic that remains consistent across different configurations.