DeFi - earn, lend & borrow
Put the USDC in your smart wallet to work without leaving XDC AI. You (or your agent) can supply USDC to earn yield, withdraw it, borrow against collateral, or repay a loan - all from your own smart wallet, all gasless.
The key safety rule: an agent can only propose a DeFi action, never execute it. Every fund-moving action is decoded and shown to you in the browser, and only your wallet signature makes it happen.
DeFi runs on your smart wallet (a Safe you own). If you have not set one up yet, do it first on the Spending limits tab, then move USDC into it. DeFi actions spend the USDC held in the smart wallet.
Supported protocols
| Protocol | Actions | Notes |
|---|---|---|
| Fathom Lending | supply, withdraw, borrow, repay | Aave-style pool. The default. |
| PrimeFi | supply, withdraw, borrow, repay | Aave V2 style pool. |
| Morpho (XDC Yield Network) | supply, withdraw | ERC-4626 yield vault. |
| Silo v3 (9Summits USDC) | supply, withdraw | ERC-4626 market. |
All actions are on XDC mainnet and priced in USDC.
How it works
- Propose. You ask your agent to supply/withdraw/borrow/repay. The agent calls the
defi_lend(ordefi_supply) tool, which records the intent and returns an approval link - nothing moves yet. - Review. You open the link (
xdcai.tech/approve?defi=...) and log in. The page shows the decoded action: the from wallet, the verified contract, the exact state changes (approve + supply, for example), the live APR for a supply, and for a borrow the health factor and how much XDC gets locked as collateral. - Two-factor. DeFi signing always requires two-factor verification. You enter your 6-digit code, then sign.
- Sign. You sign once with your own wallet key. The smart wallet executes the batch directly. Gas is sponsored - you pay no native XDC.
:::warning Approval links expire in 5 minutes An approval link is only valid for 5 minutes after the agent creates it. If it expires, ask the agent to propose the action again - a fresh link is issued instantly. This keeps a stale link from being signed later. :::
Borrow needs collateral
Borrowing on Fathom/PrimeFi auto-locks XDC from your smart wallet as collateral (wrapped to WXDC) and bundles deposit-collateral + borrow into one signature. You need enough native XDC in the smart wallet; the exact amount locked and the resulting health factor are shown before you sign.
For agents
The MCP connector (https://api.xdcai.tech/mcp) exposes these tools. They propose or read only - they never move funds on their own.
| Tool | What it does |
|---|---|
defi_lend | Propose supply / withdraw / borrow / repay. Params: amountUSDC, operation (supply|withdraw|borrow|repay), protocol (fathom default, primefi, morpho, silo). Returns approveUrl. |
defi_supply | Shortcut for operation: "supply". Params: amountUSDC, protocol. Returns approveUrl. |
defi_positions | Read-only. Returns the user's current supplied balances + total USD across Fathom, Morpho, Silo, and anything DeBank indexes. |
After a propose call, give the user the returned approveUrl and tell them to open, review, and sign it. Do not claim the action is done - it only settles after they sign. Use defi_positions afterward to confirm the new balance.
Example prompts
Share these with users, or use them directly:
- "Supply 25 USDC on Fathom to earn yield."
- "Deposit 100 USDC into the Morpho vault."
- "What are my DeFi positions and how much am I earning?"
- "Withdraw 50 USDC from Silo."
- "Borrow 10 USDC on Fathom against my XDC." (shows the health factor before you sign)
- "Repay 10 USDC on my Fathom loan."
A typical agent reply is: "I've proposed supplying 25 USDC to Fathom Lending. Open this link to review and sign it: https://xdcai.tech/approve?defi=... (valid for 5 minutes). Nothing moves until you approve."
In the browser
On xdcai.tech/account, the DeFi tab shows your positions and lets you supply or withdraw directly with the same review-and-sign screen - no agent required.