This script deploys two contracts:
- An
IRMAdaptiveCurve(Interest Rate Model) contract - A
EdgeFactorycontract configured for Base network
- Install Foundry dependencies:
forge install- Create a
.envfile with the following:
DEPLOYER_PRIVATE_KEY=your_private_key_hereThe 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 |
The script is configured with the following Base network addresses:
- eVault Factory:
0x7F321498A801A191a93C840750ed637149dDf8D0 - Router Factory:
0xA9287853987B107969f181Cce5e25e0D09c1c116
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_KEYThis will:
- Deploy a new IRMAdaptiveCurve contract
- Deploy a new EdgeFactory contract configured with:
- The deployed IRM
- Base network's eVault Factory
- Base network's Router Factory
After deployment, make note of:
- The deployed IRMAdaptiveCurve address
- The deployed EdgeFactory address
These addresses will be needed for any subsequent interactions with the protocol.
To modify the IRM parameters, adjust the constants at the top of Deploy.s.sol:
IRM_TARGET_UTILIZATIONIRM_INITIAL_RATE_AT_TARGETIRM_MIN_RATE_AT_TARGETIRM_MAX_RATE_AT_TARGETIRM_CURVE_STEEPNESSIRM_ADJUSTMENT_SPEED
To deploy to a different network, update:
EVAULT_FACTORY_BASEROUTER_FACTORY_BASE