PyPI
Decentralized bridge converting stablecoins to INR via UPI payments using Dutch auction pricing
Problem Statement
🎯 What This Project Does ETH-FLOW BridgeOf PyUSD is a decentralized bridge protocol that enables users to convert blockchain stablecoins (like USDC, USDT, or PyUSD) directly into Indian Rupees (INR) through India's UPI (Unified Payments Interface) system. Think of it as a crypto-to-cash conversion service, but completely decentralized and automated.The Core Problem It Solves Traditional Challenge: Converting crypto to local fiat currency typically requires centralized exchanges, KYC processes, bank transfers, and high fees This Solution: Direct peer-to-peer conversion from stablecoins to INR via UPI payments, with fair pricing through Dutch auctions 🏗️ How The System Works The project uses a sophisticated three-party system:Makers (Users wanting INR) Hold stablecoins (USDC/PyUSD) and want Indian Rupees Create orders by scanning UPI QR codes or entering payment details Set price ranges for how much INR they want per stablecoin Their crypto gets locked in a smart contract as escrowResolvers (Payment Processors) Automated bots that have INR in bank accounts Monitor the system for profitable conversion opportunities Process actual UPI payments to users Earn money from the price spread and feesSmart Contracts (The Trust Layer) Handle escrow of stablecoins Manage the Dutch auction process Ensure secure settlement between parties Deployed on Arbitrum Sepolia and Flow EVM testnets ⚖️ The Dutch Auction Mechanism This is where the project gets really clever: Example Transaction Flow:User wants ₹1000 INR for their USDCThey set: Start Price = ₹85/USDC, End Price = ₹82/USDCAuction starts at ₹85 and decreases over 5-10 secondsResolvers watch and wait for profitable priceFirst resolver to accept (say at ₹83/USDC) winsResolver pays ₹1000 to user's UPIResolver gets the USDC from the smart contractResolver profits from the spread🛠️ Technical Architecture The project is a full-stack DeFi application with multiple components:Frontend (Next.js PWA) Technology: Next.js 15, TypeScript, Tailwind CSS Features: QR code scanning for UPI payments Real-time auction monitoring Web3 wallet integration (RainbowKit/Wagmi) Mobile-first PWA design Live price charts and order tracking Backend (Node.js API) Technology: Express.js, MongoDB, Socket.IO Functions: REST API for order management Real-time WebSocket connections Dutch auction price calculation engine Order state management and monitoringSmart Contracts (Solidity) Main Contracts: OrderProtocol: Core logic for orders, auctions, and settlements MakerRegistry: Manages user registrations and UPI details ResolverRegistry: Handles resolver staking and authorization Security: OpenZeppelin standards, reentrancy protection, access controls Resolver Bots (Automated) Technology: Node.js with ethers.js Integration: RazorpayX API for UPI payments Functions: 24/7 monitoring of auctions Automated profitability calculations UPI payment processing Proof submission to smart contracts💰 Economic Model For Users (Makers) Get competitive exchange rates through auctions Direct UPI payments to their accounts No KYC or exchange account needed Transparent, smart contract-secured process For Resolvers Earn from price spreads (difference between acceptance price and market rate) Earn resolver fees Must stake 10 USDC as collateral Automated operation reduces manual workUser Order: 1000 USDC → ₹83,000 INR Resolver accepts at ₹83/USDC = ₹83,000 Resolver pays user ₹83,000 via UPI Resolver receives 1000 USDC (worth ~₹84,000 at market rate) Resolver profit: ₹1,000 ($12) per transaction🌐 Real-World Use Cases Primary Users: Crypto investors in India who want to cash out without exchanges Freelancers/Remote workers receiving crypto payments DeFi users wanting quick fiat conversion Businesses accepting crypto but needing INR settlement Geographic Focus: Primary: India (UPI integration) Future: Expandable to other countries with digital payment systems 🚀 Current Status & Deployment Live Networks: Arbitrum Sepolia Testnet (primary deployment) Flow EVM Testnet (secondary deployment) Status: Fully functional testnet version Contract Addresses: OrderProtocol: 0xB39F0F6eD29B4502c199171E2d483fCe05E0f5b2 MakerRegistry: 0x40F05c21eE1ab02B1Ddc11D327253CEdeE5D7D55 ResolverRegistry: 0xAC49Bd1e5877EAB0529cB9E3beaAAAF3dF67DE9f🔐 Security & Trust Smart Contract Security: OpenZeppelin security patterns Comprehensive testing with Foundry Escrow mechanism prevents fraud Time-locked orders with dispute resolution Payment Security: RazorpayX integration (bank-grade security) Proof-based settlement system Multi-signature resolver authorization Real-time transaction monitoring 🎯 Innovation & Uniqueness What Makes This Special: First of its kind: Direct crypto-to-UPI bridge Dutch auction pricing: Fair market-driven rates Fully automated: Minimal human intervention needed Trustless: Smart contract-based escrow Mobile-first: PWA with QR scanning Real-time: Live auction monitoringTechnical Innovations: Custom Dutch auction algorithm WebSocket-based real-time price discovery Automated UPI payment processing Cross-chain deployment ready PWA for mobile crypto payments 🚧 Current Limitations & Future Present Limitations: Testnet only (not mainnet ready) Manual resolver approval process Fixed INR conversion rates (no oracle integration) RazorpayX dependency (centralized payment processor) Planned Enhancements: Mainnet deployment on Arbitrum One Chainlink oracle integration for live rates Multi-currency support (EUR, GBP, etc.) Native mobile applications Cross-chain bridge expansion Decentralized governance token🎯 Target Market & Impact This project addresses the $100+ billion crypto-to-fiat conversion market in India, where:UPI processes 10+ billion transactions monthly Crypto adoption is growing rapidly Traditional conversion methods are expensive/slow Regulatory clarity is improving Potential Impact:Democratize crypto-to-fiat conversion Reduce dependency on centralized exchanges Enable faster, cheaper INR settlements Create new income opportunities for resolvers Bridge traditional finance with DeFi
Solution
This decentralized bridge protocol leverages a sophisticated multi-layer architecture combining modern web technologies with blockchain infrastructure to create a seamless crypto-to-UPI payment system. The project is built using Foundry for smart contract development, with three core contracts - OrderProtocol, MakerRegistry, and ResolverRegistry - deployed on both Arbitrum Sepolia and Flow EVM Testnet. The smart contracts implement a trustless escrow system where stablecoins are locked during order creation and released only upon successful payment proof submission.The frontend is a Next.js 15 PWA with TypeScript, featuring RainbowKit and Wagmi for Web3 integration, @yudiel/react-qr-scanner for native UPI QR code scanning, and Tailwind CSS with Radix UI components for a mobile-first interface. The particularly clever implementation allows users to scan any UPI QR code, automatically extract payment details (UPI address, amount, payee name), and redirect directly to the order creation form - creating a seamless bridge between traditional Indian payment systems and DeFi. Real-time updates are handled through Socket.IO connections that stream Dutch auction price changes and order status updates.The backend operates as a Node.js/Express API server with MongoDB for order management and a custom Dutch auction engine that implements non-linear price decay over 5-second intervals. The most innovative aspect is the resolver bot network - autonomous Node.js services that monitor auctions via WebSocket connections, calculate profitability in real-time, and automatically process RazorpayX UPI payments when accepting orders. These bots use a sophisticated three-step flow: creating RazorpayX contacts, establishing fund accounts for UPI addresses, and executing VPA payouts, with all payment proofs being submitted back to the smart contract for final settlement. The integration with RazorpayX APIs effectively creates a automated bridge between DeFi protocols and India's UPI infrastructure, while the Dutch auction mechanism ensures fair price discovery and resolver participation incentives.
Hackathon
ETHGlobal New Delhi
2025
Prizes
- 🏆
Best Killer App on Flow2nd place
Flow
Contributors
- yug49
138 contributions
- ssoni-hacken
13 contributions
- SamkitSoni
3 contributions
- kaustubh76
3 contributions