Skip to main content

InvestmentPool Contract

The InvestmentPool contract manages individual investment pools with specific terms, lock periods, and guaranteed returns. Each pool operates independently with its own configuration, multisig governance, and LP token system.
Implementation Address (Testnet): 0xed9dFc96392BFcD90610A85d72E79e6c40eDf5ACImplementation Address (Mainnet): 0xdFBB45185a56C4AD1e9bCE5FD784e3C4B5aFD09D

Overview

Investment pools are the core building blocks of EdenVest, where users can:
  • Deposit cNGN for fixed-term investments
  • Earn guaranteed returns based on predetermined APY
  • Receive LP tokens representing pool shares
  • Get NFT positions for investment tracking
  • Withdraw at maturity with principal + returns

Pool Architecture

Key Features

🎯 Fixed-Term Investments

  • Lock periods from 7 days to 2 years
  • Guaranteed APY rates
  • Simple interest calculations
  • Automatic maturity tracking

💰 LP Token Economics

  • ERC20 tokens representing pool shares
  • Proportional minting based on pool state
  • Burn on withdrawal
  • Tax collection integration

🔒 Multi-Signature Security

  • Pool funds managed by multisig wallet
  • Admin functions require proper authorization
  • Emergency pause capabilities
  • Configurable governance parameters

Pool Configuration

PoolConfig Structure

Configuration Examples

Core Functions

Investment Functions

invest()

Process investment deposits (called by EdenCore).
Process Flow:
  1. Validate investment amount and pool state
  2. Calculate LP tokens and tax amount
  3. Create investment record
  4. Mint LP tokens to investor and tax collector
  5. Mint NFT position to investor
  6. Transfer funds to pool multisig
Returns:
  • tokenId: NFT position token ID
  • userLPTokens: LP tokens minted to investor
  • taxAmount: LP tokens minted for tax collection

withdraw()

Process investment withdrawals (called by EdenCore).
Validation Requirements:
  • Investment must be matured (block.timestamp >= maturityTime)
  • Investor must own the NFT position
  • Sufficient LP tokens must be provided
  • Investment must not already be withdrawn

Administrative Functions

updatePoolConfig()

Update pool configuration parameters.
Validation Rules:
  • Lock duration: 7 days ≤ duration ≤ 2 years
  • Min investment must be > 0
  • Max investment must be ≥ min investment
  • Expected rate must be ≤ 100% APY (10000 basis points)

setAcceptingDeposits()

Toggle deposit acceptance.

updatePoolMultisig()

Change pool multisig wallet address.

View Functions

getPoolConfig()

Retrieve current pool configuration.

getInvestment()

Get investment details by ID.
Investment Structure:

getPoolStats()

Get comprehensive pool statistics.

getUserInvestments()

Get all investment IDs for a user.

isWithdrawable()

Check if an investment can be withdrawn.

Return Calculations

Expected Return Formula

LP Token Calculation

Tax Calculation

Integration Examples

Pool Interaction

Pool Monitoring Dashboard

Security Features

Access Control

Input Validation

Emergency Controls

  • Pause Mechanism: Stop new investments during emergencies
  • Multisig Protection: Critical functions require multisig approval
  • Admin Override: Emergency withdrawal capabilities
  • Upgrade Safety: Proper storage layout maintenance

Events

Investment Events

Administrative Events

Best Practices

For Pool Administrators

  1. Regular Monitoring: Track pool utilization and performance
  2. Multisig Management: Ensure sufficient multisig wallet balance
  3. Configuration Updates: Adjust parameters based on market conditions
  4. Emergency Preparedness: Have pause/unpause procedures ready

For Developers

  1. Error Handling: Always check transaction success and revert reasons
  2. Event Monitoring: Subscribe to relevant events for real-time updates
  3. Gas Optimization: Batch multiple operations when possible
  4. Testing: Comprehensive test coverage for all scenarios

For Users

  1. Due Diligence: Review pool configuration and multisig setup
  2. Diversification: Spread investments across multiple pools
  3. Maturity Planning: Track investment maturity dates
  4. NFT Security: Secure your position NFTs in safe wallets

LP Token System

Understand the LP token mechanics and economics

NFT Positions

Learn about investment position NFTs and rendering

Pool Factory

Discover how pools are created and deployed

Investment Guide

Step-by-step guide to making investments