Fetch a wallet’s earn balances across chains and yield positions
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.
YieldGetAggregateBalances returns a wallet’s active yield positions across one or more chains. Use this to show users their current DeFi holdings — principal, earned yield, and which markets they are in.
The SDK’s useEarnBalances hook wraps this endpoint — prefer it in React apps.
| Field | Type | Required | Description |
|---|---|---|---|
queries | object[] | Yes | Array of 1–25 balance queries |
| Field | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Wallet address to look up |
network | string | Yes | Network identifier (e.g. "ethereum", "base", "polygon") |
payload containing balance records. Each balance entry includes:
| Field | Description |
|---|---|
yieldId | Market ID — matches the id field from YieldGetMarkets |
address | Wallet address |
network | Network the position is on |
amount | Balance amount in the market’s token |
amountUsd | USD value of the position |
useEarnBalances hook:
yieldId against market IDs