Web3 · DeFiRM3057

SuperPool

SuperPool is a proof-of-concept decentralized micro-lending platform. It explores a community-driven lending model where users create and manage their own permissioned lending "pools," contribute liquidity, request and approve loans, and share out the interest — all settled on-chain, with an AI agent doing the reading for pool owners reviewing requests.

SuperPool is a proof-of-concept decentralized micro-lending platform built to explore community-driven lending mechanics on-chain. Users create permissioned lending pools within trusted circles, where members contribute liquidity and borrow from each other in a transparent, auditable environment. The contracts are chain-agnostic and target EVM networks — Polygon, Ethereum, Arbitrum, Base and BSC — though the backend currently resolves one configured chain at a time.

The platform centers on a multi-pool architecture where each pool is an independent contract with its own members and parameters. A pool decides at creation whether its owner admits members: with membership required, joining runs through a request-and-approve flow and nobody can fund or borrow until they're let in; with it off, funding the pool is what makes you a member. Loan review works the same way — a pool can either queue requests for the owner to approve or reject, or disburse in a single call to any member who has contributed.

Repayment is principal plus a flat interest fixed at disbursement, so repaying early costs the same. That interest is then shared out to the members who funded the pool, in proportion to what each put in, through a per-share accumulator rather than a loop over a member list — meaning claimInterest() stays cheap regardless of pool size, and withdrawing your contribution or being removed from the pool leaves what you already earned claimable.

When a pool owner opens a loan request, every fact is already on the card: the amount, the term price, the borrower's record, and what the money is for. An AI assessment workflow does the reading an owner has no time for when several requests are queued, running server-side behind a callable that verifies pool ownership before a model ever sees the request.

The mobile app offers wallet-based authentication across 500+ providers, with submitted transactions of every kind surviving an app restart — a startup recovery pass resolves anything pending and reconciles it against the chain. Pool administration runs through multi-sig: PoolFactory ownership transfers to a Safe, and admin actions execute through it.

This is a proof of concept, and deliberately scoped as one. The contracts are unaudited and not for real funds. Contributions are native currency only — ERC-20 liquidity needs contract work. Loan terms are recorded and displayed but not enforced on-chain: there is no liquidation, no penalty, and no default state.

Main responsibilities

  • Architected and developed the full-stack monorepo with pnpm workspaces and TypeScript project references, sharing types, brand assets, and contract bindings across contracts, backend, agents, mobile, and landing.
  • Engineered the smart contract system in Solidity 0.8.36 on Hardhat 3 with OpenZeppelin 5 (UUPS proxies, Ownable), implementing upgradeable PoolFactory and LendingPool contracts with multi-signature governance and permissioned membership logic — and separated the whitelisting key from the upgrade key before a testnet deployment could make that pairing permanent.
  • Implemented the interest distribution mechanism as a per-share accumulator, making payout independent of member count and keeping accrued interest claimable after a member withdraws or is removed.
  • Built the on-chain indexing layer with three independent paths and idempotent writes, so a pool creation or deposit lands in Firestore exactly once regardless of which path observes it first, and stopped the indexer from committing blocks the chain can still reorg away.
  • Built the AI loan assessment service as a standalone Mastra server whose only client is the backend, with prompt, schema, and eval modules, reached through a Firebase callable that gathers the facts and authorizes the caller before invoking it.
  • Implemented the Firebase Cloud Functions backend — wallet authentication, pools, events, notes, notifications, assessments, and App Check — with signature-based login featuring nonce expiry and replay protection, and device attestation issued only to devices linked to an authenticated wallet.
  • Added push notifications with delivery-receipt collection, closing the gap between a queued ticket and an actual delivery.
  • Hardened the backend by validating every payload before a handler reads it, requiring an operator for manual schedule triggers, and bounding and serializing the wallet that pays for whitelisting.
  • Developed the cross-platform mobile app with React Native, Expo 56, Uniwind (Tailwind CSS v4), and MobX, covering onboarding, wallet connection, pool discovery searched across the chain rather than one page of results, and pool management.
  • Established a type-safe blockchain interaction layer using Wagmi hooks, Viem, and Typechain for generated contract bindings, giving end-to-end type safety from Solidity through to the React components.
  • Built the landing page on Next.js 16 with React 19 and Tailwind CSS v4.