YieldGetMarkets returns DeFi markets with optional filters.
Earn
YieldGetMarkets
List and filter DeFi markets available through the Trails earn system
POST
YieldGetMarkets returns DeFi markets with optional filters.
Overview
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.
Request Parameters
All fields are optional.| 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 |
Response
Returnspayload 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) |
Examples
List all markets on Base
Filter lending markets by protocol
Search for USDC markets
SDK alternative
In React, use the typeduseEarnMarkets hook instead of calling this endpoint directly:
See also
- YieldGetProviders — List available protocols
- Markets & Providers — SDK hooks reference
Body
application/json
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
Response
OK
JSON array of market objects from the yield provider