Home

RevvFi Protocol

A fixed-rate, peer-to-peer lending protocol with isolated per-borrower markets, Chainlink-priced collateral, Dutch-auction liquidations, and an on-chain reputation system.

Live on Sepolia testnet — free to try with mock USDC/WETH from the testnet faucet. RevvFi has not been audited yet, so this is not financial advice: any mainnet deployment should be treated as experimental until an audit is complete.


Overview

RevvFi lets any registered borrower deploy their own independent lending market. Lenders submit offers into that market’s order book at whatever APR they’re willing to accept; when the borrower draws down, the protocol fills the request from the best available offers. Each resulting position accrues interest independently, at the exact rate its lender quoted — there is no shared pool and no blended rate diluting what any individual lender actually earns.

Protocol Highlights

  • Isolated Markets: Each borrower’s market is its own contract instance (EIP-1167 clone), with its own collateral, offer book, and positions. Risk in one market never touches another.
  • Per-Position Interest Accrual: Every lender position tracks its own principal, its own quoted APR, and its own last-accrual timestamp — not a shared, weighted-average index.
  • Chainlink-Priced Collateral: Collateral value is read from a real AggregatorV3Interface Chainlink feed, with a per-market configurable staleness threshold (default 24 hours).
  • Dutch/English Hybrid Liquidation: Undercollateralized positions are liquidated via a declining-price auction that bidders can still outbid each other on, with anti-sniping time extension.
  • On-Chain Reputation: A borrower’s reputation score (0–1000) is derived from their actual success rate across every loan they’ve taken, not a simple incrementing counter.
  • Position NFTs: Every lender position is an ERC-721 token, transferable like any other NFT.
  • Epoch-Based Withdrawal Queue: Lenders exiting via the liquidity queue are processed in epochs rather than instantly, to prevent bank-run-style liquidity shocks.
  • Senior/Junior Seniority: Lenders can flag an offer as senior or junior; borrowers can optionally restrict a draw to senior-only liquidity.

How a Loan Actually Happens

  1. Market creation — A whitelisted borrower calls RevvFiFactory.deployMarket(), specifying the borrow asset, collateral asset, Chainlink oracle, decimals, and risk parameters. This clones a dedicated RevvFiMarket, RevvFiCollateralEscrow, RevvFiOfferBook, and RevvFiLiquidityQueue for that borrower.
  2. Offers — Lenders call submitOffer(amount, apr, seniority, duration) on the market’s offer book. Funds sit in the offer book, unmatched, until a borrower draws against them.
  3. Borrowing — The borrower deposits collateral, then calls borrow(amount, useSeniorOnly, maxApr). The offer book fills the request starting from the lowest-APR active offers (optionally senior-only), minting one RevvFiPositionNFT per lender filled.
  4. Accrual — From that moment, each position’s owed amount grows at that position’s own APR — independently of every other position in the market.
  5. Repayment — The borrower calls repay() (partial) or repayFull(). Repayments are split across active positions proportional to each position’s own share of total debt, crediting each lender’s claimable balance.
  6. Claiming — Lenders call claimFunds(positionId) themselves to pull their claimable balance out. Nothing is pushed automatically — this is a pull-based claim model.
  7. Liquidation (if needed) — If a position’s health factor drops below its market’s threshold, anyone can trigger RevvFiLiquidator to run a declining-price auction on the collateral, with proceeds routed back to lenders and any shortfall recorded as bad debt.

Explore the Documentation

  • Architecture — Contract layout, the EIP-1167 clone pattern, and the reasoning behind the per-position interest model.
  • Mechanics — How offer matching, liquidation auctions, and reputation scoring actually work, function by function.
  • Reference — Full event log, deployment addresses, glossary, and gas estimates.
  • Contributing — How to submit code, report bugs, and where each repository lives.

License

This documentation is licensed under the MIT License.