Inspiration
The global economy is shifting. We are moving from a human-centric workforce to an automated one, where AI Agents perform tasks, earn revenue, and manage wallets. Yet, the $100 Trillion global credit market is still designed entirely for humans.
Banks struggle to lend to digital-first SMEs because underwriting is manual, expensive ($3,000+ per loan), and slow. We asked ourselves a simple question: If an AI Agent can earn money programmatically, why can't it repay a loan programmatically?
Pay-Fi was born to solve the "Micro-Lending Paradox": How to make small, high-frequency loans to digital entities profitable and risk-free for institutional lenders.
What it does
Pay-Fi is a Zero-Touch Lending Protocol that enables "Self-Repaying Loans." It creates a closed-loop credit system where the loan is secured not just by collateral, but by the borrower's future revenue streams.
Identity & Trust: The borrower verifies their Identity (Government ID/Tax ID) and Revenue History using Zero-Knowledge Proofs, ensuring GDPR compliance without exposing sensitive data.
Credit Scoring: Our FlexCreditCore engine calculates a dynamic credit limit based on the real-time performance (PnL) of the borrower's business (or AI Agent).
The "Smart Wallet" Vault: Funds are disbursed to a specialized AgentWallet. This is no ordinary wallet—it is a smart contract that enforces spending policies (e.g., "Can only spend on Cloud Services").
Automated Repayment: This is our killer feature. When the borrower earns revenue, the AgentWallet intercepts the income and automatically repays the FlexCreditCore bank before the user can touch the funds. This reduces default risk to near zero.
How we built it
We architected a commercially viable stack focused on Speed, Privacy, and Scalability:Smart Contracts (Solidity): We deployed the core banking logic (FlexCreditCore.sol) and the borrower vaults (AgentWallet.sol) on Shardeum Sphinx 1.X. We chose Shardeum for its linear scalability, which is essential for high-frequency algorithmic lending.Privacy Layer (Mocked for Prototype): We designed the architecture to integrate vlayer for ZK-proofs, allowing us to verify "Income > $5000" cryptographically without reading the user's bank statement.Frontend (Next.js 14 + Wagmi): A professional, bank-grade dashboard that simplifies complex Web3 interactions into a familiar "Online Banking" experience.Math & Risk Engine:We implemented an on-chain risk model where the credit limit $C$ is a function of the verified income $I$ and the Agent's Performance Multiplier $P$:$$C = I \times P \times \alpha$$(Where $\alpha$ is the bank's risk tolerance factor, dynamically adjustable via governance).
Challenges we ran into
The "Decimal Dust" Problem: Integrating traditional finance logic (dollars) with blockchain logic (18-decimal precision) caused significant issues. We had to rewrite our FlexCreditCore to handle high-precision math to ensure that a loan of $1,000 didn't register as 0.000001 cents.
Bridging the Gap: Translating "Banker Logic" (KYC, AML, Credit Scores) into "Solidity Logic" (Merkle Proofs, Wallet Whitelists) was intellectually demanding. We had to ensure our smart contracts enforced real-world compliance rules without sacrificing decentralization.
Network Integration: Migrating from Sepolia to Shardeum presented RPC connectivity challenges, which we overcame by building custom Wagmi chain configurations to ensure a stable demo experience.
Accomplishments that we're proud of
Functional "Auto-Repay" Logic: We successfully built a mechanism where the frontend listens for income events and prompts the immediate settlement of debt. This demonstrates the potential for Programmatic Servicing, a huge efficiency gain for the LMA.
User-Friendly Design: We stripped away the crypto jargon. Instead of "Gas Fees" and "Hash Functions," our UI speaks the language of "Yield," "Credit Limits," and "Settlement."
Live Deployment: Despite the tight timeline, Pay-Fi is not just a Figma file—it is live code running on the Shardeum blockchain.
What's next for Payfi
Institutional Dashboard: Building a "Lender View" for banks to pool capital and view aggregate portfolio risk.
Full ZK Integration: Replacing our mock verifiers with live vlayer or Vouch proofs for production-grade privacy.
Cross-Border Lending: Utilizing stablecoins (USDC/EURC) to allow a bank in London to instantly fund a software developer in India with zero currency friction.
Pay-Fi isn't just a tool; it's the infrastructure for the next generation of digital commerce.
Built With
- blockchain
- lucide-react
- nextjs
- solidity
- tailwindcss
- tanstack-query
- typescript
- viem
- vlayer
- wagmi
- zero-knowledge-proofs
Log in or sign up for Devpost to join the conversation.