Skip to content

Latest commit

 

History

History
327 lines (267 loc) · 7.45 KB

File metadata and controls

327 lines (267 loc) · 7.45 KB

Token Origin Tracker - Project Summary

Overview

A fully functional Web3 portal for tracking token transaction origins from DEX pools. Built with React, TypeScript, and Ethers.js, deployable to GitHub Pages with no server required.

✅ Completed Features

Core Functionality

  • ✅ DEX pool transaction analysis
  • ✅ Buy/sell transaction detection
  • ✅ Recursive token origin tracing
  • ✅ Time 0 detection (DEX, Contract, Aggregator, CEX)
  • ✅ Block limit handling (2000 blocks per query)
  • ✅ Complex transaction parsing

API Integration

  • ✅ Alchemy support
  • ✅ QuickNode support
  • ✅ Infura support
  • ✅ Multiple network support (Base, Ethereum, Polygon, etc.)
  • ✅ Browser-based API key storage

Wallet Management

  • ✅ Wallet labeling system
  • ✅ LocalStorage persistence
  • ✅ Known aggregator detection
  • ✅ CEX wallet detection
  • ✅ Label management UI

User Interface

  • ✅ Modern, responsive design
  • ✅ Mobile-optimized
  • ✅ Dark theme
  • ✅ Real-time progress tracking
  • ✅ Expandable trace visualization
  • ✅ Transaction statistics
  • ✅ Error handling and validation

Deployment

  • ✅ GitHub Actions workflow
  • ✅ GitHub Pages configuration
  • ✅ Production build optimization
  • ✅ Source maps for debugging

📁 Project Structure

sales-tracker/
├── src/
│   ├── components/          # React components
│   │   ├── AnalysisForm.tsx
│   │   ├── ConfigurationModal.tsx
│   │   ├── ResultsView.tsx
│   │   └── WalletLabelsModal.tsx
│   ├── types/              # TypeScript definitions
│   │   └── index.ts
│   ├── utils/              # Core logic
│   │   ├── blockchain.ts   # RPC interaction
│   │   ├── storage.ts      # LocalStorage
│   │   └── tracker.ts      # Tracing algorithm
│   ├── App.tsx             # Main component
│   ├── main.tsx            # Entry point
│   └── index.css           # Global styles
├── .github/workflows/      # CI/CD
├── public/                 # Static assets
├── Documentation files
└── Configuration files

🔧 Technology Stack

Frontend

  • React 18 - UI framework
  • TypeScript - Type safety
  • Vite - Build tool & dev server
  • Tailwind CSS - Utility-first styling
  • Lucide React - Icon library

Blockchain

  • Ethers.js v6 - Ethereum interaction
  • ERC20 Transfer Events - Token tracking
  • Binary Search - Block timestamp lookup

Deployment

  • GitHub Actions - CI/CD pipeline
  • GitHub Pages - Static hosting
  • No backend required - Pure client-side

🎯 Key Algorithms

1. Transaction Analysis

// Identifies buy/sell from pool transfers
- Pool  Wallet = Buy
- Wallet  Pool = Sell

2. Origin Tracing

// Recursive backward tracing
1. Start with seller wallet
2. Find first incoming transfer
3. Check if source is origin point
4. If not, recursively trace source
5. Continue until origin found

3. Origin Detection

