Skills yield-agent
On-chain yield discovery, transaction building, and portfolio management via the Yield.xyz API. Use when the user wants to find yields, stake, lend, deposit into vaults, check balances, claim rewards, exit positions, compare APYs, or manage any on-chain yield across 80+ networks.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/apurvmishra/yield-agent" ~/.claude/skills/clawdbot-skills-yield-agent && rm -rf "$T"
skills/apurvmishra/yield-agent/SKILL.mdYieldAgent by Yield.xyz
Access the complete on-chain yield landscape through Yield.xyz's unified API. Discover 2600+ yields across staking, lending, vaults, restaking, and liquidity pools. Build transactions and manage positions across 80+ networks.
CRITICAL: Never Modify Transactions From The API
DO NOT MODIFY
returned by the API UNDER ANY CIRCUMSTANCES.unsignedTransactionDo not change, reformat, or "fix" any part of it — not addresses, amounts, fees, encoding, or any other field, on any chain.
If the amount is wrong: Request a NEW action from the API with the correct amount. If gas is insufficient: Ask the user to add funds, then request a NEW action. If anything looks wrong: STOP. Always request a new action with corrected arguments. Never attempt to "fix" an existing transaction.
Modifying
WILL RESULT IN PERMANENT LOSS OF FUNDS.unsignedTransaction
Key Rules
The API is self-documenting. Every yield describes its own requirements through the
. Before taking any action, always fetch the yield and inspect it. TheYieldDtofield tells you everything: what arguments are needed (mechanics,mechanics.arguments.enter), entry limits (.exit), and what tokens are accepted (mechanics.entryLimits). Never assume — always check the yield first.inputTokens[]
-
Always fetch the yield before calling an action. Call
and readGET /v1/yields/{yieldId}
(ormechanics.arguments.enter
) to discover the exact fields required. Each yield is different — the schema is the contract. Do not guess or hardcode arguments..exitEach field in the schema (
) tells you:ArgumentFieldDto
: the field name (e.g.,name
,amount
,validatorAddress
)inputToken
: the value type (type
,string
,number
,address
,enum
)boolean
: whether it must be providedrequired
: static choices for enum fields (e.g.,options
)["individual", "batched"]
: a dynamic API endpoint to fetch choices (e.g.,optionsRef
) — if present, call it to get the valid options (validators, providers, etc.)/api/v1/validators?integrationId=...
/minimum
: value constraintsmaximum
: whether the field expects an arrayisArray
If a field has
, you must call that endpoint to get the valid values. This is how validators, providers, and other dynamic options are discovered.optionsRef -
For manage actions, always fetch balances first. Call
and readPOST /v1/yields/{yieldId}/balances
on each balance. Each pending action tells you itspendingActions[]
,type
, and optionalpassthrough
schema. Only call manage with values from this response.arguments -
Amounts are human-readable.
means 100 USDC."100"
means 1 ETH."1"
means 0.5 SOL. Do NOT convert to wei or raw integers — the API handles decimals internally."0.5" -
Set
to what the user wants to deposit — but only ifinputToken
appears in the yield'sinputToken
schema. The API handles the full flow (swaps, wrapping, routing) to get the user into the position.mechanics.arguments.enter -
ALWAYS submit the transaction hash after broadcasting — no exceptions. For every transaction: sign, broadcast, then submit the hash via
withPUT /v1/transactions/{txId}/submit-hash
. Balances will not appear until the hash is submitted. This is the most common mistake — do not skip this step.{ "hash": "0x..." } -
Execute transactions in exact order. If an action has multiple transactions, they are ordered by
. Wait forstepIndex
before proceeding to the next. Never skip or reorder.CONFIRMED -
Consult
for types. All enums, DTOs, and schemas are defined there. Do not hardcode values.{baseDir}/references/openapi.yaml
Quick Start
# Discover yields on a network ./scripts/find-yields.sh base USDC # Inspect a yield's schema before entering ./scripts/get-yield-info.sh base-usdc-aave-v3-lending # Enter a position (amounts are human-readable) ./scripts/enter-position.sh base-usdc-aave-v3-lending 0xYOUR_ADDRESS '{"amount":"100"}' # Check balances and pending actions ./scripts/check-portfolio.sh base-usdc-aave-v3-lending 0xYOUR_ADDRESS
Scripts
| Script | Purpose |
|---|---|
| Discover yields by network/token |
| Inspect yield schema, limits, token details |
| List validators for staking yields |
| Enter a yield position |
| Exit a yield position |
| Claim, restake, redelegate, etc. |
| Check balances and pending actions |
Common Patterns
Enter a Position
- Discover yields:
find-yields.sh base USDC - Inspect the yield:
— readget-yield-info.sh <yieldId>mechanics.arguments.enter - Enter:
enter-position.sh <yieldId> <address> '{"amount":"100"}' - For each transaction: wallet signs → broadcast → submit hash → wait for CONFIRMED
Manage a Position
- Check balances:
check-portfolio.sh <yieldId> <address> - Read
— each haspendingActions[]{ type, passthrough, arguments? } - Manage:
manage-position.sh <yieldId> <address> <action> <passthrough>
Full Lifecycle
- Discover → 2. Enter → 3. Check balances → 4. Claim rewards → 5. Exit
Transaction Flow
After any action (enter/exit/manage), the response contains
transactions[]. For EACH transaction:
- Pass
to wallet skill for signing and broadcastingunsignedTransaction - Submit the hash —
withPUT /v1/transactions/{txId}/submit-hash{ "hash": "0x..." } - Poll
untilGET /v1/transactions/{txId}
orCONFIRMEDFAILED - Proceed to next transaction
Every transaction must follow this flow. Example with 3 transactions:
TX1: sign → broadcast → submit-hash → poll until CONFIRMED TX2: sign → broadcast → submit-hash → poll until CONFIRMED TX3: sign → broadcast → submit-hash → poll until CONFIRMED
unsignedTransaction format varies by chain. See {baseDir}/references/chain-formats.md for details.
API Endpoints
All endpoints documented in
{baseDir}/references/openapi.yaml. Quick reference:
| Method | Endpoint | Description |
|---|---|---|
| GET | | List yields (with filters) |
| GET | | Get yield metadata (schema, limits, tokens) |
| GET | | List validators |
| POST | | Enter a position |
| POST | | Exit a position |
| POST | | Manage a position |
| POST | | Get balances for a yield |
| POST | | Aggregate balances across yields/networks |
| PUT | | Submit tx hash after broadcasting |
| GET | | Get transaction status |
| GET | | List all supported networks |
| GET | | List all providers |
References
Detailed reference files — read on demand when you need specifics.
- API types and schemas:
— source of truth for all DTOs, enums, request/response shapes{baseDir}/references/openapi.yaml - Chain transaction formats:
—{baseDir}/references/chain-formats.md
encoding per chain family (EVM, Cosmos, Solana, Substrate, etc.)unsignedTransaction - Wallet integration:
— Crossmint, Portal, Turnkey, Privy, signing flow{baseDir}/references/wallet-integration.md - Agent conversation examples:
— 10 conversation patterns with real yield IDs{baseDir}/references/examples.md - Safety checks:
— pre-execution checks, constraints{baseDir}/references/safety.md
Error Handling
The API returns structured errors with
message, error, and statusCode. Read the message. Error shapes are in {baseDir}/references/openapi.yaml. Respect retry-after on 429s.
Add-on Modules
Modular instructions that extend core functionality. Read when relevant.
— 40 advanced capabilities: rate monitoring, cross-chain comparison, portfolio diversification, rotation workflows, reward harvesting, scheduled checks{baseDir}/references/superskill.md
Resources
- API Docs: https://docs.yield.xyz
- API Recipes: https://github.com/stakekit/api-recipes
- Get API Key: https://dashboard.yield.xyz