List and filter DeFi markets available through the Trails earn system
Documentation Index
Fetch the complete documentation index at: https://docs.trails.build/llms.txt
Use this file to discover all available pages before exploring further.
YieldGetMarkets returns DeFi markets available for deposit through Trails, including lending markets (Aave, Morpho) and yield vaults (Yearn, ERC-4626). Use this to power market selection UIs or discover marketId values for composable actions.
The SDK’s useEarnMarkets hook wraps this endpoint with typed filters and caching — prefer it in React apps.
| Field | Type | Description |
|---|---|---|
provider | string | Filter by protocol (e.g. "aave", "morpho", "yearn") |
chainId | string | Filter by chain ID (e.g. "8453" for Base) |
type | string | Market category: "lending" or "vault" |
search | string | Free-text search over market names and tokens |
sort | string | Sort order (e.g. "rewardRateDesc") |
limit | number | Number of results to return |
offset | number | Pagination offset |
payload containing an array of market objects. Each market includes:
| Field | Description |
|---|---|
id | Unique market ID — pass this to lend() or deposit() composable actions |
providerId | Protocol identifier (e.g. "aave", "morpho") |
rewardRate | Current APY as a decimal (e.g. 0.045 = 4.5%) |
statistics.tvlUsd | Total value locked in USD |
metadata.name | Human-readable market name |
metadata.token | Underlying token info (symbol, address, decimals) |
useEarnMarkets hook instead of calling this endpoint directly:
Filter by protocol ID (e.g. "aave", "morpho", "yearn")
Filter by chain ID as a string (e.g. "8453" for Base)
Market category: "lending" or "vault"
Free-text search over market names and tokens
Sort order (e.g. "rewardRateDesc")
Number of results to return
Pagination offset
OK
JSON array of market objects from the yield provider