Prerequisites
- A yield.xyz API key, sent as
x-api-keyon every request. - A signer for the target chain. See Transaction signing for EVM and Solana-specific signing code.
- Familiarity with the generic loop in Enter and exit flows: this guide covers what’s specific to staking and links back to that guide for branching on
executionPattern, choosing a submit path, and polling.
We construct. You sign. Every action returns unsigned transactions; yield.xyz never holds keys and never signs on your behalf. Inspect
unsignedTransaction before signing it.What’s specific to staking
The flow is the Stake It flow: discover, inspect, resolve the validator, enter, sign, track, read balances. What changes for staking yields:- Discovery. Filter with
types=stakingand addliquid_staking(types=staking,liquid_staking) to include liquid staking yields. Addproviderswhen you know the protocol: the filter matches each yield’smechanics.type, so don’t assume which type a given protocol reports. - Validator behavior. Read
mechanics.requiresValidatorSelectionand look for avalidatorAddressorvalidatorAddressesfield inmechanics.arguments.enter.fields. When one is present, fetch candidates fromGET /v1/yields/{yieldId}/validatorsand pass the chosen address back. Validator selection covers the full decision, including provider-assigned validators. - Limits and timing. Read
mechanics.entryLimits(minimum,maximum,subsequentMinimum) before building the amount, andmechanics.cooldownPeriodfor the unbonding window. Read both per yield rather than assuming fixed numbers; they vary by integration and can change. - Position lifecycle. A staking position moves through
entering,active,exiting(during the unbonding cooldown after exit) andwithdrawable(cooldown complete, with aWITHDRAW- orCLAIM-family pending action). You run that pending action to receive the funds.
Examples
- EVM: Lido ETH
- Solana: native staking
ethereum-eth-lido-staking is liquid staking: it takes no validator argument, and mints stETH for the ETH you deposit.cURL
Response (excerpt)
requiresValidatorSelection is false and neither schema names a validator field, so skip validator selection entirely. Check mechanics.cooldownPeriod on this response for the exit unbonding window currently in effect; it is not a fixed constant.1
Enter
cURL
STAKE transaction (ETH is the native gas token, so there’s no approval step). Sign and submit it, then poll to a terminal status as in Enter and exit flows.2
Exit
cURL
APPROVAL (SKIPPED if your stETH allowance to Lido’s withdrawal queue already covers the amount) at stepIndex 0, then an UNSTAKE at stepIndex 1 that places a withdrawal request in Lido’s own queue. This does not release ETH yet; it starts the cooldown you read from mechanics.cooldownPeriod.3
Claim after cooldown
Once the cooldown ends,
POST /v1/yields/ethereum-eth-lido-staking/balances reports the position as withdrawable with a CLAIM_UNSTAKED pending action. Execute it through POST /v1/actions/manage, passing action: "CLAIM_UNSTAKED" and the passthrough copied unchanged from the balance response, the same pattern as any other pending action. See Enter and exit flows.Verify
After the last transaction of any step confirms, re-read the balance and check bothtype and pendingActions rather than assuming the position is fully settled:
cURL
active balance with an empty pendingActions array means the stake is fully entered and earning. An exiting or withdrawable balance means the position is mid-unbond or ready for its claim or withdraw pending action; don’t tell a user their funds have arrived until the balance itself says withdrawable and the pending action has been run.
Next steps
Validator selection
The full decision flow, the validators endpoint, and Preferred vs BYON vs Whitelabel.
Enter and exit flows
The generic branch, sign, submit, and poll loop this guide builds on.
Tracking balances
Build portfolio views across staking, liquid-staking, and other Earn positions.
Transaction signing
Chain-specific signing code, including EVM and Solana.

