Summary
LlamaRisk is building Aave’s Risk Layer: automated risk solutions that make expert risk judgment verifiable, with every parameter, bound and action checkable onchain. The Aave Risk Framework set this direction in June by making continuous risk oracles part of the protocol’s standing infrastructure. Governance and manual review can trail a fast-moving event by hours, and the evolution of AI capabilities keeps shortening the time between finding a weakness and exploiting it, so protection has to run continuously and at machine speed. LlamaGuard PT went live in September as the first of these solutions. We continue the rollout with LlamaGuard Caps as the next addition.
Aave’s greatest strength is its liquidity, deep enough to move capital instantly and at scale. Defending access to that liquidity programmatically protects Aave’s users, even when a failure elsewhere in DeFi puts compromised collateral or stolen assets in play. LlamaGuard Caps hardens Aave’s perimeter. Its first stage, a borrow rate limiter for Aave V3, gives each reserve a margin of borrowing room above its debt, sized to the reserve. That room refills automatically as organic demand uses it and is cut back when large repayments open up more than the reserve needs. Everyday borrowing keeps instant access to liquidity. A large draw, though, has to wait for each refill, giving the Protocol Guardian reasonable time to respond to illegitimate activity. Integrated institutional clients and other approved large borrowers will have a dedicated pathway that meets their capital demand quickly.
LlamaGuard Caps will run on the Risk Agents stack that Aave Governance already owns. Raises are computed on Chainlink CRE, on the same oracle network that delivers the price feeds Aave relies on, and every bound is enforced onchain. Aave’s core contracts and existing agents stay unchanged, and the new smart contract surface is small. Every lever stays with Aave governance: Risk Stewards and governance continue to set each cap’s maximum, and automation controls only how fast room opens beneath it. This proposal is the first stage of a gradual rollout. Later stages will set the ceiling itself from live liquidity conditions and extend dynamic protection to supply caps, Aave V4 and cross-market modules, each calibrated on live data from the stage before.
Threat model
Two external threats have proved the most consequential for Aave.
- An attacker deposits maliciously obtained collateral that is worth less than the oracle reports, and borrows against it.
- An attacker gains control of many different assets, deposits them as collateral and borrows assets that can’t be frozen, as fast as possible.
In both cases the damage starts outside Aave, with a compromised asset or a compromised holder. Aave is affected because its deep, instant liquidity is what the attacker needs to turn that position into assets that can leave. Aave can’t prevent these events. It can control how quickly its liquidity is drawn once one is under way, and so how much time the Protocol Guardian has to investigate and respond.
Exposure under static caps
Borrow caps on Aave are set by the Risk Stewards or through governance AIPs. Each change is generated programmatically but still needs human approval, through the Risk Steward multisig or a governance vote, and must wait out a minimum delay before the next one. A cap therefore has to hold enough room for the growth expected before its next revision. That headroom is open by design. Over the year from October 2025 to October 2026, standing borrow headroom averaged 41.1% of debt on Core WETH, 75.3% on Core USDT and 76.7% on Core USDC, and exceeded 100% on Plasma USDT0 and Arbitrum WETH. This headroom is available to any borrower at any time, including one holding stolen or unbacked collateral, so a static cap limits the total that can be borrowed but places no limit on the pace at which it is borrowed.
In the largest malicious draws of the period, tens of millions of dollars of WETH were borrowed on Ethereum Core within minutes, alongside a parallel draw on Arbitrum, and each draw completed at full size before an emergency response took effect.
Characteristics of organic demand
A rate limit is only viable if it accommodates legitimate demand, which on Aave varies widely in both size and timing.
Reserve sizes span three orders of magnitude, from about $2M of debt on Mantle USDT0 early in the year to several billion on the Core stablecoins. A buffer that leaves comfortable room on a $10M reserve would be negligible on a $3B one, while a buffer sized for Core would leave a small reserve effectively unconstrained, so the buffer has to scale with the reserve.
Organic demand also arrives in bursts. Measured as the largest amount borrowed within any 60-minute window of each day, Core USDT exceeded $25M on 84 days of the year and $50M on 32, Core USDC on 67 and 28 days, and Core WETH on 69 and 24, so refills on the largest reserves have to keep pace with bursts of this size.
Individual borrows can be very large as well. Over the year, Core USDT recorded 78 transactions borrowing $25M or more, Core WETH 68 and Core USDC 49, with the largest at $190M. A significant share of these comes from integrated institutional clients and large loopers, whose flows resemble an attack in size (not in intent) and who typically want to enter the market and position themselves without delay. Continuing to serve these users with minimal friction remains a priority, which requires a pathway that accommodates them without reopening the room that the rate limit closes for everyone else.
Goals
The first stage of LlamaGuard Caps is designed to bound how quickly debt on any reserve can grow, so that a toxic flow is limited both in size and in speed, while leaving normal borrowing and the growth of the protocol largely unaffected. Borrowing room is refilled automatically as organic demand uses it, and integrated institutional clients and other known large borrowers retain a safe and predictable pathway to borrow at the size they need.
The same rule is meant to serve every Aave V3 instance, from reserves with a few million dollars of debt to Core reserves with several billion, and to operate on every reserve at all times, so that protection does not depend on recognising an attack while it is under way. These properties are delivered on the Risk Agents stack that Aave Governance already owns, with computation on Chainlink CRE and every bound enforced onchain. This also means that the functionality of the system can be extended flexibly, adding additional safeguards and modules on top of the initial implementation.
Design
LlamaGuard Caps relies on two agents that act on the same borrow cap. The Raise agent adds borrowing room as organic demand uses it, and the Cut agent removes room that repayments and liquidations reopen beyond what the reserve needs. Each agent can move the cap in one direction only as enforced onchain, and both work toward the same target, a cap that sits one buffer above the current debt of the reserve.
Rules
The buffer L is a share \alpha of the reserve’s debt D, bounded by a floor L_{\min} and a ceiling L_{\max}, so that it grows with the reserve while the amount that can be drawn in a single step remains limited on the largest markets. Both agents target the same cap,
and the cap written onchain never exceeds the hard maximum \bar C (set by the Risk Stewards or governance as enforced by existing risk methodologies), nor the current supply cap S,
A borrow of x succeeds if D + x \le C^{\text{eff}}. Otherwise, the borrower waits for the next top-up, splits the borrow or uses one of the pathways described below.
The Raise agent tops up the cap once borrowing has used most of the buffer. If the free headroom B = C - D was at or below a trigger share \theta of the buffer one delay \tau earlier, the cap is reset to D + L, and no two top-ups on a reserve are closer than \tau. The delay converts the cap from a limit on size into a limit on pace, since a borrower who exhausts the buffer must wait before further room opens. The Cut agent acts in the opposite case. When a repayment or liquidation leaves headroom more than a band \delta above the buffer, it returns the cap to D + L within one or two blocks, so that repaid room does not accumulate as open capacity, while smaller repayments leave the cap unchanged and the repaid amount available to borrow again.
| Agent | Condition | Action | Timing |
|---|---|---|---|
| Raise agent | headroom one delay earlier was B \le \theta L | C \leftarrow D + L(D) | at least \tau after the previous top-up |
| Cut agent | B > (1+\delta)L after a repayment or liquidation | C \leftarrow D + L(D) | within one or two blocks |
Starting from a full buffer, the debt of one reserve can therefore rise by L at once and by one further L per top-up. Within T of the first borrow, after a period in which headroom stayed above \theta L, the most one reserve can grow is
If headroom was already at or below \theta L one delay before a draw, a top-up is due as the draw starts and the reserve can receive two buffers in quick succession. The bound then becomes (2+\delta)L + L\lfloor T/\tau \rfloor, which is also the worst case the on-chain checks allow should the raise workflow misbehave.
Pathways for large borrowers and institutional clients
The main trade-off of a rate limit falls on large and persistent borrowers who want to enter the market and position themselves immediately, with sizes well above the buffer that suits the median user. Sizing the buffer to their needs would leave the same room open to an attacker, so the buffer stays at the scale of typical demand, and known large borrowers, including integrated institutional clients, still keep dedicated pathways through which the Risk Stewards can open exactly the room a borrow needs in the transaction that uses it, without defeating the purpose of a rate limit.
- Split across top-ups. By default, a borrow larger than the buffer is split across top-ups with no action required from governance, so a borrow of three buffers is admitted as one buffer immediately and the remainder over the next two top-ups.
- Atomic batch. Known large borrowers that cannot wait, including integrated institutional clients, can be served through a batch executed by the Risk Stewards, in which the cap is raised by the exact amount of the borrow and the new room is consumed in the same transaction.
- Hold. For new onboardings and periods of genuine sustained demand, in which the cap itself would otherwise bind, the Risk Stewards can raise the cap together with a hold of limited duration, during which the Cut agent leaves the raised cap in place. Holds are scheduled only in these cases, since a hold leaves the raised room open to any user for its duration.
Flash loans repaid within the same transaction do not count against the borrow cap, so refinancing and collateral swaps that close within one transaction are unaffected. Atomic leverage loops continue to work as long as the debt opened in one transaction fits under the headroom, and known large loopers can use the atomic batch.
Large suppliers remain unaffected at this stage. Supply caps keep their current configuration and deposits of any size continue to enter as they do today, limited by the general risk exposure caps where applicable.
Architecture & roles
Both agents reuse the AaveBorrowCapAgent code on the Risk Agents stack that Aave Governance already owns, and Aave’s core contracts, AgentHub, the RiskOracle and the Router remain unchanged. The system adds four contracts, a Chainlink CRE workflow and a keeper. The audit will cover the four new contracts and the raise workflow. Each raise is delivered as a signed report through Chainlink’s forwarder and the Router to the RiskOracle, and AgentHub executes it through the Raise agent. A cut is computed onchain from live Aave state.
| Component | Status | Role | Bounded by |
|---|---|---|---|
| Raise workflow | new CRE workflow | computes and signs raises | module rule, AgentHub \tau |
| Keeper | planned offchain service | triggers due cuts | module rule; the only caller the Cut agent accepts |
| CapsRangeValidationModuleV3 | new contract | checks every agent raise and cut | Executor-set limits |
| CapsReducerOracle | new contract | adminless view returning the cut the module accepts | module re-check at execution |
| CapsParameterRegistry | new contract | trigger, margin (a deduction from D + L or S that absorbs small repayments), asset lists and switches | read offchain only; module rule |
| CapsBorrowForwarder | new contract | atomic cap raise and borrow for the Risk Council Safe | Risk Steward limits, \bar C |
| Raise agent, Cut agent | existing AaveBorrowCapAgent code, one deployment per Pool, the only new holder of the Pool’s RISK_ADMIN role |
write caps through AgentHub; one registration raises, the other cuts | module rule, AgentHub \tau |
| Aave core, AgentHub, RiskOracle, Router | existing, no code change | one raise route for this workflow, with Router step and delay limits disabled as the module bounds each raise, and two registrations | unchanged |
A raise from the Raise agent requires at least \tau since that agent’s previous raise on the reserve, a reserve neither frozen nor paused, and a new cap above the current one and at most \min(D + L,\ \bar C,\ S) in the executing block. The module does not check the trigger. Whatever the workflow signs, each raise stays within one buffer above live debt, at most once per \tau. AgentHub enforces \tau, and the AIP registers one Raise and one Cut agent per Pool with the Protocol Guardian as agent admin. Cuts are executed by the keeper, and the agent admin can add other callers later. The module computes each cut onchain from live Aave state and accepts it only within the band. A cut can only lower a cap, and low caps block only new borrows.
Both checks run in CapsRangeValidationModuleV3, which plugs into the unchanged agent and applies one rule to raises and cuts, evaluated against live Aave state in the executing block. With the standard module, which checks only step size, the offchain workflow would be trusted for the size of every raise. Here the workflow proposes a value and the module decides whether it may be written. A rejected update is skipped without reverting, so it cannot block other markets. Cuts continue during a freeze or pause.
| Role | Holder | Can do |
|---|---|---|
| Owner | Aave Executor | lists assets, sets Risk Council limits |
| Risk Council | Risk Council Safe (Aave Labs and LlamaRisk) | tunes parameters within limits, holds off cuts, runs large-borrower batches |
| Agent admin | Protocol Guardian | disables agents, sets \tau, sets which callers can trigger cuts |
| Operator | LlamaRisk Safe | runs the workflow and Router, sets trigger and margin |
| Cut trigger | Keeper, set by the agent admin | executes due cuts |
Manual cap changes by the Risk Stewards and governance still apply. A raise can undo a manual decrease unless \bar C falls with it, and a cut can undo a manual increase unless a hold is active.
Each part of the system can be switched off on its own. Disabling the Router route stops raise reports, the registry switch stops the workflow for a single asset, and the Protocol Guardian can disable either agent. Governance or the Risk Council Safe can retire an asset, which stops both agents and returns its cap entirely to the Risk Stewards and governance. A freeze or pause always takes precedence over raises. Switching off leaves each cap where it is, and if only one agent is disabled, the other keeps moving the cap in its own direction.
Parameters
The behaviour of both agents is governed by a small set of parameters, set per market and reserve, except \tau, which AgentHub enforces per Pool.
| Symbol | Meaning | Enforced by |
|---|---|---|
| \alpha | buffer as a share of debt | module, onchain |
| L_{\min}, L_{\max} | floor and ceiling on the buffer, in tokens | module, onchain |
| \theta | trigger, the share of the buffer still free below which a top-up becomes due | raise workflow |
| \tau | delay before a top-up, and minimum time between two top-ups on a reserve | AgentHub onchain per Pool; the workflow can set a longer delay per reserve |
| \delta | band above the buffer beyond which a repayment or liquidation leads to a cut | module, onchain |
| \bar C | hard maximum per market and asset, set by the Risk Stewards or an AIP | module, onchain |
The parameters can be recalibrated by governance and by the Risk Stewards within bounds that only governance can change, so that each value can follow live data once the system is in operation. The indicative values discussed below will be tuned to each market and shared with the community before deployment.
LlamaGuard Caps in Practice
The walkthrough follows both agents over two and a half hours on a reserve with $100M of debt, using indicative values of a buffer of 10% of debt, a trigger at a fifth of the buffer, a 30-minute delay and a 10% band. The right panel shows how the buffer scales with debt across eight large reserves at today’s debt.
- The reserve starts with a cap $10M above debt. A borrower draws $8.5M, leaving $1.5M of headroom against a buffer that is now $10.85M at the higher debt. That is less than a fifth of the buffer, so a top-up becomes due 30 minutes later.
- While it waits, another borrower submits a $5M borrow. The borrower can borrow $1.5M now and the remaining amount after the top up.
- At the top-up, the Raise agent resets the cap to one buffer above debt. Because debt has grown, the buffer is now $11M.
- A $1M repayment leaves headroom within 1.1 times the buffer. The cap remains unchanged, and the repaid amount can be borrowed again.
- A $12M repayment leaves headroom well above that band, and the Cut agent lowers the cap to one buffer above debt within one or two blocks.
- A known large borrower needs $25M at once. Through an atomic batch, the cap is raised and the borrow executed in the same transaction, so cap and debt rise together and the headroom is unchanged.
- Later borrowing depletes the headroom again. The next top-up would take the cap to $146.9M, but the hard maximum is $140M, so the cap holds there until governance raises the maximum.
Calibration
Each parameter balances protection against friction for organic users. The calibration rests on a minute-by-minute replay of the year from 15 October 2025 to 15 October 2026 across the V3 reserves. The indicative parameters used are (see parameter table above): a buffer as a fraction of debt, \alpha, of 10%, a floor and ceiling on the buffer of $1M and $25M, respectively, a trigger at 20% of the buffer, a 30-minute delay and a 10% band. These values are indicative and will be tuned to each market and reserve.
Length of the delay. The delay determines how many top-ups an attacker can collect before an emergency response takes effect. In the replayed draws of past incidents, a 30-minute delay would have admitted one or two top-ups before the response, and a 60-minute delay one fewer. A 60-minute delay would, however, more than double the hours in which a Core borrower had to wait, and a borrower splitting $100M into four borrows would reach the full amount after more than three hours instead of about one and a half. Where a response lands within about 30 minutes, neither delay admits a top-up, so the longer delay adds cost without additional protection. The indicative minimum interval is therefore 30 minutes, which can be extended on specific markets without a contract change.
Band for cuts. Cutting the cap on every repayment ensures the cap is never more than one buffer above debt, but would require between 39,000 and 89,000 cap writes a year on each Core reserve. Cutting only once headroom exceeds the buffer by more than \delta, at an indicative 10%, reduces writes to between 1,400 and 2,100 a year and blocked hours by 35% to 48%, at the cost of allowing up to $2.5M of repaid room on a $25M buffer to be borrowed again.
Size of each top-up. A refill that shrinks after heavy borrowing would slow a sustained draw further, but it would add heavy friction on small reserves, particularly around new listings, where borrowing grows quickly from a low base and repeatedly exhausts a buffer at its floor. Each top-up therefore restores one full buffer, and sustained draws are bounded by the delay and the hard maximum.
Friction for organic borrowers
The cost to borrowers concentrates on the three Core reserves, where an indicative $25M ceiling binds throughout the year. The figures below use the indicative values and the stricter variant that cuts on every repayment, so they overstate the cost of a band.
| Reserve | Avg L | Hours blocked per year | Longest queue | Top-ups per year | Avg headroom, LlamaGuard Caps | Avg headroom, current caps |
|---|---|---|---|---|---|---|
| Core WETH | 25.0M | 162 | 6.7 h | 642 | 0.44% | 41.1% |
| Core USDT | 25.0M | 217 | 9.3 h | 1,115 | 0.56% | 75.3% |
| Core USDC | 25.0M | 137 | 4.3 h | 891 | 0.61% | 76.7% |
| Plasma USDT0 | 25.0M | 57 | 4.1 h | 300 | 1.65% | 146.9% |
| Monad USDC | 4.1M | 19 | 2.1 h | 99 | 6.43% | 64.4% |
| Base USDC | 20.1M | 79 | 0.5 h | 713 | 5.46% | 58.1% |
| Mantle USDT0 | 11.8M | 23 | 12.9 h | 97 | 7.81% | 83.0% |
| Arbitrum WETH | 19.5M | 3.1 | 1.6 h | 51 | 4.84% | 110.9% |
Hours blocked measures the time at least one borrower would have been waiting in the queue. On Core, most of these hours come from bursts that exhaust the buffer and wait out the 30-minute delay, and a large part of that demand could be served through the pathways described above. On the smaller reserves the buffer tracks the size of the reserve, and waits were short and rare.
Containment of malicious draws
The same indicative values, applied to the largest malicious draws of the period and starting from a full $25M buffer, give the following.
| Incident | Reserve | Draw | Admitted within 30 minutes | Admitted within 1 hour | Full draw admitted after |
|---|---|---|---|---|---|
| rsETH, 18 April 2026 | Core WETH | $123M | $25M | $50M | 2 h 2 min to 2 h 26 min, after four top-ups |
| rsETH, 18 April 2026 | Arbitrum WETH | $70M | $25M | $50M | 1 h 1 min to 1 h 13 min, after two top-ups |
| Binance Exploit, 29 October 2026 | Core WETH | $44.6M | $25M | $44.6M | 31 to 36 min, after one top-up |
Larger draws take proportionally longer to complete, and organic borrowing earlier in the day would have reduced the buffer available to an attacker and extended these times further.
Staged rollout
Borrow caps on Aave V3 form the first stage, since borrowing is the surface through which value leaves the protocol in both attack vectors, making it the easiest pathway to narrow. The functional components of this first stage and their code have been aligned with Aave’s SPs and have entered audits. Further details will be shared with the community once the system is ready for deployment.
Later stages would extend dynamic protection to further surfaces of Aave, including supply caps, Aave V4 and further cross-market aware modules, reusing the contracts, workflow and reducer introduced here. Each stage will be sequenced and calibrated on the operational experience, and brought to the community when ready.
Next Steps
- Gather feedback from the community.
- If consensus is reached on this ARFC, escalate this proposal to the Snapshot stage.
- If the Snapshot outcome is YAE, escalate this proposal to the AIP stage.
Disclaimer
This proposal was independently prepared by LlamaRisk. LlamaRisk develops and operates LlamaGuard, the product family this proposal would deploy on Aave. LlamaRisk received no compensation from Aave or from any protocol named in it for preparing this document. LlamaRisk is a DeFi risk-advisory and risk-infrastructure provider. It is not a custodian, broker, dealer, exchange, investment manager, or auditor. The information provided should not be construed as an endorsement of the proposal or of LlamaRisk by Aave Governance, the Risk Stewards, Chainlink Labs, or Chainlink.
Nothing here is legal, financial, tax, regulatory, or investment advice. Nothing is a recommendation for any reader to supply to, borrow from, use, or avoid Aave or any other protocol or asset. The analysis addresses protocol design in general; it is not tailored to any reader’s circumstances. Readers should conduct their own research and consult qualified advisers before acting.
A rate limit reduces how quickly liquidity can leave a protocol. It does not prevent, detect, or fully contain an exploit, a drain, an oracle failure, or a governance attack. No configuration of borrow caps removes smart-contract, oracle, liquidity, depeg, or total-loss risk. References to audited code describe audits completed at a point in time against the versions reviewed. Audits reduce but do not eliminate risk.
To the maximum extent permitted by law, this document and the materials and outputs it describes are provided “AS IS” and “AS AVAILABLE”, without warranties of any kind, express or implied, including as to accuracy, completeness, timeliness, availability, security, or fitness for a particular purpose. No LlamaRisk party is liable, to the maximum extent permitted by law, for any loss or damage, direct or consequential, arising from use of or reliance on this document, any implementation of it, or any LlamaGuard output. LlamaRisk’s public LlamaGuard disclaimer at https://www.llamarisk.com/llamaguard governs the position of parties outside any signed services agreement. It prevails over anything inconsistent here.








