Skip to main content

Documentation Index

Fetch the complete documentation index at: https://yieldxyz.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

What Balances Represent

The Balances API provides a lifecycle-aware view of user positions. Unlike simple token balances, Yield.xyz balances reflect where assets are in the yield lifecycle — active, entering, exiting, or claimable. This enables accurate portfolio UX, operational reporting, and next-action prompts without protocol-specific state management.

Lifecycle States

Active position earning yield
  • Currently staked or deposited
  • Actively earning rewards
  • Can initiate exit at any time
Not all yields use all states. Liquid staking (Lido, Rocket Pool) typically has only available — no cooldowns. Native staking (Cosmos, Polkadot) uses the full lifecycle.

Pending Actions

When a position has actions the user can or must take, the API includes pendingActions:
ActionWhen it appears
CLAIM_REWARDSRewards ready to claim
CLAIM_UNSTAKEDUnbonding complete, funds ready
WITHDRAWVault withdrawal ready to finalize
REDELEGATEValidator change available
Use pendingActions to surface CTAs in your UI — “Claim 0.5 ETH rewards” or “Complete withdrawal”.

Portfolio Endpoints

Two endpoints power position tracking:

Single yield balances

Fetch a user’s position in a specific yield:
GET https://api.yield.xyz/v1/yields/{yieldId}/balances?address=0x...
Returns all balance types for that yield — available, rewards, unstaking, etc. Example:
curl "https://api.yield.xyz/v1/yields/ethereum-eth-lido-staking/balances?address=0x1234..." \
  -H "x-api-key: 9a4ed..."

Aggregate balances

Fetch positions across multiple yields and networks in one request:
POST https://api.yield.xyz/v1/yields/balances
Request body:
{
  "addresses": [
    { "address": "0x1234...", "network": "ethereum" },
    { "address": "cosmos1abc...", "network": "cosmos" }
  ]
}
Example:
curl -X POST "https://api.yield.xyz/v1/yields/balances" \
  -H "x-api-key: 9a4ed..." \
  -H "Content-Type: application/json" \
  -d '{
    "addresses": [
      { "address": "0x1234...", "network": "ethereum" },
      { "address": "cosmos1abc...", "network": "cosmos" }
    ]
  }'
Use the aggregate endpoint to power portfolio dashboards. One request covers all networks and yields.

Position Origins

Balances may reflect positions created through Yield.xyz or positions that existed before integration.
Positions created via Yield.xyz actions.
  • Full lifecycle tracking from entry
  • Reward accrual data from entry date
  • Included in baseline DataKit

Balance Response Structure

Each balance includes:
FieldDescription
typeLifecycle state (available, rewards, unstaking, etc.)
amountToken amount in human-readable format
tokenToken metadata (symbol, decimals, address)
pricePerShareFor yield-bearing tokens (stETH, aUSDC)
dateTimestamp of the balance snapshot
pendingActionsAvailable management actions

Common Patterns

Use aggregate balances to display all positions across networks. Group by network or yield type for clean UX.
Filter for type: rewards with amount > 0 to highlight claimable rewards.
Check type: unstaking or type: unlocked to show in-progress and completed exits.
Use unlockDate (where available) to display remaining unbonding time.

API Reference

Yield Balances

GET /v1/yields//balances

Aggregate Balances

POST /v1/yields/balances

Next Steps

Fees

Understand fee structures and monetization

Tracking Balances Guide

Detailed implementation patterns