liquidations

Exact captured content · path skills/liquidations/SKILL.md · sha256 e4d09aad31d7a07a… · revision 1a99e5086c3c4c4de95f32b5ff67e31e043aee77

Download the exact captured file

---
name: liquidations
description: >-
  Lists the lending positions on Monad closest to liquidation, read from Chord's own index of every borrower on Aave
  V3, Morpho and Euler V2: account, protocol, debt, collateral, health factor, and a state (liquidatable now, at the
  edge, close, watch). Drops dust by default ($1,000 debt and up), sets bad debt (no collateral left) and rows the
  index stopped re-reading apart, and sums debt at risk per protocol. Filters by protocol, minimum debt, health
  factor and account; can name the token borrowed in each Morpho market or Euler vault. Covers Monad only. Use when
  the user asks "which positions are about to be liquidated", "liquidation risk on Aave Monad", "is this account
  safe", "how much debt is near liquidation". Not for other chains or other lenders, price predictions, or running
  liquidations. Read only; never signs or moves funds.
license: MIT
compatibility: Needs python3 and HTTPS to api.getchord.xyz. Set CHORD_API_KEY (free at chordsi.xyz/me).
metadata:
  author: Chord (getchord.xyz)
  homepage: https://chordsi.xyz/s/liquidations
  version: "1.0.0"
---

# Liquidations

Chord reads the health of every borrower on Monad's three big lenders from its own node every few seconds: Aave V3
(per account), Morpho (per account and market) and Euler V2 (per account and vault). This skill asks for the positions
under a health factor, then sorts them into plain states and leaves out what would mislead: dust, bad debt with nothing
to seize, and rows the index no longer refreshes.

## Run it

```bash
python3 scripts/liquidations.py [monad] [--protocol aave|morpho|euler|all] [--min-debt USD] [--max-hf X] [--account 0x...] [--limit N] [--names]
```

- `--protocol`: aave (Aave V3), morpho, euler (Euler V2) or all (default).
- `--min-debt`: smallest debt in dollars (default 1000; 0 shows the dust too).
- `--max-hf`: highest health factor to list, 0.5 to 2 (default 1.1).
- `--account`: one borrower's positions. `--limit`: rows, 1 to 200 (default 15).
- `--names`: name the token borrowed in each Morpho market and Euler vault (one more call; Aave rows cover the account).

Example: `python3 scripts/liquidations.py --min-debt 10000 --limit 10 --names`

## Read the answer

- `counts`: positions by state, live debt in the list, debt liquidatable now. `cutAtServerLimit`: the API sends at most
  200 rows (lowest health factor first), so there are more above the last one.
- `byProtocol`: per lender, positions, debt, how many are liquidatable now or at the edge.
- `closest`: protocol, account, `market` (Morpho market id or Euler vault; none for Aave), `borrowed` with `--names`,
  `healthFactor`, `debtUsd`, `collateralUsd`, `cushionUsd` (collateral minus debt at market value), `state`, `readAt`,
  explorer link. States: liquidatable now (under 1.00), at the edge (1.00 to 1.02), close (1.02 to 1.05), watch (up to
  `--max-hf`).
- `badDebt`: debt with no collateral left: nothing to liquidate, the lender carries it. Usually dust.
- `notReadRecently`: rows not refreshed for over an hour, left out of the counts (most likely a market the account
  closed while it still borrows elsewhere). Never quote them as live.
- `allBorrowers`: every borrower Chord tracks per lender with total debt, dust included; its "under 1" counts are
  mostly zero-collateral dust.

## How to answer the user

1. Say it is Monad, the lenders covered and the filters, then how much debt sits at the edge and whether anything is
   liquidatable right now.
2. Name the closest positions with health factor, debt and cushion in dollars, and the lender.
3. Add the context: a health factor a hair above 1 is common for leveraged loops of assets that move together (staked
   ETH against ETH, stablecoin against stablecoin); they fail on a depeg, not a normal price move. The feed does not
   name the collateral, so do not predict a liquidation from the health factor alone.
4. Never suggest liquidating, front-running or trading against a position.

## Cost

One call per run, two with `--names`. 300 calls a month are free; then $0.006 a call from your ChordSI credit. If the
script exits with code 4, show the person the message: their credit is empty or a limit was reached, and chordsi.xyz/me
is where they top up.

## Chord endpoints it calls

- `GET /v1/liquidations?maxHf=&minDebt=&protocol=` (Monad: Aave V3, Morpho, Euler V2; positions, summary, maxHf, source)
- `GET /v1/defi/opportunities` (only with `--names`, to name markets)