Pay2Earn

Pay2Earn: Pay Subscription with PyUSD, earn 4%+ APY via Morpho. Providers cut churn! đź’¸ #DeFi

Pay2Earn

Created At

ETHOnline 2025

Project Description

Pay2Earn is a decentralized subscription platform on Arbitrum that uses PayPal’s PyUSD stablecoin to make subscriptions rewarding for users and profitable for service providers. Built for the ETHGlobal Hackathon, it offers a new way to pay for services like streaming, software, or gym memberships while earning returns and reducing subscriber churn.

For Users: Pay yearly subscriptions with PyUSD and earn a 4% APY (PyUSD’s holding reward) plus extra yield from Morpho vaults if you complete the full year. You’ll get your principal back plus interest, turning subscriptions into a financial win. Cancel early? You get your principal refunded, but the interest goes to the provider, encouraging you to stay subscribed. The platform’s marketplace lets you browse providers, subscribe easily, and track your subscriptions and rewards on a user-friendly dashboard.

For Providers: Pay2Earn helps businesses like SaaS platforms or content creators keep subscribers longer. By offering financial rewards (4%+ APY), users are motivated to stay for the full year, reducing churn. Early cancellations mean you keep the forfeited interest as extra revenue. Joining is simple: register with a business name, description, and PyUSD price via an easy on-chain form. A provider dashboard shows your subscribers, locked PyUSD, and interest earned, with a “Withdraw Interest” button for quick access to funds.

Why It Stands Out: Pay2Earn leverages PyUSD’s stability, Morpho’s yield-boosting vaults, and Arbitrum’s low-cost transactions to create a win-win model. For the hackathon, we built a sandbox demo mode on Arbitrum Sepolia, letting judges test the platform risk-free. The demo includes a guided flow with a pre-funded wallet, sample providers (e.g., “Netflix Clone” or “Spotify Premium”), and a fast-forward feature to simulate a year-long subscription. Transactions are trackable on Arbiscan for transparency.

Pay2Earn makes subscriptions rewarding for users and sustainable for providers, driving DeFi adoption with a scalable, innovative platform.

How it's Made

🏗️ How It's Built

  1. Smart Contracts Layer Technology:
  • Language: Solidity 0.8.28
  • Framework: Hardhat 3.0 with Viem integration
  • Deployment: Hardhat Ignition for reproducible deployments
  • Network: Arbitrum One (42161) & Arbitrum Sepolia (421614)

Core Contracts:

  • SubscriptionManager.sol (543 lines) - Main subscription logic:
  • Manages monthly & yearly subscription models
  • Integrates with Morpho vaults for yield generation
  • Handles pro-rata refunds and automated payments
  • MockMorphoVault.sol - Morpho vault simulator for development

Contract address Arbitrum Sepolia (421614): subscriptionManager: '0x13445Bb62F05dc5f460aAE3F721Dd94C34D499c1', pyusd: '0x234982D988f139A77470d1d94ca517F2b404d92a', morphoVault: '0x87569E608a51797F4578740c86334CFcAE1D82Db'

Key Features: âś… Two subscription models (Monthly with optional staking, Yearly) âś… Morpho vault integration for yield optimization âś… Automated monthly payment processing âś… Pro-rata refund calculations âś… OpenZeppelin security patterns (ReentrancyGuard, Pausable, Ownable)

  1. Frontend Application Technology:
  • Framework: Next.js 15.5.6 (App Router with React 19)
  • Language: TypeScript 5
  • Styling: Tailwind CSS 4
  • State Management: TanStack React Query v5

Web3 Integration:

  • Wagmi v2.18.1 - React hooks for Ethereum
  • Viem v2.38.3 - Modern TypeScript Ethereum library
  • RainbowKit v2.2.9 - Beautiful wallet connection UI
background image mobile

Join the mailing list

Get the latest news and updates