defi-liquidation-monitor
npx machina-cli add skill auralshin/agent-skills/defi-liquidation-monitor --openclawDeFi Liquidation Monitor
Purpose
Track wallet or protocol positions that can be liquidated, estimate distance-to-liquidation, and rank urgent mitigation actions.
Use this skill when
- The user asks for liquidation watchlists.
- The user wants stress tests for collateral price drops.
- The user needs priority ranking for risky borrow positions.
Workflow
- Collect normalized borrow position data (collateral USD, debt USD, liquidation threshold, health factor if available).
- Compute liquidation metrics using
references/formulas.md. - Classify severity bands from
references/alert-bands.md. - Run stress scenarios (for example: -5%, -10%, -20% collateral move).
- Return ranked watchlist with recommended actions.
Required output format
{
"snapshot_time": "ISO-8601",
"positions": [
{
"position_id": "string",
"protocol": "string",
"chain": "string",
"collateral_usd": 0,
"debt_usd": 0,
"liquidation_threshold": 0,
"health_factor": 0,
"distance_to_liquidation_pct": 0,
"severity": "critical|elevated|watch|ok",
"stress_results": [
{
"collateral_shock_pct": -0.1,
"post_shock_health_factor": 0
}
],
"recommended_action": "string"
}
],
"summary": "2-4 sentence summary"
}
Bundled resources
references/formulas.md: Core lending liquidation formulas.references/alert-bands.md: Severity thresholds.scripts/liquidation_buffer.py: Deterministic stress calculations.assets/watchlist-template.csv: Starter watchlist layout.
Source
git clone https://github.com/auralshin/agent-skills/blob/main/skills/defi-liquidation-monitor/SKILL.mdView on GitHub Overview
DeFi Liquidation Monitor tracks wallet or protocol borrow positions to identify liquidation risk. It estimates distance-to-liquidation and ranks urgent mitigations so you can act fast before liquidations occur, using structured stress tests and a ranked watchlist.
How This Skill Works
The skill collects normalized borrow position data (collateral_usd, debt_usd, liquidation_threshold, health_factor if available), computes liquidation metrics using references/formulas.md, and classifies severity bands from references/alert-bands.md. It then runs stress scenarios (e.g., -5%, -10%, -20% collateral) and returns a ranked watchlist with recommended actions.
When to Use It
- When the user asks for liquidation watchlists for a portfolio or protocol
- When the user wants stress tests for collateral price drops
- When the user needs priority ranking for risky borrow positions
- When evaluating multiple positions across protocols or chains
- When preparing risk reports or dashboards that require ranked actions
Quick Start
- Step 1: Gather normalized borrow position data: collateral_usd, debt_usd, liquidation_threshold, health_factor
- Step 2: Compute metrics using references/formulas.md and classify severities using references/alert-bands.md
- Step 3: Return a ranked watchlist with recommended actions
Best Practices
- Normalize inputs: collateral_usd, debt_usd, liquidation_threshold, health_factor
- Keep data fresh with timestamps and regular updates
- Use standard stress scenarios (-5%, -10%, -20%) to bound risk
- Interpret distance_to_liquidation_pct against severity bands to prioritize actions
- Store results in a watchlist-template.csv for consistency
Example Use Cases
- ETH loan on Aave with 6% distance to liquidation; action: add collateral or repay debt
- BTC-backed loan with 12% distance; after -10% shock, health_factor remains >1.5; action: monitor
- USDC debt backed by diversified assets across Ethereum and Polygon; one position flagged as elevated risk; action: rebalance
- Portfolio stress tests show -5% shocks generally safe, but -20% shocks reveal two critical positions; action: delever
- Generated a watchlist-ready report with ranked actions for a risk governance meeting