Skip to main content
Use this page to move an integration built on the legacy (v1) API to the current Earn API. It maps each legacy endpoint and field to its current equivalent; for the current model itself, see Actions and the enter and exit guide.

What changed at a glance


Yield discovery and metadata


Actions and 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 or unstaking

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

Manage actions (claims, restakes, redelegations)


Balances

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

Before and after quick reference


Other notable changes

  • Hostname has moved from api.stakek.it to api.yield.xyz.
  • Terminology: integrationId → yieldId; “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.

Side-by-side naming and DTO comparison

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 format: rewardRate 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

You no longer construct transactions one endpoint call at a time: create the action, then 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 and 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 TransactionDto → PUT /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