Resources
Prerequisites
- A Yield.xyz API key. See Onboarding.
- A Dynamic environment with embedded wallets enabled, set up with the React quickstart.
Getting started with Dynamic
Follow the React quickstart to add authentication and embedded MPC wallets. You need the user’sprimaryWallet from useDynamicContext() in @dynamic-labs/sdk-react-core, and an Ethereum wallet client from it to send EVM transactions.
How Yield.xyz fits
Yield.xyz gives you one API across 4,000+ yields on 85+ networks:- Discover:
GET /v1/yieldsreturns yields with their metadata. - Act:
POST /v1/actions/enter,/exitand/managereturn an ordered list of unsigned transactions. - Track:
POST /v1/yields/{yieldId}/balancesandPOST /v1/yields/balancesreturn lifecycle-aware balances.
Keep the API key on your server
Keep your Yield.xyz API key on your server. The snippets in this guide call a small proxy route that adds the key, for example a Next.js route handler:Discover a yield
The discovery response already carries what your UI needs, so you don’t need a second request per yield.Find yields to offer
Rather than hardcoding yield IDs, which change as yields are added and retired, query the catalog for what you want to offer:prime=true to return only yields that meet the Prime quality bar. For staking, default users to preferred validators. For DeFi, wrap yields in an OAV to charge fees and auto-compound incentives (see Monetization).
Enter a yield
Build the action, then sign each transaction with the user’s Dynamic wallet, in order, and report each hash.arguments from mechanics.arguments.enter.fields rather than hardcoding { amount }, so the same code works for yields that also need a validatorAddress or another field. Amounts are in token units, for example "100" for 100 USDC. See Enter and exit flows.
KYC-gated RWA yields
Tokenized real-world assets, such as US Treasuries, money market funds and private credit, use the same enter and exit flow, so no new signing code is needed. Some issuers require the wallet to be allowlisted first, shown bymechanics.requirements.kycRequired: true on the yield.
Check the wallet when it connects, so you can show “Verify identity” instead of “Deposit” for a gated yield:
authorizeUrl when the status is not_started or rejected, ideally in a new tab or after saving the pending deposit so you can resume it, and enter once it is approved. If you call enter for a wallet that is not cleared, the API returns 412 with RwaKycError, and the message includes the issuer’s KYC URL:
entryLimits.minimum before you build the action: many RWA yields have high minimums. Issuer eligibility is in RWA KYC and on each issuer’s page under RWAs.
Read the position balance
Balances are lifecycle-aware: each one has atype that says whether funds are active, entering, exiting, withdrawable, claimable or locked.
POST /v1/yields/balances with { "queries": [{ "address", "network" }] }, up to 25 queries per request:
Handle pending actions
A balance can carrypendingActions, such as CLAIM_REWARDS or CLAIM_UNSTAKED. Pass one back to POST /v1/actions/manage unchanged, then sign the result the same way as an enter:
Exit a yield
Exiting is the same pattern as entering:exiting balance. When it settles it becomes withdrawable with a CLAIM_UNSTAKED pending action, which you complete through POST /v1/actions/manage as above. Poll balances on a sensible cadence and show the in-flight state in your UI.
Track transaction status
After each broadcast, report the hash withPUT /v1/transactions/{transactionId}/submit-hash, then poll GET /v1/transactions/{transactionId} (or GET /v1/actions/{actionId}) until it reaches a terminal status:
Integration tips
- Send transactions in
stepIndexorder and skip any already at a terminal status. - Never change
to,data,value, gas ornoncebefore signing. - Build arguments from
mechanics.arguments.*for the right fields and units. - Keep your Yield.xyz API key on the server.
- Geo-blocking is applied by the API for your project; see Geo-blocking.
- Switch the Dynamic wallet to the transaction’s
chainIdbefore sending. - Dynamic wallets that use account abstraction may bundle calls; report the resulting hash for each Yield.xyz transaction you sent.
Monetization
How you earn depends on the yield type. Each yield’smechanics.possibleFeeTakingMechanisms says which fees you can configure on it.
- Staking: deposit fees, deducted atomically in the same transaction, and a share of validator revenue through Yield.xyz’s validator agreements. See Preferred validators.
- DeFi: revenue share from some protocols and curators, and user-facing deposit, performance and management fees through OAVs.
- RWAs: issuer fees are set by the issuer and passed through. Where an RWA is wrapped in an OAV, you can add your own fees on top.
Next steps
Enter and exit flows
The full request, sign and poll loop.
Yield metadata
Every field returned on a yield.
Shield
Verify each transaction before Dynamic signs it.
Embedded wallets
The same flow with other wallet providers.

