Build a DeFi lending agent in 30 minutes

Use the Syenite MCP server to give an AI agent real-time DeFi lending data: rates, risk, and position health. No API key. Tools return on-chain data from Aave v3, Morpho Blue, and Spark on Ethereum.

Prerequisites

Cursor or Claude Desktop with MCP enabled. Add https://syenite.ai/mcp as the Syenite server URL. If you have not done that, follow Quick start: first tool call in 5 minutes first.

Step 1: Discover tools with syenite.help

Call syenite.help (no parameters). The response lists all tools, supported chains, yield sources, and rate limits. Use this so the agent knows which tools exist.

Step 2: Query lending rates

Use lending.rates.query to get borrow and supply rates.

Parameters:

Example prompt: "What are the current USDC borrow rates for wBTC on Aave, Morpho, and Spark?" The agent calls lending.rates.query with collateral: "wBTC", borrowAsset: "USDC" and returns a table of protocols and rates.

Step 3: Assess risk for a proposed position

Use lending.risk.assess before opening a position. Parameters:

Example: "Assess risk for borrowing 50,000 USDC against 1 wBTC at 75% LTV on Morpho." The agent calls lending.risk.assess and returns risk score, liquidation price, and protocol risk.

Step 4: Monitor an existing position

Use lending.position.monitor for any Ethereum address with a lending position.

Parameters:

The tool returns health factor, LTV, liquidation distance, and estimated annual cost. Example prompt: "Check the health of my lending position at 0x…"

Syenite never holds private keys. All tools are read-only except swap execution, which returns unsigned transactions for you to sign. Rate limit: 30 requests per minute per IP.

Putting it together

Give the agent a single prompt that chains the workflow: "I want to borrow USDC against wBTC. Show me current rates on Aave, Morpho, and Spark. Then assess risk for 1 wBTC at 70% LTV and recommend a protocol." The agent will call lending.rates.query, then lending.risk.assess, and summarize.

Next steps

Compare DeFi lending rates and assess risk goes deeper on the lending workflow. Find and assess yield opportunities covers yield.opportunities and yield.assess. Cross-chain swap and bridge covers swap.quote and swap.status.