Skip to content

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Social-Copy

A comprehensive social trading platform built for Solana that allows users to track top-performing wallets and automatically copy their trades. Built with Next.js, TypeScript, and Privy for authentication.

Features

πŸ” Wallet Tracking

  • Monitor top-performing Solana wallets in real-time
  • Track wallet performance metrics (PnL, win rate, total trades)
  • Rank wallets by performance score
  • Add custom tags and descriptions for tracked wallets

πŸ“Š Performance Analytics

  • Detailed performance charts and metrics
  • Historical performance tracking
  • Wallet ranking and comparison tools
  • Visual analytics with interactive charts

πŸ”„ Copy Trading

  • Automatic copy trading from top performers
  • Manual copy trading with customizable amounts
  • Risk assessment and signal strength indicators
  • Real-time trading signals and notifications

πŸ” Delegation System

  • Secure delegation of trading permissions
  • Admin approval workflow for copy trading access
  • Granular permission controls (max amounts, allowed tokens)
  • User management and access control

πŸ›‘οΈ Admin Panel

  • Manage delegation requests
  • Monitor platform statistics
  • Oversee copy trading activities
  • User management and access control

Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript
  • Styling: Tailwind CSS
  • Authentication: Privy
  • Blockchain: Solana Web3.js
  • Charts: Recharts
  • UI Components: Radix UI, Lucide React

Getting Started

Prerequisites

  • Node.js 18+
  • Yarn package manager
  • Solana RPC endpoint
  • Privy App ID and Secret

Installation

  1. Clone the repository:
git clone <repository-url>
cd copy-trading-social-media
  1. Install dependencies:
yarn install
  1. Set up environment variables:
cp .env.example .env.local
  1. Configure your environment variables in .env.local:
# Solana Configuration
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
NEXT_PUBLIC_SOLANA_WS_URL=wss://api.mainnet-beta.solana.com
SOLANA_PRIVATE_KEY=your_admin_wallet_private_key_here

# Privy Configuration
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id_here
PRIVY_APP_SECRET=your_privy_app_secret_here

# Admin Configuration
ADMIN_WALLET_ADDRESS=your_admin_wallet_address_here
  1. Start the development server:
yarn dev
  1. Open http://localhost:3000 in your browser.

Project Structure

src/
β”œβ”€β”€ app/                    # Next.js app router pages
β”‚   β”œβ”€β”€ analytics/          # Analytics page
β”‚   β”œβ”€β”€ admin/              # Admin panel
β”‚   β”œβ”€β”€ copy-trading/       # Copy trading interface
β”‚   β”œβ”€β”€ wallets/            # Wallet tracking
β”‚   └── layout.tsx          # Root layout
β”œβ”€β”€ components/             # React components
β”‚   β”œβ”€β”€ admin/              # Admin components
β”‚   β”œβ”€β”€ analytics/          # Analytics components
β”‚   β”œβ”€β”€ copy-trading/       # Copy trading components
β”‚   β”œβ”€β”€ dashboard/          # Dashboard components
β”‚   β”œβ”€β”€ navigation/         # Navigation components
β”‚   β”œβ”€β”€ ui/                 # Reusable UI components
β”‚   └── wallet-tracker/    # Wallet tracking components
└── lib/                    # Core functionality
    β”œβ”€β”€ auth.ts             # Authentication logic
    β”œβ”€β”€ copy-trading.ts     # Copy trading engine
    β”œβ”€β”€ solana.ts           # Solana integration
    β”œβ”€β”€ transaction-indexer.ts # Transaction processing
    β”œβ”€β”€ utils.ts            # Utility functions
    └── wallet-tracker.ts   # Wallet tracking system

Key Features Explained

Wallet Tracking System

The platform continuously monitors Solana wallets by:

  • Fetching recent transactions via Solana RPC
  • Analyzing transaction patterns and performance
  • Calculating PnL, win rates, and other metrics
  • Ranking wallets by performance score

Transaction Indexer

A sophisticated system that:

  • Indexes and categorizes transactions (swaps, transfers, stakes)
  • Extracts token transfer information
  • Identifies trading patterns and opportunities
  • Provides real-time transaction monitoring

Copy Trading Engine

Automated trading system that:

  • Monitors tracked wallets for new transactions
  • Generates trading signals based on performance
  • Executes copy trades with customizable parameters
  • Manages risk and position sizing

Delegation System

Secure permission management:

  • Users request delegation from admin wallets
  • Admins approve/reject requests with custom permissions
  • Granular control over trading amounts and token restrictions
  • Secure storage of delegation permissions

Usage

For Regular Users

  1. Connect Wallet: Use Privy to connect your Solana wallet
  2. Request Delegation: Request copy trading permissions from admin
  3. Browse Wallets: Explore top-performing wallets
  4. Copy Trades: Execute copy trades manually or enable auto-copy
  5. Monitor Performance: Track your copy trading results

For Admins

  1. Access Admin Panel: Navigate to /admin (requires admin wallet)
  2. Manage Delegations: Approve/reject user delegation requests
  3. Monitor Platform: View platform statistics and user activity
  4. Track Performance: Monitor overall copy trading performance

Security Considerations

  • All wallet connections are handled securely through Privy
  • Delegation permissions are stored locally (in production, use secure database)
  • Private keys should never be exposed in client-side code
  • Admin functions are protected by wallet address verification
  • All transactions are validated before execution

Development

Adding New Features

  1. Create components in appropriate directories
  2. Add new pages in the app/ directory
  3. Update navigation in components/navigation/navbar.tsx
  4. Add any new API routes in app/api/

Testing

yarn lint          # Run ESLint
yarn build         # Build for production
yarn start         # Start production server

Deployment

  1. Build the application:
yarn build
  1. Deploy to your preferred platform (Vercel, Netlify, etc.)

  2. Configure environment variables in your deployment platform

  3. Ensure your Solana RPC endpoint is accessible from production

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

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

Support

For support and questions:

  • Create an issue in the repository
  • Check the documentation
  • Review the code comments for implementation details

Roadmap

  • Database integration for persistent storage
  • Advanced risk management features
  • Social features (following, leaderboards)
  • Mobile app development
  • Advanced analytics and reporting
  • Integration with more DEXs
  • Automated strategy backtesting
  • Community features and discussions

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages