Resources
Prerequisites
- A yield.xyz API key. See Projects & API keys.
- A Sequence project access key and WaaS config key from Sequence Builder.
Getting started with Sequence
Install the SDK and sign the user in. Social login, email and guest sign-in are supported, with no seed phrase.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, map its transactions to Sequence’s format and send them as one batch. Sequence simulates the batch first and does not broadcast it if it would fail.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.
- Batch every step of an action into one
sendTransactioncall: one confirmation, atomic execution. - Use
sendTransactionfor the raw transactions yield.xyz returns;callContractis for a single ABI call you encode yourself. - Check
isSentTransactionResponsebefore reporting a hash: a failed simulation is never broadcast.
Power Trails Earn with yield.xyz
Trails Earn lets users deposit into DeFi protocols and RWA vaults from any token on any chain. Trails handles the cross-chain routing, bridging and swapping. yield.xyz supplies the three things Trails Earn needs underneath: which yields to show, the calldata to enter and exit them, and the user’s positions afterwards. New yields, protocols and issuers added to yield.xyz become available to Trails without new integration work.1. Populate the Earn UI
2. Build the deposit
When the user picks a yield and an amount, build the enter action for the user’s address on the destination chain:GET /v1/yields/{yieldId}/kyc/status for the destination address before the user starts a cross-chain deposit, so they don’t bridge funds and then hit a 412 on enter.
3. Track positions
4. Build the withdrawal
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 Sequence signs it.
Embedded wallets
The same flow with other wallet providers.

