A revolutionary, next-generation decentralized marketplace for GPU/CPU streaming services built with cutting-edge web technologies, immersive 3D graphics, and premium design aesthetics. Leveraging the power of Avalanche blockchain technology and Superfluid's streaming payment infrastructure to create the future of computational resource sharing.
The Avalanche GPU Marketplace represents a paradigm shift in computational resource sharing, combining the power of decentralized finance with cutting-edge 3D web experiences. This platform enables users to seamlessly rent and provide GPU/CPU resources through real-time streaming payments, all wrapped in a stunning visual interface that sets new standards for Web3 applications.
- π₯ Instant Resource Access: Connect to high-performance GPU/CPU resources within seconds
- π° Real-time Payments: Stream payments automatically using Superfluid's money streaming protocol
- π Decentralized Infrastructure: Built on Avalanche for fast, low-cost transactions
- π¨ Premium UX: Immersive 3D interface with glassmorphism design and advanced animations
- π Secure & Trustless: Smart contract-based escrow and credential management
- Overview
- Features
- Technology Stack
- Architecture
- Getting Started
- Usage Guide
- Smart Contracts
- API Reference
- Development
- Deployment
- Security
- Performance
- Contributing
- License
- Support
- Sophisticated Color Palette: Pure Black (#000000), Pure White (#FFFFFF), Dark Green (#004d40), Deep Blue (#0d1b2a)
- Glassmorphism UI: Advanced backdrop blur effects with multi-layered depth
- Premium Typography: Inter font family with optimized weight variations
- Responsive Design: Mobile-first approach with fluid breakpoints and adaptive layouts
- Particle System: Real-time Canvas-based particle network with physics simulation
- 3D Geometric Shapes: Three.js powered floating cubes with MeshDistortMaterial
- Dynamic Backgrounds: Animated grid patterns and gradient orbs with continuous movement
- Hero Animations: Physics-based floating technology icons with realistic motion
- Depth Effects: Multi-layer Z-index management for true dimensional experience
- Framer Motion Integration: Spring physics and gesture-based interactions
- Staggered Animations: Choreographed entrance animations for UI elements
- Microinteractions: Hover effects, click feedback, and state transitions
- Loading States: Sophisticated dual-ring spinners and progress indicators
- Status Animations: Real-time badge updates with spring-based transitions
- Custom Cursor System: Dynamic cursor with trail effects and hover detection
- Scroll Progress: Visual scroll indicator with smooth interpolation
- Premium Controls: Wave-effect buttons with haptic-style feedback
- Glass Cards: Depth-based card system with realistic shadow casting
- Metric Visualization: Animated counter components with easing functions
- Web3 Wallet Integration: Seamless MetaMask connectivity with real-time status
- Streaming Payments: Superfluid SDK integration for continuous payment flows
- Smart Contract Interface: Direct blockchain interactions for resource listing/renting
- Payment Analytics: Comprehensive transaction history with visual timeline
- Credential Management: Secure modal system for remote access credentials
- Resource Monitoring: Real-time status tracking for active GPU/CPU sessions
- Transaction Validation: Multi-step verification before contract execution
- Error Boundaries: Graceful failure handling with user-friendly recovery
- Input Sanitization: Comprehensive validation for all user inputs
- Demo Mode: Fallback system for offline development and testing
βββ React 19.0.0 // Latest React with Concurrent Features
βββ TypeScript 5.7.2 // Type-safe development
βββ Vite 7.1.3 // Next-generation build tool
βββ ESLint + Prettier // Code quality and formattingβββ Three.js // 3D rendering engine
βββ @react-three/fiber // React renderer for Three.js
βββ @react-three/drei // Helper components and abstractions
βββ Framer Motion 12.23.12 // Advanced animation library
βββ Custom Canvas API // Particle systems and effectsβββ Custom CSS Variables // Design system tokens
βββ Glassmorphism // Modern UI design patterns
βββ Google Fonts (Inter) // Premium typography
βββ Heroicons 2.2.0 // Professional SVG icon library
βββ CSS Grid & Flexbox // Modern layout systemsβββ Wagmi 2.16.4 // React hooks for Ethereum
βββ Viem 2.0.0 // TypeScript Ethereum library
βββ Superfluid SDK 0.9.0 // Streaming payment protocol
βββ Ethers.js 5.8.0 // Ethereum JavaScript library
βββ MetaMask Integration // Wallet connectivityβββ Vite Development Server // Hot module replacement
βββ TypeScript Compiler // Static type checking
βββ ESLint Configuration // Code linting and standards
βββ PostCSS Processing // CSS transformations
βββ Asset Optimization // Image and bundle optimizationsrc/
βββ components/ # Reusable UI components
β βββ Scene3D.tsx # Three.js 3D scene management
β βββ ParticleSystem.tsx # Canvas-based particle effects
β βββ UIComponents.tsx # Premium UI component library
β βββ HeroAnimations.tsx # Hero section animations
β βββ CustomCursor.tsx # Custom cursor implementation
βββ lib/ # Core business logic
β βββ contract.ts # Smart contract interactions
β βββ superfluid.ts # Streaming payment logic
β βββ utils/ # Utility functions
βββ assets/ # Static assets and resources
βββ styles/ # Global CSS and design tokens
βββ types/ # TypeScript type definitions
graph TD
A[User Interface] --> B[React Components]
B --> C[Wagmi Hooks]
C --> D[Viem/Ethers]
D --> E[Smart Contracts]
E --> F[Avalanche Network]
B --> G[Superfluid SDK]
G --> H[Stream Management]
H --> F
B --> I[Three.js Scene]
I --> J[WebGL Renderer]
J --> K[Canvas Output]
App
βββ Scene3D (Three.js Canvas)
β βββ FloatingCubes
β βββ NetworkLines
β βββ Environment
βββ ParticleSystem (Canvas API)
βββ CustomCursor
βββ Navigation
βββ WalletConnection
βββ GPUListings
β βββ ListingCard[]
β βββ CreateListingForm
βββ PaymentDashboard
β βββ BalanceDisplay
β βββ ActiveStreams
β βββ TransactionHistory
βββ CredentialsModal- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/avalanche-gpu-marketplace.git cd avalanche-gpu-marketplace - Create a new branch for your feature:
git checkout -b feature/amazing-new-feature
- Install dependencies and start coding:
npm install npm run dev
:root {
/* Primary Colors */
--pure-black: #000000;
--pure-white: #ffffff;
--dark-green: #004d40;
--deep-blue: #0d1b2a;
/* Accent Colors */
--accent-green: #00bfa5;
--accent-blue: #1976d2;
--accent-purple: #7c4dff;
/* Glassmorphism */
--glass-bg: rgba(255, 255, 255, 0.1);
--glass-border: rgba(255, 255, 255, 0.2);
--glass-backdrop: blur(20px);
}--font-size-xs: 0.75rem; /* 12px */
--font-size-sm: 0.875rem; /* 14px */
--font-size-base: 1rem; /* 16px */
--font-size-lg: 1.125rem; /* 18px */
--font-size-xl: 1.25rem; /* 20px */
--font-size-2xl: 1.5rem; /* 24px */
--font-size-3xl: 1.875rem; /* 30px */
--font-size-4xl: 2.25rem; /* 36px */- Duration: Use
150msfor micro-interactions,300msfor component transitions - Easing: Prefer
cubic-bezier(0.4, 0, 0.2, 1)for natural motion - Transform: Use
transform3d()for GPU acceleration - Performance: Animate only
transformandopacityproperties when possible
# Unit Tests
npm run test:unit
# Integration Tests
npm run test:integration
# E2E Tests
npm run test:e2e
# Visual Regression Tests
npm run test:visual
# Performance Tests
npm run test:perf- TypeScript: Strict mode enabled, no
anytypes in production code - ESLint: Extended React and TypeScript rules
- Prettier: Consistent code formatting
- Husky: Pre-commit hooks for quality gates
- Conventional Commits: Semantic commit message format
# Install Vercel CLI
npm i -g vercel
# Deploy to production
vercel --prod
# Custom domain configuration
vercel domains add yourdomain.com# Build the project
npm run build
# Deploy dist folder to Netlify
# Or connect GitHub repo for automatic deployments# Build for production
npm run build
# Upload to S3 bucket
aws s3 sync dist/ s3://your-bucket-name
# Invalidate CloudFront cache
aws cloudfront create-invalidation --distribution-id YOUR_DISTRIBUTION_ID --paths "/*"# Mainnet Configuration
VITE_RPC_URL=https://rpc-mainnet.polygon.technology
VITE_MARKETPLACE_ADDRESS=0x... # Your deployed contract address
VITE_CHAIN_ID=137
# Performance Optimizations
VITE_ENABLE_3D=true
VITE_ENABLE_ANALYTICS=true
VITE_BUNDLE_ANALYZER=false
# Security
VITE_CSP_ENABLED=true
VITE_SECURITY_HEADERS=true# .github/workflows/deploy.yml
name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm ci
- run: npm run lint
- run: npm run type-check
- run: npm run test
- run: npm run build
- uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
vercel-args: '--prod'Ensure you have the following installed on your development machine:
- Node.js: Version 20.19+ or 22.12+ (LTS recommended)
- npm: Version 10+ or yarn: Version 1.22+
- Git: Latest version for version control
- MetaMask: Browser extension for Web3 interactions
- Modern Browser: Chrome 100+, Firefox 100+, Safari 16+, or Edge 100+
-
Clone the repository
git clone https://github.com/your-username/avalanche-gpu-marketplace.git cd avalanche-gpu-marketplace -
Install dependencies
npm install # or yarn install -
Environment configuration
cp .env.example .env.local # Configure your environment variables -
Start development server
npm run dev # or yarn dev -
Open your browser Navigate to
http://localhost:5173to view the application
Create a .env.local file in the root directory:
# Blockchain Configuration
VITE_RPC_URL=https://rpc-amoy.polygon.technology
VITE_MARKETPLACE_ADDRESS=0xa6165bbb69f7e8f3d960220B5F28e990ea5F630D
VITE_CHAIN_ID=80002
# Application Configuration
VITE_APP_NAME="Avalanche GPU Marketplace"
VITE_APP_VERSION="1.0.0"
# Feature Flags
VITE_ENABLE_3D=true
VITE_ENABLE_SOUND=false
VITE_DEMO_MODE=false# Development
npm run dev # Start development server with hot reload
npm run dev:host # Start server accessible on network
# Building
npm run build # Build for production
npm run build:analyze # Build with bundle analysis
# Quality Assurance
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues automatically
npm run type-check # Run TypeScript compiler check
# Testing
npm run test # Run test suite
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
# Preview & Deploy
npm run preview # Preview production build locally
npm run deploy # Deploy to production (configure as needed)- Install MetaMask: Download and install the MetaMask browser extension
- Network Configuration: The app will automatically prompt to add Polygon Amoy testnet
- Connect Wallet: Click the "Connect Wallet" button and approve the connection
- Account Status: Your wallet address and balance will be displayed in the navigation
- Navigate to Listings: Access the "Create Listing" section
- Fill Details:
- Title: Descriptive name for your resource (e.g., "RTX 4090 Gaming Rig")
- Specifications: Hardware details and capabilities
- Pricing: Set hourly rate in supported tokens (fDAIx, fUSDCx)
- Submit Transaction: Confirm the smart contract transaction
- Listing Active: Your resource is now available for rent
- Browse Marketplace: View available GPU/CPU resources in the listings grid
- Filter Options: Sort by price, performance, availability
- Resource Details: Click on cards to view specifications and pricing
- Start Rental: Click "Start Streaming" to begin the rental process
- Payment Stream: Automatic streaming payments via Superfluid
- Access Credentials: Receive secure remote access details
- Balance Monitoring: Real-time display of token balances
- Active Streams: View all ongoing payment streams
- Transaction History: Complete record of all marketplace activities
- Stream Control: Start, modify, or stop payment streams as needed
- Credentials Modal: Secure display of connection details
- AnyDesk Integration: One-click remote desktop access
- Session Management: Monitor active sessions and usage
- Automatic Cleanup: Sessions terminate when payments stop
Address: 0xa6165bbb69f7e8f3d960220B5F28e990ea5F630D
Network: Polygon Amoy Testnet
Verified: β
on PolygonScan
// Create a new resource listing
function createListing(
string memory superTokenSymbol,
uint96 flowRate,
string memory title,
string memory specsCID
) external returns (uint256 listingId)
// Start renting a resource
function startStream(
uint256 listingId,
address superToken,
uint96 flowRate
) external
// Stop an active rental
function stopStream(uint256 listingId) external
// Get listing details
function getListing(uint256 listingId)
external view returns (Listing memory)struct Listing {
address provider; // Resource owner
string superTokenSymbol; // Payment token
uint96 flowRate; // Payment rate (wei/second)
string title; // Resource name
string specsCID; // IPFS hash for specifications
address activeRenter; // Current renter (if any)
Status status; // AVAILABLE, RENTED, INACTIVE
bool exists; // Listing validity
}
enum Status {
AVAILABLE, // Ready for rent
RENTED, // Currently being used
INACTIVE // Temporarily unavailable
}The platform leverages Superfluid's continuous payment streaming:
- Real-time Payments: Money flows every second during resource usage
- No Periodic Transactions: Eliminates need for manual payment intervals
- Automatic Settlement: Payments stop when resource access ends
- Gas Efficient: Single transaction starts/stops entire payment stream
- fDAIx: Fake DAI on testnet
- fUSDCx: Fake USDC on testnet
- ETHx: Wrapped ETH for streaming
const {
address, // Connected wallet address
isConnected, // Connection status
isConnecting, // Loading state
connect, // Connection function
disconnect, // Disconnection function
switchNetwork // Network switching
} = useWalletConnection();const {
createListing, // Create new listing
getListings, // Fetch all listings
startRental, // Begin resource rental
stopRental, // End resource rental
getUserListings // Get user's listings
} = useMarketplaceContract();const {
startStream, // Initialize payment stream
stopStream, // Terminate payment stream
getStreamData, // Get stream information
calculateFlowRate // Convert hourly rate to flow rate
} = useSuperfluids();interface PremiumButtonProps {
variant: 'primary' | 'secondary' | 'outline';
size: 'small' | 'medium' | 'large';
loading?: boolean;
disabled?: boolean;
onClick: () => void;
children: React.ReactNode;
}interface Scene3DProps {
enableControls?: boolean;
showStats?: boolean;
backgroundColor?: string;
cameraPosition?: [number, number, number];
}- Secure Credential Handling: Credentials are never stored in localStorage or transmitted unencrypted
- Transaction Verification: Multi-step validation before any blockchain transactions
- Input Sanitization: Comprehensive validation for all user inputs and contract interactions
- Error Boundaries: Graceful failure handling prevents application crashes
- Rate Limiting: Protection against spam transactions and abuse
- CSP Headers: Content Security Policy implementation for XSS protection
- Access Control: Role-based permissions for critical functions
- Reentrancy Protection: Guards against reentrancy attacks
- Integer Overflow: SafeMath usage for all arithmetic operations
- Pausable Contracts: Emergency stop functionality for critical issues
- Upgrade Patterns: Proxy patterns for secure contract upgrades
- Automated Scanning: Continuous security monitoring with Slither
- Manual Review: Code review process for all security-critical changes
- Penetration Testing: Regular security assessments of the application
- Bug Bounty: Responsible disclosure program for security researchers
- Code Splitting: Dynamic imports for optimal bundle size
- Lazy Loading: On-demand loading of heavy 3D components
- Tree Shaking: Eliminates unused code from production builds
- Asset Optimization: Image compression and format optimization
- CDN Delivery: Global content delivery for faster load times
Lighthouse Score (Production):
βββ Performance: 95+ π’
βββ Accessibility: 100 π’
βββ Best Practices: 100 π’
βββ SEO: 95+ π’
Bundle Analysis:
βββ Initial Bundle: < 500KB
βββ 3D Components: Lazy loaded
βββ Vendor Chunks: Optimally split
βββ Cache Strategy: Long-term caching
- Core Web Vitals: Continuous monitoring of LCP, FID, CLS
- Real User Monitoring: Performance data from actual users
- Bundle Analysis: Regular bundle size monitoring and optimization
- Memory Profiling: WebGL memory usage tracking for 3D components
We welcome contributions from the community! Here's how you can help:
- Check existing issues to avoid duplicates
- Use the bug report template when creating new issues
- Provide detailed reproduction steps and environment information
- Include screenshots or videos when applicable
- Search existing feature requests first
- Describe the problem the feature would solve
- Propose a solution with implementation details
- Consider backward compatibility and breaking changes
- Fork the repository and create a feature branch
- Follow coding standards and write tests
- Update documentation for any API changes
- Submit a pull request with a clear description
- Improve existing docs with better examples
- Add missing documentation for new features
- Translate documentation to other languages
- Create tutorials and guides for common use cases
- UI/UX improvements with Figma designs
- 3D model contributions for enhanced visuals
- Animation suggestions for better user experience
- Accessibility improvements for inclusive design
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial Use: Use in commercial applications
- β Modification: Modify and create derivative works
- β Distribution: Distribute original or modified versions
- β Private Use: Use privately without restrictions
- β Limitation: Limited liability and warranty
- β Condition: Must include license and copyright notice
- π Documentation: Start with this README and inline code comments
- π¬ Discord: Join our community server for real-time support
- π GitHub Issues: Report bugs and request features
- π§ Email: Contact us at [email protected]
- π Live Demo: https://avalanche-gpu-marketplace.vercel.app
- π Analytics: Performance Dashboard
- π¨ Design System: Figma Design Files
- π API Docs: Developer Documentation
- π¦ Twitter: @AvalancheGPU
- π± Telegram: Community Chat
- π° Medium: Technical Blog
- π₯ YouTube: Tutorial Channel