aave-integration

Integration guidance for Aave V3, a blockchain lending system where users can supply assets, earn interest, borrow, repay, and use flash loans.

In plain words
What is it for?
It helps developers build supply, withdrawal, borrowing, repayment, flash-loan, interest-mode, collateral, and related Aave integrations.
Why use it?
It explains the contracts and safety patterns needed to connect software to Aave markets instead of treating the protocol as a black box.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ccashwell/evm-cortex/aave-integration
Any agent
npx skills add ccashwell/evm-cortex --skill aave-integration
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

Made for: Claude Code, Codex.

Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00052 $0.01220
Opus 5 $0.00026 $0.00610
Sonnet 5 $0.00010 $0.00244
Haiku 4.5 $0.00005 $0.00122

Measured 3d ago against content hash be2f67cf4179, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

aave-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/aave-integration/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Aave V3 Integration Patterns

Core Contracts

Contract Purpose
Pool Entry point for supply, borrow, repay, withdraw, flash loans
PoolAddressesProvider Registry for Pool and related contracts
AToken Yield-bearing receipt token (rebasing balance)
VariableDebtToken Tracks variable-rate debt
StableDebtToken Tracks stable-rate debt (deprecated in most markets)
PriceOracle Asset price feed aggregator

Supply / Withdraw

import {IPool} from "@aave/v3-core/contracts/interfaces/IPool.sol";

IPool pool = IPool(addressesProvider.getPool());

// Supply: approve first, then supply
IERC20(asset).approve(address(pool), amount);
pool.supply(asset, amount, onBehalfOf, referralCode);

// Withdraw: burns aTokens, returns underlying
pool.withdraw(asset, amount, to);
// Use type(uint256).max to withdraw entire balance

Borrow / Repay

// Borrow: must have sufficient collateral
// interestRateMode: 1 = stable (deprecated), 2 = variable
pool.borrow(asset, amount, 2, referralCode, onBehalfOf);

// Repay: approve first
IERC20(asset).approve(address(pool), amount);
pool.repay(asset, amount, 2, onBehalfOf);
// Use type(uint256).max to repay full debt

Flash Loans (0.05% Fee)

import {IFlashLoanSimpleReceiver} from
    "@aave/v3-core/contracts/flashloan/base/FlashLoanSimpleReceiver.sol";

contract MyFlashLoan is FlashLoanSimpleReceiver {
    constructor(IPoolAddressesProvider provider)
        FlashLoanSimpleReceiver(provider) {}

    function executeOperation(
        address asset,
        uint256 amount,
        uint256 premium,   // 0.05% of amount
        address initiator,
        bytes calldata params
    ) external override returns (bool) {
        require(msg.sender == address(POOL), "unauthorized");
        require(initiator == address(this), "untrusted initiator");

        // Your logic here — you have `amount` of `asset`
        _doArbitrage(asset, amount, params);

        // Repay: amount + premium
        uint256 amountOwed = amount + premium;
        IERC20(asset).approve(address(POOL), amountOwed);
        return true;
    }

    function requestFlashLoan(address asset, uint256 amount) external {
        POOL.flashLoanSimple(address(this), asset, amount, "", 0);
    }
}

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 162 lines · 52 tokens per session scan A be2f67cf4179

Subscribe to this mod's changes

aave-integration is a skill published in the GitHub repository ccashwell/evm-cortex (127 stars, last pushed 23d ago), licensed MIT. It adds 52 tokens to every session and 1,220 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.