Skip to content
ankur-JAPublic

About

The decentralized asset management protocol. Pool funds, deploy strategies, and grow together.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Status License Solidity Next.js

πŸͺΊ NestFi

Decentralized Asset Management Protocol

Pool funds into curated DeFi vaults. Curators manage strategies, investors share returns.
Fully transparent. Fully on-chain.


πŸ“– Table of Contents


🌟 Overview

NestFi is a decentralized investment vault protocol built on Ethereum. It enables:

  • Investors to deposit funds into professionally managed vaults and earn passive yields
  • Curators to create investment vaults, deploy DeFi strategies, and earn management fees

The protocol uses the ERC-4626 tokenized vault standard for maximum composability and transparency.


✨ Features

Feature Description
🏦 ERC-4626 Vaults Fully compliant tokenized vault standard
⚑ Gasless Transactions ERC-7702 + Permit2 for seamless UX
πŸ” Non-Custodial Users always control their funds
πŸ“Š Multi-Strategy Deploy to Aave, Uniswap, Velodrome, and more
🎯 Allowlist Control Curators can restrict vault access
πŸ’° Flexible Fees Customizable management fee structure
πŸŒ™ Dark/Light Theme Beautiful, modern UI with theme support
πŸ“± Responsive Design Works on all devices

πŸ— Architecture

╔═════════════════════════════════════════════════════════════════════╗
β•‘                            NestFi                                   β•‘
╠═════════════════════════════════════════════════════════════════════╣
β•‘                                                                     β•‘
β•‘    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β•‘
β•‘    β”‚   Frontend   β”‚      β”‚    Smart     β”‚      β”‚  Strategies  β”‚   β•‘
β•‘    β”‚  (Next.js)   │◄────►│  Contracts   │◄────►│   (DeFi)     β”‚   β•‘
β•‘    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β•‘
β•‘          β”‚                    β”‚                      β”‚             β•‘
β•‘          β”‚                    β”‚                      β”‚             β•‘
β•‘          β–Ό                    β–Ό                      β–Ό             β•‘
β•‘    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β•‘
β•‘    β”‚  RainbowKit  β”‚      β”‚ VaultFactory β”‚      β”‚    Aave      β”‚   β•‘
β•‘    β”‚  Wagmi/Viem  β”‚      β”‚  GroupVault  β”‚      β”‚   Uniswap    β”‚   β•‘
β•‘    β”‚    React     β”‚      β”‚   Permit2    β”‚      β”‚  Velodrome   β”‚   β•‘
β•‘    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β•‘
β•‘                                                                     β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Data Flow

  1. User connects wallet via RainbowKit
  2. Frontend reads vault data from blockchain (Wagmi/Viem)
  3. User signs deposit/withdraw transactions
  4. Smart contracts execute operations
  5. Strategies deploy funds to DeFi protocols

πŸš€ Getting Started

Prerequisites

Requirement Version
Node.js 18+
pnpm Latest
Foundry Latest
Git Latest

Installation

# 1. Clone the repository
git clone https://github.com/your-username/nestfi.git
cd nestfi

# 2. Install dependencies
pnpm install

# 3. Set up environment variables
cp packages/foundry/.env.example packages/foundry/.env
# Edit .env with your private key

# 4. Start local blockchain
cd packages/foundry
anvil

# 5. Deploy contracts (in a new terminal)
cd packages/foundry
pnpm deploy --reset

# 6. Start frontend (in a new terminal)
cd packages/nextjs
pnpm dev

# 7. Open in browser
open http://localhost:3000

πŸ“œ Smart Contracts

Core Contracts

Contract Description
VaultFactory.sol Factory for creating vault instances
GroupVault.sol ERC-4626 compliant investment vault

Strategy Contracts

Contract Description
AaveStrategy.sol Aave V3 lending strategy
UniswapStrategy.sol Uniswap V3 liquidity strategy
VelodromeStrategy.sol Velodrome DEX strategy

Contract Features

  • βœ… ERC-4626 compliant
  • βœ… Permit2 gasless approvals
  • βœ… Reentrancy protection
  • βœ… Pausable functionality
  • βœ… Access control (allowlists)
  • βœ… Deposit caps & minimums

πŸ’» Frontend

Project Structure