// Determines if address is origin
- DEX Pool address
- Token contract address
- Known aggregator (1inch, 0x, etc.)
- Labeled CEX wallet
- Unknown (can't trace further)

4. Block Range Handling

// Respects RPC provider limits
- Split queries into 2000-block chunks
- Sequential processing
- Progress tracking

📊 Data Flow

User Input (Pool, Token, Timeframe)
    ↓
Convert timestamps to blocks
    ↓
Fetch token transfers from pool
    ↓
Identify buy/sell transactions
    ↓
For each sell:
    ↓
Trace wallet history backwards
    ↓
Find first incoming transfer
    ↓
Recursively trace source
    ↓
Detect origin point
    ↓
Build trace chain
    ↓
Display results

🎨 UI Components

ConfigurationModal

  • API provider selection
  • Network selection
  • API key input
  • LocalStorage persistence

WalletLabelsModal

  • Add/remove wallet labels
  • Address validation
  • Label management
  • Persistent storage

AnalysisForm

  • Pool address input (supports DexScreener URLs)
  • Token address input
  • Date/time pickers
  • Progress indicator
  • Error handling

ResultsView

  • Statistics cards
  • Transaction list
  • Expandable trace chains
  • Origin badges
  • External links (Etherscan)

🔒 Security Features

  • No backend - All processing client-side
  • Local storage - API keys never leave browser
  • Direct RPC - No intermediary servers
  • Open source - Fully auditable code
  • No tracking - No analytics or data collection

📱 Responsive Design

Desktop (1024px+)

  • Multi-column layouts
  • Expanded statistics
  • Side-by-side forms
  • Full trace visualization

Tablet (768px - 1023px)

  • Adaptive columns
  • Stacked forms
  • Optimized spacing

Mobile (< 768px)

  • Single column
  • Touch-optimized buttons
  • Scrollable lists
  • Compact statistics

🚀 Performance Optimizations

  1. Code Splitting - Vite automatic splitting
  2. Tree Shaking - Remove unused code
  3. Lazy Loading - Load on demand
  4. Efficient Queries - Batch RPC calls
  5. Progress Tracking - User feedback
  6. Error Recovery - Graceful failures

📝 Documentation

  • README.md - Project overview
  • QUICKSTART.md - Get started in 5 minutes
  • SETUP.md - Detailed setup instructions
  • USAGE_EXAMPLES.md - Real-world examples
  • PROJECT_SUMMARY.md - This file

🧪 Testing Recommendations

Manual Testing

  1. Test with known token on Base
  2. Verify API configuration works
  3. Test wallet labeling
  4. Verify trace accuracy
  5. Test mobile responsiveness

Edge Cases

  • Empty timeframes
  • Invalid addresses
  • Rate limit handling
  • Network errors
  • Long trace chains

🔄 Future Enhancements (Optional)

Potential Features

  • Export results to CSV/JSON
  • Batch analysis (multiple tokens)
  • Historical comparison
  • Whale wallet alerts
  • Price correlation
  • Multi-chain support
  • Trace visualization graph
  • Advanced filtering

Performance

  • Caching layer
  • Parallel tracing
  • Incremental updates
  • Background processing

Analytics

  • Pattern detection
  • Anomaly alerts
  • Trend analysis
  • Holder profiling

📦 Deployment Checklist

  • Update vite.config.ts base path
  • Test build locally
  • Push to GitHub
  • Enable GitHub Pages
  • Verify deployment
  • Test on mobile
  • Share with users

🎓 Learning Resources

For Users

  • QUICKSTART.md - Basic usage
  • USAGE_EXAMPLES.md - Advanced techniques

For Developers

  • SETUP.md - Development setup
  • Code comments - Inline documentation
  • TypeScript types - Self-documenting

🤝 Contributing

The codebase is structured for easy contributions:

  1. Components - Add new UI components
  2. Utils - Add new blockchain utilities
  3. Types - Extend TypeScript definitions
  4. Docs - Improve documentation

📄 License

MIT License - Free for any use

🎉 Ready to Use

The project is complete and ready to:

  1. Install dependencies (npm install)
  2. Run locally (npm run dev)
  3. Build for production (npm run build)
  4. Deploy to GitHub Pages

All features requested have been implemented: ✅ DEX pool analysis ✅ Time 0 tracing ✅ Complex transaction handling ✅ API configuration ✅ Wallet labeling ✅ Block limit handling ✅ Mobile responsive ✅ GitHub Pages deployment

📞 Support

For issues or questions:

  1. Check documentation files
  2. Review code comments
  3. Open GitHub issue
  4. The code is self-explanatory and well-structured

Built with ❤️ for the Web3 community