Skip to main content
Keep your integration’s view of an action current after you submit it, and surface the moments that need a user’s attention: a failed transaction, a cooldown that finished, or a yield that stopped accepting entries.

Poll to a terminal status

An action’s status and each of its transactions[]’ status are two different enums; poll the one you need. Transaction status gates sequencing within a single action (see Enter and exit flows); action status tells you when the whole thing is done:
Back off between polls instead of polling on a tight loop, and bound the overall wait. GET /v1/transactions/{id} works the same way for a single transaction. See Actions for the full status tables.

Recover from FAILED and STALE

  • FAILED is final. A transaction in the sequence failed or reverted. Do not resubmit a hash or modify the failed transaction. Request a brand new action (enter, exit, or manage, matching the original intent) instead.
  • STALE means no progress for 30 minutes, but it is not final: a transaction that was broadcast late can still confirm and complete the action. Before requesting a replacement, check the stale action’s transactions. If none was ever broadcast, request a new action. If one was broadcast, confirm it on-chain (or with GET /v1/transactions/{id}) first, so a late confirmation doesn’t leave the user with two positions.

List an address’s action history

GET /v1/actions returns an address’s past and in-flight actions, paginated with offset / limit (default 20, max 100): By default, with no status or statuses filter, GET /v1/actions hides STALE actions that never broadcast a single transaction: a stale action with at least one broadcast attempt still appears. Pass statuses=STALE (or another explicit filter) to see everything, including stale actions that never left the ground.
cURL

Watch balances for new pending actions

A position’s next required step, such as a claim once a cooldown ends or rewards becoming claimable, appears as a new entry in that balance’s pendingActions[] the next time you fetch it. Poll the portfolio endpoint on an interval that fits your product, and diff against what you saw last time:
Alert the user on anything the diff returns. See Tracking balances for fetching balances and executing a pending action once you’ve surfaced it.

Watch yield health before offering entry

A yield can stop accepting new deposits between the time you last cached its metadata and the time a user tries to enter it. Re-check before offering entry rather than relying on a value fetched earlier in the session: Treat any of the three as a reason to hide or disable the entry action. See Discover yields for the rest of a yield’s fields.

Rate limits

Every request against a project’s API key counts against that project’s plan tier, and a sustained polling loop (action status, transaction status, balances) is a common source of avoidable request volume. Back off on 429 responses using the retry-after header, and see Rate limits for your plan’s limits and response headers.

Webhooks as an alternative to polling

yield.xyz also emits transaction.status_changed and position.status_changed webhook events, so you can react to a status change without polling for it. See Receive webhooks to set up an endpoint and verify deliveries, and Webhooks for the event model. Polling remains the fallback: use it for anything a webhook subscription doesn’t cover, and to reconcile after a missed or delayed delivery.

Next steps

Tracking balances

Fetch, group, and act on a user’s positions and pending actions.

Enter and exit flows

The sign, submit, and poll loop a fresh action needs after you request it.

Webhooks

Configure endpoints and subscriptions for status-change events.

Rate limits

Plan limits, response headers, and backoff for 429 responses.