We manage your security to weather the AI storm →

Lending protocol audit

A lending protocol stays solvent only while its prices, interest indices and health checks agree. Guardian’s lending smart contract audits cover money markets, forks and credit protocols, backed by 20+ public lending reports.

20+ Public lending protocol reports
90+ Criticals and Highs in those reports
230+ Invariants listed in those reports
24 Criticals and Highs on Sentiment V2

DeFi audits for

  • GMX
  • Synthetix
  • Orderly Network
  • Dolomite
  • Veranta
  • Olympus

Onchain · Lending Protocol Audit

Every index, every health check, every liquidation.

  • Interest accrual and index math Supply and borrow indices, accrual before every state change, utilization, rate models, and rounding that favors the protocol.
  • Health factors and LTV A health check after every action that lowers collateral, same-asset collateral, LTV changes, and positions with no listed assets.
  • Liquidation paths Liquidations nothing can block, partial liquidations that leave a position healthier, minimum-debt rules, incentives and swap slippage.
  • Oracle reads Decimals, staleness, deviation and fallbacks, TWAP windows, and prices for LP, vault and yield-bearing collateral.
  • Bad debt and socialization Write-offs, stability pools and debt redistribution, and whether early exits push losses onto lenders who stay.
  • Isolated and pooled markets Per-market liquidity limits, shared balances in singleton contracts, and whether one market’s borrowers can reach another’s lenders.
  • Permissionless markets and curators Who can create a market, choose its oracle and rate model, set fees, and move deposits between markets.
  • Aave, Compound, Morpho and SparkLend forks The diff against upstream, plus the routers, flash-loan helpers and fee logic built around the fork.
  • Credit and undercollateralized lending Tranches and first-loss capital, markdowns and defaults, credit caps, and when a loss is recognized.
  • Fixed-rate and term loans Maturities, renewals, rate limits, onchain order books and installment schedules.
  • Collateral integrations Uniswap and Aerodrome LP positions, GMX GM tokens, aTokens and vault shares, and the protocols that issue them.
  • Admin keys and upgrades Roles that list assets, set LTVs and oracles, pause markets and upgrade code, with their bounds and timelocks.

Covers pooled and isolated money markets, fork deployments, CDP-style stability pools, fixed-rate, credit and NFT lending on Ethereum, L2s, HyperEVM and Stellar. Liquidation bots and keepers are reviewed in a separate Offchain Automation Pentest.

Public findings

What Guardian has found in lending code.

Each card links a finding in a public Guardian report. All were resolved.

  1. C-05Sentiment V2 · Critical

    The health check looped over a position’s listed assets. A position with none listed needed zero collateral, so anyone could borrow a pool’s entire balance with nothing posted.

    Health checks Read the finding C-05 in the Sentiment V2 report

  2. C-01Callisto · Critical

    A liquidated borrower’s debt was divided by the interest index before being spread to other borrowers. After a year at 50% APR, about one of three debt tokens vanished.

    Index math Read the finding C-01 in the Callisto report

  3. ML-1Ambit · High

    Each collateral had its own LTV, so a partial liquidation could cut borrowing power faster than debt. In the report’s example, a 0.80 health score fell to 0.60.

    Liquidations Read the finding ML-1 in the Ambit report

  4. H-02Impermax V3 · High

    The oracle averaged TWAPs across every Uniswap pool for a pair. Deploying a new fee tier with no history made it revert, blocking underwater checks and bad-debt restructuring.

    Oracles Read the finding H-02 in the Impermax V3 report

  5. C-03Sentiment V2 · Critical

    Borrows were not capped at a pool’s own liquidity, so one pool could lend out other pools’ deposits in the shared contract. Lenders elsewhere could no longer redeem.

    Isolated markets Read the finding C-03 in the Sentiment V2 report

  6. C-01Impermax V3 · Critical

    A borrow callback ran before the debt was recorded. Inside it, the borrower redeemed their LP position NFT, keeping both the loan and the collateral.

    LP collateral Read the finding C-01 in the Impermax V3 report

  7. C-01Vanir · Critical

    A liquidation contract on a SparkLend-based platform took its lending pool and swap router addresses from the caller. An attacker could pass their own and pull any user’s approved tokens.

    Flash-loan helpers Read the finding C-01 in the Vanir report

  8. M-033Jane · Medium

    Until a loss was reported, the credit cap kept its old, higher value. A second borrower could draw the extra liquidity first, pushing a later default past junior capital to senior holders.

    Credit Read the finding M-03 in the 3Jane LCC report

  9. H-01Tenor Morpho · High

    Overdue loan renewals measured the new term from the expired maturity, not from execution. Sixty days overdue into a 30-day term, a 10% rate ceiling became roughly 30%.

    Term loans Read the finding H-01 in the Tenor Morpho Integration report

  10. ITVF-1Dolomite · Critical

    A borrower could keep requeuing a GM token withdrawal with an impossible minimum output. With the whole balance pending, liquidators could seize nothing.

    Yield-bearing collateral Read the finding ITVF-1 in the Dolomite GMX V2 Module report

  11. C-01Magnify Cash · Critical

    A lender could delete the loan config an active ERC1155 loan relied on, so repayments reverted. Once the loan expired, the lender restored it and claimed the NFT.

    NFT lending Read the finding C-01 in the Magnify Cash NFT Lending Protocol report

