PayStream is a comprehensive decentralized payroll management platform built for ETHGlobal 2025 that revolutionizes how employers pay employees using cryptocurrency. The system enables employers to pay their workforce in any cryptocurrency while employees receive payments in their preferred token and blockchain of choice, all facilitated through intelligent cross-chain infrastructure.
Problems It Solves
Traditional crypto payroll forces employers and employees to use the same blockchain and token, resulting in high fees, payment failures, and complex multi-chain management. PayStream eliminates this friction by enabling cross-chain, cross-token payments with intelligent fee optimization, automatic failover routing, and seamless PYUSD-based fiat on/off-ramps.
Core Features & Functionality
Multi-Chain Payment Flexibility with Intelligent Routing
- Dual Preference System: Employees set primary and secondary payment preferences for token type and blockchain network
- Cross-Chain Cross-Token Transfers: Since Avail's native transfer function doesn't support cross-chain cross-token transfers, we built custom smart contracts to enable ETH ↔ USDC swaps and facilitate multi-token swaps across different chains, expanding payment flexibility beyond Avail's native capabilities
- Intelligent Fee Optimization: Automatic comparison of transaction fees between preferences, routing through the most cost-effective option
- Automatic Failsafe: If primary preference fails, automatically retries on secondary preference
- Smart Fee Comparison: Evaluates total costs including gas prices, swap fees, and bridge costs
2. PYUSD Integration & Fiat On/Off-Ramp Solution
PayStream provides a complete solution for users who want to bridge traditional finance and cryptocurrency through PayPal's PYUSD stablecoin:
For Users Without Crypto:
- Users can onramp directly using PYUSD, providing an accessible entry point for those new to cryptocurrency
- Once onramped, users can make payments across any supported blockchain and in any supported token
- This removes the barrier of needing to acquire native crypto assets to participate in the ecosystem
Cross-Chain PYUSD Support:
- Integration with Layer Zero and the Stargate bridge enables PYUSD transfers from Ethereum to Solana Mainnet
- Support for PYUSD payments on testnets and additional networks beyond Avail Nexus's current native support
- Custom smart contract implementation to handle PYUSD swaps to other currencies when needed
Off-Ramp Functionality:
- Users can consolidate balances from multiple chains onto a single chain with one click
- The consolidated balance can be swapped to PYUSD
- Users can then off-ramp PYUSD back to their PayPal account, providing a seamless exit to traditional finance
- This creates a complete circular flow: fiat → PYUSD → any crypto → PYUSD → fiat
Advanced Transaction Tracking (Avail Intent Explorer)
- Complete Payment Trail: BlockScout integration showing full journey from employer to employee
- Multi-Step Visibility: Track deposits, conversions, and transfers with transaction hashes
- Audit Compliance: Full traceability for accounting and regulatory purposes
One-Time Payment Links
- QR Code & Link Generation: Create shareable payment links for ad-hoc transactions
- No Account Required: Payers don't need employer accounts
- Flexible Options: Pay with any available crypto, recipient receives preferred currency
Employee Management
- Group-Based Organization: Organize employees into payment groups for batch processing
- Flexible Configuration: Custom payment amounts and token preferences per employee
- Complete Payment History: Full audit trail of all transactions
- Real-time Notifications: Push-based updates for instant payment visibility
Unified Balance & Gas Management
- Multi-Chain Balance View: See all holdings across supported chains in one dashboard
- Gas Monitoring: Automatic tracking of gas token balances across all active chains
- Proactive Alerts: Notifications when gas falls below operational thresholds
- One-Click Refueling: Simplified gas top-ups without manual bridge operations
Technology Stack
Frontend & Backend:
- React-based web application with MetaMask wallet integration
- SuperBase PostgreSQL database with real-time subscriptions for employee data, payment schedules, and live notifications
- Push-based architecture eliminates polling overhead
- No traditional backend
Blockchain & Smart Contracts:
- Avail Nexus Framework: Core payment routing infrastructure providing cross-chain transaction coordination, solver network for currency conversion, and multi-chain balance aggregation
- Custom PayStream Smart Contracts: Deployed to handle PYUSD conversions to ETH and USDC, cross-currency swaps not yet supported by Avail Nexus, and PYUSD swap routing before Avail Nexus processing
- Solidity: Smart contract development language
- EVM-compatible chains: Ethereum Sepolia, Optimism Sepolia, Base, and more
Cross-Chain Infrastructure:
- Layer Zero Protocol: Cross-chain messaging layer
- Stargate Bridge: Facilitates PYUSD transfers between Ethereum and Solana
- Avail Nexus Solver Network: Handles currency conversions and cross-chain routing
Payment Integration:
- PayPal PYUSD: Stablecoin for on-ramp and off-ramp functionality
- Custom swap logic for PYUSD on testnets where official support isn't available
Blockchain Exploration:
- BlockScout API: Transaction tracking, explorer links for verification, solver information extraction, and custom payment flow visualization
Technical Architecture & Implementation
Payment Flow Pipeline:
- Preference-Based Routing: Employee preferences stored in SuperBase with primary/secondary chain and token choices
- Fee Comparison Engine: Before execution, the system queries gas prices and swap costs for both preference options, calculates total transaction costs, and selects the optimal route
- Token Allowance Management: Smart contract approvals set for solver interactions
- Avail Nexus Integration: Deposit to solver, currency conversion via solver network, and return transfer of converted funds
- Direct Transfer: Final transfer to employee on their chosen chain
- Failsafe Logic: Automatic retry on secondary preference if primary transaction fails, with fee comparison to ensure cost-effectiveness even during failover
- Transaction Recording: All steps logged to SuperBase with BlockScout transaction hashes
PYUSD Custom Swap Implementation:
Since Avail Nexus doesn't natively support PYUSD during the hackathon, we built custom smart contracts to bridge this gap:
- Swap Contracts: Handle PYUSD → ETH and PyUSD → USDC conversions using DEX integrations
- Multi-Step Flow: PYUSD swapped to Avail-supported currency → Avail Nexus processes cross-chain payment → Employee receives preferred token
- Layer Zero Integration: Enables PYUSD movement between Ethereum and Solana via Stargate
- Consolidation Feature: Gathers balances from multiple chains, swaps to PYUSD, and prepares for PayPal off-ramp
Gas Fueling System:
- Balance Monitoring: Periodic checks of native gas tokens across all chains in user's portfolio
- Threshold Alerts: Triggers notifications when gas falls below minimum operational levels
- Automated Bridge Integration: One-click refueling uses bridge APIs to transfer gas tokens from high-balance chains
Real-Time Updates:
SuperBase real-time subscriptions provide instant payment notifications without polling, reducing server load and improving user experience.
Notable Technical Achievements & Hacks
1. Avail Nexus Workarounds:
During the hackathon, Avail Nexus had limitations with certain token pairs and chains. We implemented custom smart contracts to handle these edge cases, essentially preprocessing payments before they enter the Avail ecosystem.
2. BlockScout Integration:
We scraped BlockScout transaction data to extract solver addresses and intermediate transaction details, creating a custom visualization showing the complete payment journey across multiple chains and contracts.
3. Fee Optimization Algorithm:
Built a real-time fee comparison engine that evaluates multiple routes before executing payments, considering gas prices, swap fees, and bridge costs to minimize total transaction costs.
4. PYUSD Testnet Support:
Since PYUSD wasn't fully supported on all testnets through official channels, we deployed custom contracts and integrated Stargate Bridge to enable PYUSD functionality across our target chains.
5. Unified Balance Aggregation:
Leveraged Avail Nexus's multi-chain infrastructure to create a single dashboard view of employer funds across all supported networks, simplifying treasury management.
6. Failsafe Architecture:
Implemented automatic fallback logic that handles transaction failures gracefully, retrying on alternative chains without user intervention while still optimizing for cost.
Partner Technology Benefits
- Avail Nexus: Eliminated need to build custom cross-chain messaging; provided battle-tested solver network
- BlockScout: Comprehensive transaction tracking without building custom indexing infrastructure
- Layer Zero/Stargate: Enabled Ethereum-Solana PYUSD bridging with proven security
- PayPal PYUSD: Provided familiar fiat on/off-ramp for traditional users
- SuperBase: Real-time database with built-in subscriptions saved significant backend development time
Challenges & Solutions
Challenge: Avail Nexus didn't support all token/chain combinations needed.
Solution: Built preprocessing layer with custom swap contracts.
Challenge: Complex multi-step transactions were difficult to track.
Solution: Integrated BlockScout API and built custom visualization layer.
Challenge: Users needed gas on multiple chains.
Solution: Implemented monitoring and one-click refueling system.
Challenge: Traditional users hesitant about crypto.
Solution: PYUSD integration provides familiar PayPal-based on/off-ramp.