Skip to main content

1. High-Level Evolution


2. Yield Discovery & Metadata


3. Actions & Transaction Workflow

Entering a Yield

Legacy — POST /v1/actions/enter
  • Send payload with nested addresses and custom fields.
  • Response: action ID + list of transaction IDs.
  • For each ID call PATCH /v1/transactions/{id} to fetch unsigned tx.
  • Sign, broadcast, then submit hash per transaction.
New — POST /v1/actions/enter Payload structure:
Response → one ActionDto containing every TransactionDto in order, fully populated and annotated. Sign, broadcast, then PUT /v1/transactions/{transactionId}/submit-hash to report each hash. No extra construct calls.

Exiting / Unstaking

  • LegacyPOST /v1/actions/exit followed by per-transaction construct calls.
  • New — Same endpoint path, same one-shot transaction return pattern.

Manage Actions (claims, restakes, redelegations)


4. Balances

Each balance payload directly includes any passthrough strings required for future manage calls.

5. Before / After Quick Reference


6. Additional Notable Changes

  • Hostname has moved from api.stakek.it to api.yield.xyz.
  • Terminology: integrationIdyieldId; “pending actions” → manage actions.
  • Pagination: large lists (yields, validators) return limit and offset.
  • Error clarity: validation errors now cite the exact missing or malformed field.

7. Detailed Side-by-Side Comparison of Naming and DTOs

YieldDto Comparison

Key differences:
  • Schema-driven arguments – v2 introduces structured mechanics.arguments for enter, exit, and manage actions
  • Top-level token definitions – v2 exposes inputTokens and token at the root
  • Normalized reward rate formatrewardRate in v2 includes detailed breakdown via components[]
  • Separated metadata and mechanics – v2 cleanly separates UI-facing display data from execution logic

YieldBalanceDto Comparison

Key differences:
  • Unified Lifecycle States – v2 replaces "staked", "rewards" with consistent types: active, claimable, withdrawable, entering, exiting, locked
  • Flattened Balance Structure – v2 eliminates grouped balances in favor of flat positions
  • Simplified Amount Handling – v2 standardizes on amount, amountRaw, and amountUsd
  • Embedded Validator Metadata – v2 includes full validator metadata directly on each balance

ActionDto Comparison (Enter-Stake Flow)

In v1, developers were required to call PATCH /transaction/{id} per transaction step to get the unsignedTransaction
Key differences:
  • Schema-driven requests – v2 replaces nested args with top-level arguments object
  • Unified action structure – All actions return same ActionDto format with intent, type, yieldId
  • Transactions included by default – v2 embeds unsignedTransaction, structuredTransaction, annotatedTransaction directly
  • Gas estimates and step metadata – Each transaction includes gasEstimate, stepIndex, and title

Migration Tips

1

Drive everything from the schema

Always pull GET /v1/yields/{id} and build your request exactly as that schema dictates.
2

Remove transaction construction logic

No need to construct transactions via endpoint one by one anymore. Simply create the action, sign and submit each transaction!
3

Test in parallel

v1 and v2 can run side by side under the same API key—migrate flow by flow.
4

Use balance endpoint for passthrough

Use the balance endpoint to capture any passthrough needed for manage actions.

Developer Update Checklist

Rename & Map Fields

Switch to yieldId, metadata.*, rewardRate.*, lifecycle type

Generate UI from Schema

Read yield.mechanics.arguments to create forms; note validatorAddress (string) vs validatorAddresses (array)

Fetch Validators Separately

Use /validators endpoint - no inline arrays

Use Balance Lifecycle

Drive labels/buttons from balance.type and pendingActions

Simplify Actions

One create-action call → sign each TransactionDtoPUT /submit-hash; no construct-tx calls needed

Update Types

Update TypeScript interfaces to match new DTO structures

Support

If you need help migrating, contact hello@yield.xyz.

Next Steps

API Reference

Current API documentation

Quickstart

Get started with v2