Skip to content

objectivedefi/edge

Repository files navigation

Edge Factory

Overview

This script deploys two contracts:

  1. An IRMAdaptiveCurve (Interest Rate Model) contract
  2. A EdgeFactory contract configured for Base network

Prerequisites

  1. Install Foundry dependencies:
forge install
  1. Create a .env file with the following:
DEPLOYER_PRIVATE_KEY=your_private_key_here

Interest Rate Model Parameters

The deployment uses an Euler-style adaptive interest rate curve with the following parameters:

Parameter Value Description
Target Utilization 90% Optimal lending pool utilization
Initial Rate 4% APR Starting interest rate at target utilization
Min Rate 0.1% APR Minimum possible interest rate
Max Rate 1000% APR Maximum possible interest rate
Curve Steepness 4 How aggressively rates change around target
Adjustment Speed 50/year How quickly rates adapt to utilization changes

Base Network Addresses

The script is configured with the following Base network addresses:

  • eVault Factory: 0x7F321498A801A191a93C840750ed637149dDf8D0
  • Router Factory: 0xA9287853987B107969f181Cce5e25e0D09c1c116

Deployment

To deploy to Base network:

forge script script/Deploy.s.sol:Deploy --rpc-url base --broadcast --verify --verifier-url base --verifier-project-name "Edge Factory" --verifier-version-name "v1" --private-key $DEPLOYER_PRIVATE_KEY

This will:

  1. Deploy a new IRMAdaptiveCurve contract
  2. Deploy a new EdgeFactory contract configured with:
    • The deployed IRM
    • Base network's eVault Factory
    • Base network's Router Factory

Post-Deployment

After deployment, make note of:

  1. The deployed IRMAdaptiveCurve address
  2. The deployed EdgeFactory address

These addresses will be needed for any subsequent interactions with the protocol.

Modifying Parameters

To modify the IRM parameters, adjust the constants at the top of Deploy.s.sol:

  • IRM_TARGET_UTILIZATION
  • IRM_INITIAL_RATE_AT_TARGET
  • IRM_MIN_RATE_AT_TARGET
  • IRM_MAX_RATE_AT_TARGET
  • IRM_CURVE_STEEPNESS
  • IRM_ADJUSTMENT_SPEED

To deploy to a different network, update:

  • EVAULT_FACTORY_BASE
  • ROUTER_FACTORY_BASE

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published