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
  • Introduction
  • Set up
  • Deployment
  1. Algebra Integral / Technical Reference
  2. Guides

Plugin Deployment

Introduction

This guide will walk you through the steps required to deploy your plugin. Follow the instructions carefully to ensure a successful deployment.

Set up

Before starting, you need to create a .env file in the root directory of your project. This file will store environment variables such as private keys, API keys, or other sensitive information required for deployment.

To deploy your plugin, you need to configure the network settings in the hardhat.config.ts file. Add the desired network (e.g., Ethereum, Polygon, etc.) and its corresponding configuration (e.g., RPC URL, chain ID, etc.) to the networks section of the file.

Deployment

The deployment script for the test plugin can be found in the scripts/deploy.js:

const hre = require("hardhat");

const ENTRYPOINT_ADDRESS = ""

async function main() {
    const pluginFactoryFactory = await hre.ethers.getContractFactory("DynamicFeePluginFactory");
    const pluginFactory = await pluginFactoryFactory.deploy(ENTRYPOINT_ADDRESS);

    await pluginFactory.waitForDeployment()

    console.log("DynamicFeePluginFactory to:", pluginFactory.target);
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

To deploy your plugin on a specific Decentralized Exchange (DEX), you need to find the address of the EntryPoint contract. This address is required for the deployment process.

  1. Locate the EntryPoint contract address for the DEX you are targeting. This information is typically available on the DEX's official documentation.

  2. Once you have the EntryPoint contract address, update the deployment script. In the provided template, you can find the relevant line in the scripts/deploy.ts file at this location. Replace the placeholder with the actual EntryPoint contract address.

After completing the above steps, you are ready to deploy your plugin. Run the deployment script using the following command:

npx hardhat run scripts/deploy.js --network <network_name>

Replace <network_name> with the name of the network you configured in hardhat.config.ts.

PreviousPlugin TestingNextChanges V1

Last updated 3 months ago