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.
DeFi audits for



Dolomite
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.
-
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
-
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
-
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
-
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.
-
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
-
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
-
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
-
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.
-
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
-
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
-
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.
-
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
-
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
-
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
-
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.
- Case studyDolomiteLending against GMX GM tokens: 2 Criticals and 4 Highs, all remediated.
- ReportsSentimentLeveraged lending with permissionless pools and SuperPools: 5 Criticals and 19 Highs.
- ReportsCallistoBorrowing against cOHM, with a stability pool that absorbs liquidations: 4 Criticals and 13 Highs.
- ReportsImpermaxBorrowing against Uniswap and Aerodrome LP positions.
- ReportsTenorFixed-rate, fixed-term stablecoin loans matched through Morpho.
- Reports3JaneOnchain credit: 19 Medium findings on markdowns, tranches and default auctions.
- ReportsButtonwoodMortgage-style loans repaid in monthly installments: 3 Criticals and 9 Highs.
- ReportsMagnify CashPeer-to-peer loans against NFTs, with no price oracles.
Recent incidents
Lending protocol security failures this audit tests for.
-
$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
-
$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.
-
$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 CaplanDolomiteResource Hub
Before you book a DeFi lending security audit.
- ChecklistLending protocol audit checklist40 money market checks, most tied to a public finding.
- GuideLiquidation vulnerabilities13 ways a liquidation fails to run, or runs wrong.
- ExplainerBad debt in DeFiHow it forms, and which backstop pays for it.
- ExplainerOracle manipulationFrom spot price to TWAP: how borrowed capital moves a price.
- GuideDeFi lending risksThe linked risks on Aave and Morpho, for institutions.
- RiskVault curator riskWhat Stream Finance’s collapse showed about curated lending vaults.
- RiskIs Aave safe?Bad debt history, the rsETH exploit and the Safety Module.
- RiskIs Morpho safe?Immutable core, and the oracle and curator choices around it.
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
- Featured · Onchain Vanguard Audit A security audit designed to protect onchain teams facing unprecedented cyber risk. Explore Vanguard
- Managed services Managed Security Dedicated response team, red team, 24/7 attack and defense across every surface you run, onchain and off. Explore Managed Security
- OnchainSmart Contract AuditTwo competing teams, Helix AI and invariant fuzzing.
- OnchainDeFi Protocol AuditAccounting, oracles, liquidations and integrations.
- OnchainYield Vault AuditERC-4626 share math, strategies, fees and withdrawal queues.
- OnchainLiquid Staking AuditExchange rates, queues, slashing, validators and restaking.
- OnchainAMM and DEX AuditSwap math, ticks, rounding, fees, MEV, routers and order books.
- OnchainRWA Tokenization AuditKYC allowlists, transfer rules, NAV oracles, redemptions and distributions.
- OnchainPerp DEX AuditFunding, liquidations, oracles, auto-deleveraging and keepers.
- OnchainStablecoin AuditMint limits, roles, freezes, oracles and multichain deployments.
- OnchainOptions and Derivatives AuditPricing, margin, expiry, rate swaps, tranches and leveraged tokens.
- OffchainOffchain Automation PentestKeepers, relayers, bots and the automation-to-chain boundary.
- OffchainOpSec AuditKeys, signers, privileged roles, and critical operations.
- Penetration testingAll pentestsEvery offchain engagement, and how Guardian runs them.
Start now