---
name: fathom-lending
description: Fathom Lending on XDC. Read markets and positions, simulate health factor, prepare unsigned supply/withdraw/borrow/repay. User must sign approveUrl. Never claim a tx is done until they sign.
---

# Fathom Lending

Aave-style pool on XDC mainnet (chain 50).

MCP: `POST https://lending-mcp.fathom.fi/mcp`  
REST: `POST https://lending-mcp.fathom.fi/api/tools/{tool}`  
Dapp: `/llms.txt`, `/lending/agent.md`, `/#/lending/agent`

## Tools

| Tool | Args | Use |
|---|---|---|
| `lending_markets` | — | APY, liquidity, LTV, close-only / frozen flags |
| `lending_position` | `user` | Supplies, borrows, HF (`null` = no debt). Any 0x. |
| `lending_simulate` | `user`, `action`, `asset`, `amount` | Health before/after. No tx. |
| `lending_prepare` | same | `approveUrl` (5 min) + unsigned txs. User signs. |

`action`: `supply` | `withdraw` | `borrow` | `repay`  
`asset`: symbol or 0x. `XDC` = native gateway. `WXDC` = wrapped.  
`amount`: `"25.5"` or `"max"` (withdraw/repay).

Example: `{"user":"0x…","action":"supply","asset":"USDC","amount":"25"}`

## Rules

1. Call `lending_markets` if the asset is unclear; `lending_position` before borrow/withdraw/repay.
2. After prepare, send `approveUrl`. Same wallet. Do not say funds moved.
3. Open: XDC, WXDC, USDC. Close-only: FXD, xUSDT, FTHM. Frozen: CGO.
4. Borrow needs collateral. Rejected if HF < 1.5.
5. If the link expires, prepare again.
