# Aave wstETH/WETH Loop Risk Analyzer

> Check liquidation risk, health factor, net yield and exit costs for Aave V3 wstETH/WETH loops on Ethereum. Analyze a live address or hypothetical position with onchain data and stress scenarios. Read-only; requires Python and an Ethereum archive RPC URL.

Aave wstETH/WETH Loop Risk Analyzer is a paid AI agent skill on Agensi by Mitchell Marfinetz, in Web3 & Crypto. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $19 (one-time purchase)
- Creator: [Mitchell Marfinetz](https://www.agensi.io/creators/mitchell-marfinetz)
- Category: [Web3 & Crypto](https://www.agensi.io/skills/web3-crypto)
- Version: 1.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-02); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/aave-wsteth-weth-loop-risk-analyzer
- Tags: web3, research, trading, aave, ethereum, risk-analysis, defi, lido

## What it does

- Check a live or hypothetical Aave wstETH/WETH loop and verify its health factor against onchain data
- Measure how exchange-rate changes, liquidation-threshold cuts and interest accrual affect liquidation risk
- Calculate net yield on equity, the break-even borrow rate and utilization headroom
- Estimate the cost of unwinding 10%, 25%, 50% or 100% of debt with live Curve quotes
- Run deterministic stress scenarios and label the block, data sources and assumptions behind the results

## Who it's for

- **Aave wstETH/WETH loop users:** Understand liquidation headroom, net carry and exit costs for a supported position. Try: "Check my Aave wstETH/WETH loop at [address]: health factor, liquidation headroom, net yield and unwind costs."
- **DeFi risk researchers:** Inspect deterministic scenarios with explicit onchain inputs and assumptions. Try: "Stress-test a hypothetical Aave wstETH/WETH loop under borrow-rate, exchange-rate and liquidation-threshold shocks."
- **Developers building DeFi analysis workflows:** Use a read-only Python analyzer that produces structured JSON for a compatible agent. Try: "Analyze a supported position and explain the source blocks, calculations and assumptions in the JSON output."

## About this skill

### What it answers

"How risky is this Aave wstETH/WETH loop, and what would push it toward liquidation or negative carry?"

Leveraged wstETH/WETH loops on Aave are not liquidated by a stETH depeg: Aave values wstETH at Lido's exchange rate, and the same ETH/USD feed prices both collateral and debt. They can still fail three ways: a fall in the Lido exchange rate, a governance cut to the eMode liquidation threshold, or debt outgrowing the collateral while the WETH borrow rate is above the staking yield. This skill measures the distance to each.

### What you get

- **Health factor**, recomputed from on-chain balances and parameters and, for a live address, checked against Aave's own `getUserAccountData`. Tested on 12 real positions at 4 mainnet blocks; the largest relative difference was 2.5e-10.
- **Distance to each liquidation path**: the exchange-rate drop and the liquidation-threshold cut that bring HF to 1, and the days until HF reaches 1 from interest accrual at the current rate, at the rate-curve kink and at 100 % utilization.
- **Carry**: net APY on equity, break-even borrow rate and utilization, headroom to the kink.
- **Unwind cost** at 10/25/50/100 % of debt, from a StableSwap model and from live Curve quotes, reported separately from liquidation risk.
- **Stress scenarios**: historical events with inputs read on-chain (Terra, 3AC and FTX in 2022, the August 2024 crash, the July 2025 WETH rate spike, the October 2025 crash), ETH-drop cascades, a rate superspike, a governance shock and a slashing tail.

### How it works

Your agent runs `scripts/analyze.py` with a position address or hypothetical amounts. The script reads Aave, Lido and Curve contracts with `eth_call` at one pinned block through your own RPC endpoint and prints JSON in which every number is tagged `onchain@<block>`, `computed`, `user_input` or `assumption`. The agent then answers in a fixed format: position, health factor and distance to each path, carry, unwind cost, stress scenarios, assumptions.

### Requirements

- Python 3.10+ and numpy (`requirements.txt`)
- `AAVE_LOOP_RPC_URL`: an Ethereum mainnet RPC URL that serves archive state. A free-tier hosted RPC plan worked in testing.

### Safety

Read-only. No signing, no transactions, never asks for a private key or seed phrase. The only network destination is the RPC URL you set, and the script never prints it.

### Limits

- Aave V3 Ethereum core market, pure wstETH/WETH eMode loops only.
- No Monte Carlo VaR; stress scenarios are 30-day deterministic paths, and some stress inputs are documented assumptions.
- Analysis only, not financial advice. It never recommends opening, closing or resizing a position.

## Requires

- Python 3.10+ with numpy
- Ethereum mainnet archive RPC URL
- Python

Set AAVE_LOOP_RPC_URL to your RPC URL before use. If your agent runs commands in a network sandbox, allow that host.

## Known limitations

Requires a Python 3.10 environment and an Ethereum archive RPC URL. Limited to wstETH/WETH eMode positions on Aave V3 Ethereum Mainnet core market only.

## Technical details

Requires Python 3.10+, numpy and an Ethereum mainnet archive RPC endpoint configured as AAVE_LOOP_RPC_URL. A compatible SKILL.md agent must be able to run Python and reach that RPC host. scripts/analyze.py reads Aave, Lido and Curve contracts with eth_call at a pinned block and returns JSON. Scope: Aave V3 Ethereum core market, pure wstETH/WETH eMode loops. Stress paths are deterministic, not Monte Carlo VaR. Read-only: no wallet signing or transactions.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Aave wstETH/WETH Loop Risk Analyzer skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Can a stETH depeg liquidate my wstETH/WETH loop?

Not directly. Aave values wstETH at Lido's exchange rate (stEthPerToken, with a cap on how fast it can rise), and one ETH/USD feed prices both collateral and debt, so a market depeg does not move the health factor. It does lower the position's market value and raise the cost of exiting; the skill reports that as unwind cost, separately from liquidation risk.

### What can push the position below health factor 1?

Three things: a fall in Lido's exchange rate (for example from slashing), an Aave governance cut to the eMode liquidation threshold, or interest accrual while the WETH borrow rate exceeds the staking yield plus the wstETH supply rate. The skill reports the distance to each, including the days to HF = 1 at the current rate, at the rate-curve kink and at 100 % utilization.

### What do I need to run it?

Python 3.10+ with numpy, and AAVE_LOOP_RPC_URL set to an Ethereum mainnet RPC URL that serves archive state. If your agent runs commands in a network sandbox, allow that host. The skill installs nothing, never asks for keys and contacts no other host.

### How accurate is the health factor?

For a live position it is compared with Aave's own getUserAccountData at the same block. On 12 real positions at 4 mainnet blocks between August 2024 and November 2026, the largest relative difference was 2.5e-10. Those runs ship in the examples folder.

### Which positions and markets are out of scope?

Anything other than pure wstETH-collateral / WETH-debt eMode loops on the Aave V3 Ethereum core market: other assets, non-eMode positions, positions mixing other reserves, other chains and other lending markets. The script refuses those instead of guessing.

### Does it give trading advice?

No. It is analysis only. It explains what the numbers mean but never recommends opening, closing or resizing a position.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