Onchain · How it runs

Two teams, and solvency written as code.

  1. 01 / Two teams

    Two independent teams, one scope.

    Team A pairs expert manual review with the fuzzing suite. Team B runs Helix across every corner. Each cross-checks the other.

    • Expert manual review
    • Competitive incentives
    • Cross-checked findings
  2. 02 / Helix AI Auditor

    Helix, the leading AI Auditor.

    Hundreds of parallel agents spend billions of tokens across the entire codebase. Only human-verified findings reach the report.

    • Billions of tokens
    • Human-guided context
    • Human-triaged findings
  3. 03 / Invariant fuzzing

    An invariant suite around your solvency.

    Core safety properties become executable invariants, fuzzed across every reachable state. On a lending protocol, those are its health and liquidation rules.

    • Health improves after liquidation
    • No borrow leaves a position underwater
    • Borrow shares sum to total borrows
  4. 04 / Oracles and integrations

    The prices and protocols you lend against.

    Every feed is checked for decimals, staleness, deviation and fallbacks. Every market, vault or LP token you accept is treated as part of your solvency.

    • Feeds for every collateral type
    • Upgrades in protocols you integrate
    • Aave, Morpho and LP collateral

The suite stays with your code for every later change. Sentiment V2’s report lists 108 invariants, each fuzzed for 10M+ runs, and Ambit’s lists 39.

Published work

Money markets and credit protocols Guardian has reviewed.

Recent incidents

Lending protocol security failures this audit tests for.

  1. $197MEuler

    Its donation function did not check the health of the donor’s position. One attacker contract made itself insolvent through a donation, and a second liquidated it at a discount.

    Mar 2023 Our coverage of the Euler incident

  2. $20MSonne Finance

    A Compound v2 fork hit by a known donation attack. Anyone could activate its new market once the timelock expired, and the attacker did it in the attack transaction.

    May 2024 Our coverage of the Sonne Finance incident

  3. $9.05MBonzo

    An oracle verifier accepted a SAUCE price without a valid signature, and about $9.05 million of principal was extracted.

    Jul 2026 Our coverage of the Bonzo incident

“We were impressed with Guardian’s overall approach to security, focus on tests, attention to detail and streamlined audit process. We enjoyed working with them.”
RuvaagSentiment
“The Guardian team’s attention to detail is top-notch. We sleep soundly at night knowing that Guardian went through every detail of our codebase rigorously.”
Corey CaplanDolomite

Resource Hub

Before you book a DeFi lending security audit.

Questions

Lending protocol audit questions

What does a lending protocol audit cover?

The contracts that price collateral, accrue interest, check health, liquidate positions and write off bad debt, plus admin roles and the protocols you integrate. Guardian reviews your fixes before delivering the report. Vanguard runs the same two-team audit, then adds a public contest, a hosted bug bounty, offchain coverage and six months of update review.

Does an Aave, Compound or SparkLend fork need its own audit?

Yes, for every change from upstream and every contract built around it. A fork inherits upstream’s code, not its audit: new parameters, assets and oracles were never in upstream’s scope. Guardian’s follow-up review of Norlend’s SparkLend fork found Medium and Low issues only.

Which invariants do you fuzz on a lending protocol?

Solvency and liquidation rules. Ambit’s report lists “Liquidation always succeeds when health score is below UNHEALTHY_HEALTH_SCORE_THRESHOLD before liquidation”, which failed under fuzzing. Impermax V3’s lists “After a successful call to restructureBadDebt function, the position should NOT be underwater.”

Do you audit undercollateralized and credit lending?

Yes. 3Jane’s USD3 funds fintech lenders and unsecured credit lines for crypto borrowers. iris.credit opens loans on Aave or Morpho at a fixed rate a solver quotes; the solver posts a bond and covers the difference from the variable rate. For tokenized private credit, see the RWA Tokenization Audit.

How long does a lending protocol audit take?

Tenor’s lending protocol took a team of 6 auditors from April 7 to April 21, 2025. Sentiment V2 took a team of 7 from June 17 to June 27, 2024. Callisto’s review window ran from October 13 to November 26, 2025.

Which chains do your lending reports cover?

Guardian’s public lending reports cover Solidity on Ethereum, Arbitrum, Base, BNB Chain, Sonic, Plasma, Unichain and HyperEVM, and Avon’s order-book lending on MegaETH. Templar’s Blend V2 contracts are Rust on Soroban, on Stellar. Solana programs have their own Solana Audit.

Smart Contract Audit

Other engagements

Start now

Get a quote for your lending protocol audit.

Get a quote