packages/nextjs/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ page.tsx           # Landing page
β”‚   β”œβ”€β”€ investor/          # Investor dashboard
β”‚   └── curator/           # Curator dashboard
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ Header.tsx         # Navigation header
β”‚   β”œβ”€β”€ Footer.tsx         # Site footer
β”‚   β”œβ”€β”€ NestFiLogo.tsx     # Brand logo
β”‚   └── SettingsDropdown.tsx # Settings panel
β”œβ”€β”€ contexts/              # React contexts
β”‚   └── ThemeContext.tsx   # Theme management
β”œβ”€β”€ hooks/                 # Custom hooks
└── styles/                # Global styles

Key Components

Component Purpose
Header Navigation with wallet connection
Footer Site footer with links
SettingsDropdown Theme toggle, language, settings
VaultCard Display vault information

πŸ‘₯ User Roles

πŸ”΅ Investor

Investors deposit funds into vaults to earn passive yields.

Action Description
Browse Vaults Explore available investment vaults
Deposit USDC Invest any amount into a vault
Track Performance Monitor your investments
Withdraw Exit your position anytime

🟒 Curator

Curators create and manage investment vaults.

Action Description
Create Vault Set up a new investment vault
Deploy Strategies Allocate funds to DeFi protocols
Manage Access Control who can invest
Earn Fees Collect management fees

πŸ›  Tech Stack

Smart Contracts

Technology Purpose
Solidity Smart contract language
Foundry Development framework
OpenZeppelin Security libraries

Frontend

Technology Purpose
Next.js 14 React framework
TypeScript Type safety
Tailwind CSS Styling
Framer Motion Animations

Web3

Technology Purpose
Wagmi v2 React hooks for Ethereum
Viem TypeScript Ethereum library
RainbowKit Wallet connection

πŸ” Environment Variables

Foundry (packages/foundry/.env)

# Required
PRIVATE_KEY=your_private_key_here

# Network RPC URLs
RPC_URL_SEPOLIA=https://sepolia.infura.io/v3/YOUR_KEY
RPC_URL_OPTIMISM=https://optimism.infura.io/v3/YOUR_KEY

# Etherscan API (for verification)
ETHERSCAN_API_KEY=your_api_key

Frontend (packages/nextjs/.env.local)

# Chain configuration
NEXT_PUBLIC_CHAIN_ID=11155111

# Optional: The Graph endpoint
NEXT_PUBLIC_GRAPH_ENDPOINT=

# Optional: Strategy addresses
NEXT_PUBLIC_AAVE_STRATEGY=

🚒 Deployment

Deploy to Testnet (Sepolia)

cd packages/foundry

# Set environment variables
export PRIVATE_KEY=your_private_key

# Deploy
forge script script/Deploy.s.sol --rpc-url sepolia --broadcast --verify

Deploy to Production (Optimism)

cd packages/foundry

# Deploy with production settings
forge script script/Deploy.s.sol --rpc-url optimism --broadcast --verify

Deploy Frontend

cd packages/nextjs

# Build for production
pnpm build

# Deploy to Vercel
vercel --prod

πŸ”’ Security

Smart Contract Security

  • βœ… OpenZeppelin audited libraries
  • βœ… Reentrancy guards on all external calls
  • βœ… Access control on admin functions
  • βœ… Input validation on all parameters
  • βœ… Emergency pause functionality

Best Practices

  • All funds are non-custodial
  • No admin keys can drain funds
  • Transparent on-chain operations
  • Open source code

πŸ—Ί Roadmap

Phase 1: Foundation βœ…

  • ERC-4626 vault implementation
  • Basic strategies (Aave)
  • Frontend dashboard
  • Wallet integration

Phase 2: Enhancement 🚧

  • Additional strategies (Uniswap, Velodrome)
  • Performance analytics
  • Vault reputation system
  • Mobile optimization

Phase 3: Scale πŸ“‹

  • Multi-chain deployment
  • Governance token
  • DAO voting
  • API for integrations

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Write tests for new features
  • Follow existing code style
  • Update documentation as needed
  • Keep commits atomic and descriptive

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ“ž Support & Links

Resource Link
πŸ“– Documentation Coming soon
πŸ› Report Bug Open Issue
πŸ’¬ Discord Coming soon
🐦 Twitter Coming soon

Made with ❀️ by NestFi Labs

Invest together. Grow together.

About

The decentralized asset management protocol. Pool funds, deploy strategies, and grow together.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages