Skip to content

TradeProWeb3/TradePro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ† TradePro - Decentralized Investment Vaults Platform

TradePro Logo

Next.js Solidity Foundry TypeScript Wagmi

A revolutionary decentralized platform where professional traders manage investment vaults through smart contracts, enabling users to earn passive income from expert trading strategies.

๐Ÿš€ Live Demo โ€ข ๐Ÿ“š Documentation โ€ข ๐Ÿ”ง Installation โ€ข ๐Ÿ’ผ Contributing


๐ŸŒŸ Platform Overview

TradePro is a decentralized autonomous investment platform that bridges professional traders with passive investors through blockchain-powered vaults. Each vault is managed by verified professional traders who execute sophisticated investment strategies while users earn proportional returns based on their deposits.

๐ŸŽฏ Core Concept

Core Concept Diagram

๐Ÿ—๏ธ System Architecture

๐Ÿ” Smart Contract Layer

The platform is built on a robust smart contract infrastructure that ensures transparency, security, and automated execution of all operations.

graph LR
    A[VaultFactory Contract] -->|Creates & Manages| B[Individual Vaults]
    B -->|Executes| C[Trading Operations]
    B -->|Tracks| D[User Deposits]
    B -->|Calculates| E[Revenue Distribution]
    C -->|Interfaces| F[DeFi Protocols]
    
    subgraph "๐Ÿ”’ Security Features"
        G[Access Control]
        H[Emergency Pause]
        I[Multi-sig Validation]
    end
    
    B --> G
    B --> H  
    B --> I
    
    style A fill:#1976d2,color:#fff
    style B fill:#388e3c,color:#fff
    style C fill:#f57c00,color:#fff
Loading

๐Ÿ“ฑ Frontend Architecture

graph TB
    A[Next.js Frontend] -->|Web3 Integration| B[Wagmi Hooks]
    B -->|Blockchain Connection| C[Smart Contracts]
    A -->|UI Components| D[Product Cards]
    A -->|State Management| E[React Context]
    D -->|User Actions| F[Vault Operations]
    
    subgraph "๐ŸŽจ User Interface"
        G[Vault Dashboard]
        H[Trading Analytics]
        I[Portfolio Tracker]
    end
    
    A --> G
    A --> H
    A --> I
    
    style A fill:#000,color:#fff
    style B fill:#646cff,color:#fff
    style C fill:#f7931e,color:#fff
Loading

๐Ÿงช Base Sepolia Testnet Setup & Free Test ETH Guide

๐Ÿš€ Adding Base Sepolia Testnet to MetaMask


Follow the steps below to enable the Base Sepolia network in your MetaMask wallet:

Open MetaMask.

Click the network dropdown at the top.

Select "Show/hide test networks".

Enable the โ€œTest networksโ€ toggle.

If Base Sepolia appears in the list โ€” select it.

If it does not appear automatically, add it manually using the details below:

๐Ÿ’ง Getting Free Test ETH (Base Sepolia) via Google Cloud Faucet

You can request free test ETH for development directly from Google Cloud:

๐Ÿ”ฅ Official Faucet: https://cloud.google.com/application/web3/faucet

How to request:

Copy your MetaMask wallet address (starts with 0x...).

Open the Google Cloud Web3 Faucet.

Select Base Sepolia in the network dropdown.

Paste your wallet address.

Complete the captcha.

Click Send โ€” your test ETH should arrive shortly.

๐Ÿ“Œ Tips

Base Sepolia ETH is test-only, has no real value, and is used only for development.

If the faucet rate-limits you, try again later.

Ensure you selected Base Sepolia in MetaMask before testing transactions.

If you'd like the same style block for any other testnet (Polygon, Arbitrum, Optimism, BNB, etc.) โ€” I can generate it as well.

โšก Key Features

๐Ÿฆ Professional Vault Management

  • Verified Traders: Each vault is managed by professionally verified traders with proven track records
  • Transparent Performance: Real-time APY tracking and historical performance data
  • Strategy Diversity: Multiple trading approaches from conservative to high-yield strategies

๐Ÿ’ฐ Flexible Investment Options

  • Low Entry Barriers: Start investing with as little as 0.01 ETH
  • Monthly Subscriptions: Affordable monthly fees (10-20 USD) for vault access
  • Instant Liquidity: Withdraw your funds at any time without lock-up periods

๐Ÿ—ณ๏ธ Community Governance

  • Trader Rating System: Like/dislike voting mechanism for trader performance
  • Transparent Metrics: Real-time vault statistics and performance indicators
  • Community Feedback: User reviews and trader accountability

๐Ÿš€ How It Works

1๏ธโƒฃ Vault Selection & Joining

sequenceDiagram
    participant U as ๐Ÿ‘ค User
    participant F as ๐Ÿ–ฅ๏ธ Frontend
    participant C as ๐Ÿ“ Smart Contract
    participant V as ๐Ÿฆ Vault
    
    U->>F: Browse available vaults
    F->>U: Display vault options & APY
    U->>F: Select vault & enter deposit amount
    F->>C: Call joinVault() function
    C->>V: Add user to vault members
    V->>C: Update user deposit balance
    C->>U: Confirm successful join
Loading

2๏ธโƒฃ Trading Operations & Revenue Generation

sequenceDiagram
    participant T as ๐Ÿ‘จโ€๐Ÿ’ผ Trader
    participant V as ๐Ÿฆ Vault Contract
    participant D as ๐ŸŒ DeFi Protocols
    participant R as ๐Ÿ’ฐ Revenue Pool
    
    T->>V: Execute trading strategy
    V->>D: Interact with DEXs, lending protocols
    D->>V: Generate returns/yields
    V->>R: Accumulate profits
    R->>V: Calculate user shares
    V->>T: Distribute performance fee
Loading

3๏ธโƒฃ Withdrawal Process

sequenceDiagram
    participant U as ๐Ÿ‘ค User
    participant C as ๐Ÿ“ Contract
    participant V as ๐Ÿฆ Vault
    
    U->>C: Request withdrawal (amount)
    C->>V: Validate user balance
    V->>C: Calculate total returns
    C->>U: Transfer principal + profits
    V->>V: Update vault metrics
Loading

๐Ÿ’ผ Available Vaults

๐Ÿ”ท Mike's Conservative Vault

  • Strategy: Low-risk, steady returns
  • APY Target: 50%
  • Monthly Fee: $10 USD
  • Focus: Stablecoin farming, blue-chip DeFi protocols

๐ŸŸฃ James's Balanced Vault

  • Strategy: Medium-risk, balanced portfolio
  • APY Target: 70%
  • Monthly Fee: $15 USD
  • Focus: Mix of lending, DEX trading, yield farming

โšซ John's Aggressive Vault

  • Strategy: High-risk, maximum returns
  • APY Target: 120%
  • Monthly Fee: $20 USD
  • Focus: Leveraged positions, new DeFi protocols, arbitrage

๐Ÿ› ๏ธ Technical Stack

Blockchain & Smart Contracts

  • Solidity 0.8.19: Smart contract development
  • Foundry: Testing and deployment framework
  • OpenZeppelin: Security standards and utilities

Frontend Development

  • Next.js 14: React-based web framework
  • TypeScript: Type-safe development
  • Tailwind CSS: Utility-first styling
  • Wagmi: Web3 React hooks

Web3 Integration

  • Viem: TypeScript Ethereum library
  • ConnectKit: Wallet connection interface
  • Ethereum: Primary blockchain network

๐Ÿ”ง Installation

Prerequisites

node >= 18.0.0
npm >= 8.0.0
git

1. Clone the Repository

git clone 
cd tradepro1

2. Install Dependencies

# Install all packages
npm install

# Install Foundry (for smart contracts)
curl -L https://foundry.paradigm.xyz | bash
foundryup

3. Environment Setup

# Copy environment template
cp packages/nextjs/.env.example packages/nextjs/.env.local

# Add your configuration
NEXT_PUBLIC_ALCHEMY_API_KEY=your_alchemy_key
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_id

4. Start Development

# Start local blockchain (Terminal 1)
cd packages/foundry
make anvil

# Deploy contracts (Terminal 2)
cd packages/foundry
make deploy-local

# Start frontend (Terminal 3)  
cd packages/nextjs
npm run dev

5. Access Application

Open http://localhost:3000 in your browser.


๐Ÿ“ˆ Smart Contract Functions

Core Vault Operations

// Join a vault with ETH deposit
function joinVault(uint256 vaultId) external payable

// Add additional deposit to existing position
function addDeposit(uint256 vaultId) external payable

// Withdraw funds with accumulated returns
function withdrawEth(uint256 vaultId, uint256 amount) external

// Get user's deposit in a specific vault
function getUserVaultDeposits(uint256 vaultId, address user) external view returns (uint256)

// Vote for trader performance
function voteTrader(uint256 vaultId, bool isPositive) external

Administrative Functions

// Create new vault (admin only)
function createVault(string memory name, address trader, uint256 fee) external onlyOwner

// Emergency pause functionality
function pause() external onlyOwner
function unpause() external onlyOwner

// Update vault parameters
function updateVaultFee(uint256 vaultId, uint256 newFee) external onlyOwner

๐ŸŽฎ User Interface

Main Dashboard

The platform features an intuitive dashboard displaying:

  • ๐Ÿ“Š Real-time vault performance metrics
  • ๐Ÿ’ฐ User portfolio overview
  • ๐Ÿ“ˆ Historical APY trends
  • ๐Ÿ† Trader leaderboards

Vault Cards

Each vault is presented with:

  • Trader profile and verification status
  • Current APY and performance history
  • Monthly subscription fee
  • Community ratings (thumbs up/down)
  • Join/deposit/withdraw actions

Interactive Features

  • ๐ŸŒ“ Dark/Light mode toggle
  • ๐Ÿ“ฑ Mobile-responsive design
  • โšก Real-time balance updates
  • ๐Ÿ”” Transaction notifications

๐Ÿ”’ Security Features

Smart Contract Security

  • โœ… Access Control: Role-based permissions
  • โœ… Reentrancy Protection: Secure external calls
  • โœ… Emergency Pause: Circuit breaker mechanism
  • โœ… Input Validation: Comprehensive parameter checking

Audit & Testing

  • ๐Ÿงช Comprehensive Test Suite: 95%+ code coverage
  • ๐Ÿ” Static Analysis: Slither integration
  • ๐Ÿ“‹ Manual Review: Professional security audit
  • ๐Ÿ—๏ธ Formal Verification: Mathematical proofs

๐Ÿค Contributing

We welcome contributions from the community! Here's how you can help:

Development Workflow

  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 branch (git push origin feature/amazing-feature)
  5. ๐Ÿ”„ Open a Pull Request

Areas for Contribution

  • ๐Ÿ› Bug fixes and improvements
  • โœจ New vault strategies
  • ๐ŸŽจ UI/UX enhancements
  • ๐Ÿ“š Documentation updates
  • ๐Ÿงช Additional test coverage

๐Ÿ“œ License

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


๐Ÿ†˜ Support & Community

Get Help

โš ๏ธ Disclaimer

Investment Risk Warning: Trading and DeFi investments carry inherent risks. Past performance does not guarantee future results. Only invest what you can afford to lose. TradePro is experimental software - use at your own risk.


Built with โค๏ธ by the TradePro Team

๐ŸŒŸ Star this repo โ€ข ๐Ÿ”— Share with friends โ€ข ๐Ÿ“ง Stay updated

About

smart vault protocol for automated asset management

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •