YieldAgent 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 unsignedTransaction returned by the API UNDER ANY CIRCUMSTANCES.
Do 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 unsignedTransaction WILL RESULT IN PERMANENT LOSS OF FUNDS.
Key Rules
The API is self-documenting. Every yield describes its own requirements through the YieldDto. Before taking any action, always fetch the yield and inspect it. The mechanics field tells you everything: what arguments are needed (mechanics.arguments.enter, .exit), entry limits (mechanics.entryLimits), and what tokens are accepted (inputTokens[]). Never assume — always check the yield first.
Always fetch the yield before calling an action. Call GET /v1/yields/{yieldId} and read mechanics.arguments.enter (or .exit) to discover the exact fields required. Each yield is different — the schema is the contract. Do not guess or hardcode arguments.
Each field in the schema (ArgumentFieldDto) tells you:
name: the field name (e.g., amount, validatorAddress, inputToken)
type: the value type (string, number, address, enum, boolean)
required: whether it must be provided
options: static choices for enum fields (e.g., ["individual", "batched"])
optionsRef: a dynamic API endpoint to fetch choices (e.g., /api/v1/validators?integrationId=...) — if present, call it to get the valid options (validators, providers, etc.)
minimum / maximum: value constraints
isArray: whether the field expects an array
If a field has optionsRef, you must call that endpoint to get the valid values. This is how validators, providers, and other dynamic options are discovered.
For manage actions, always fetch balances first. Call POST /v1/yields/{yieldId}/balances and read pendingActions[] on each balance. Each pending action tells you its type, passthrough, and optional arguments schema. Only call manage with values from this response.
Amounts are human-readable. "100" means 100 USDC. "1" means 1 ETH. "0.5" means 0.5 SOL. Do NOT convert to wei or raw integers — the API handles decimals internally.
Set inputToken to what the user wants to deposit — but only if inputToken appears in the yield's mechanics.arguments.enter schema. The API handles the full flow (swaps, wrapping, routing) to get the user into the position.
ALWAYS submit the transaction hash after broadcasting — no exceptions. For every transaction: sign, broadcast, then submit the hash via PUT /v1/transactions/{txId}/submit-hash with { "hash": "0x..." }. Balances will not appear until the hash is submitted. This is the most common mistake — do not skip this step.
Execute transactions in exact order. If an action has multiple transactions, they are ordered by stepIndex. Wait for CONFIRMED before proceeding to the next. Never skip or reorder.
Consult {baseDir}/references/openapi.yaml for types. All enums, DTOs, and schemas are defined there. Do not hardcode values.
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 |
find-yields.sh |
Discover yields by network/token |
get-yield-info.sh |
Inspect yield schema, limits, token details |
list-validators.sh |
List validators for staking yields |
enter-position.sh |
Enter a yield position |
exit-position.sh |
Exit a yield position |
manage-position.sh |
Claim, restake, redelegate, etc. |
check-portfolio.sh |
Check balances and pending actions |
Common Patterns
Enter a Position
- Discover yields:
find-yields.sh base USDC
- Inspect the yield:
get-yield-info.sh <yieldId> — read 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
pendingActions[] — each has { 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
unsignedTransaction to wallet skill for signing and broadcasting
- Submit the hash —
PUT /v1/transactions/{txId}/submit-hash with { "hash": "0x..." }
- Poll
GET /v1/transactions/{txId} until CONFIRMED or FAILED
- 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 |
/v1/yields |
List yields (with filters) |
| GET |
/v1/yields/{yieldId} |
Get yield metadata (schema, limits, tokens) |
| GET |
/v1/yields/{yieldId}/validators |
List validators |
| POST |
/v1/actions/enter |
Enter a position |
| POST |
/v1/actions/exit |
Exit a position |
| POST |
/v1/actions/manage |
Manage a position |
| POST |
/v1/yields/{yieldId}/balances |
Get balances for a yield |
| POST |
/v1/yields/balances |
Aggregate balances across yields/networks |
| PUT |
/v1/transactions/{txId}/submit-hash |
Submit tx hash after broadcasting |
| GET |
/v1/transactions/{txId} |
Get transaction status |
| GET |
/v1/networks |
List all supported networks |
| GET |
/v1/providers |
List all providers |
References
Detailed reference files — read on demand when you need specifics.
- API types and schemas:
{baseDir}/references/openapi.yaml — source of truth for all DTOs, enums, request/response shapes
- Chain transaction formats:
{baseDir}/references/chain-formats.md — unsignedTransaction encoding per chain family (EVM, Cosmos, Solana, Substrate, etc.)
- Wallet integration:
{baseDir}/references/wallet-integration.md — Crossmint, Portal, Turnkey, Privy, signing flow
- Agent conversation examples:
{baseDir}/references/examples.md — 10 conversation patterns with real yield IDs
- Safety checks:
{baseDir}/references/safety.md — pre-execution checks, constraints
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.
{baseDir}/references/superskill.md — 40 advanced capabilities: rate monitoring, cross-chain comparison, portfolio diversification, rotation workflows, reward harvesting, scheduled checks
Resources
1---
2name: yield-agent
3displayName: YieldAgent
4description: 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.
5version: 0.1.5
6author: yield-xyz
7homepage: https://yield.xyz
8metadata:
9 source: https://skillmd.com/skills/modbender/yield-agent
10 openclaw:
11 emoji: 📈
12 requires:
13 bins:
14 - curl
15 - jq
16tools:
17 - name: find-yields
18 description: Discover yield opportunities by network and token
19 entry: scripts/find-yields.sh
20 args:
21 - name: network
22 description: The blockchain network (e.g., base, ethereum, arbitrum, solana)
23 required: true
24 - name: token
25 description: The token symbol (e.g., USDC, ETH). Optional - omit to see all yields on network.
26 required: false
27 - name: limit
28 description: Items per page (default 20, max 100)
29 required: false
30 - name: offset
31 description: Pagination offset (default 0)
32 required: false
33 - name: enter-position
34 description: Enter a yield position. Fetch the yield first (GET /v1/yields/{yieldId}) to discover required arguments from mechanics.arguments.enter
35 entry: scripts/enter-position.sh
36 args:
37 - name: yieldId
38 description: The unique yield identifier (e.g., base-usdc-aave-v3-lending)
39 required: true
40 - name: address
41 description: The user wallet address
42 required: true
43 - name: arguments_json
44 description: JSON string of arguments from the yield's mechanics.arguments.enter schema. Always includes "amount". Other fields (validatorAddress, inputToken, etc.) depend on the yield.
45 required: true
46 - name: exit-position
47 description: Exit a yield position. Fetch the yield first (GET /v1/yields/{yieldId}) to discover required arguments from mechanics.arguments.exit
48 entry: scripts/exit-position.sh
49 args:
50 - name: yieldId
51 description: The unique yield identifier to exit from
52 required: true
53 - name: address
54 description: The user wallet address
55 required: true
56 - name: arguments_json
57 description: JSON string of arguments from the yield's mechanics.arguments.exit schema. Always includes "amount". Other fields depend on the yield.
58 required: true
59 - name: manage-position
60 description: Manage a yield position (claim, restake, redelegate, etc.). Discover available actions from pendingActions[] in the balances response.
61 entry: scripts/manage-position.sh
62 args:
63 - name: yieldId
64 description: The unique yield identifier
65 required: true
66 - name: address
67 description: The user wallet address
68 required: true
69 - name: action
70 description: The action type from pendingActions[].type in the balances response
71 required: true
72 - name: passthrough
73 description: The passthrough string from pendingActions[].passthrough in the balances response
74 required: true
75 - name: arguments_json
76 description: JSON string of arguments from pendingActions[].arguments schema, if the action requires additional input
77 required: false
78 - name: check-portfolio
79 description: Check yield balances for a specific yield position
80 entry: scripts/check-portfolio.sh
81 args:
82 - name: yieldId
83 description: The unique yield identifier to check balances for (e.g., base-usdc-aave-v3-lending)
84 required: true
85 - name: address
86 description: The user wallet address to check balances for
87 required: true
88 - name: get-yield-info
89 description: Fetch full yield metadata including required arguments schema, entry limits, validator requirements, and token details
90 entry: scripts/get-yield-info.sh
91 args:
92 - name: yieldId
93 description: The unique yield identifier to inspect (e.g., base-usdc-aave-v3-lending)
94 required: true
95 - name: list-validators
96 description: List available validators for staking yields that require validator selection
97 entry: scripts/list-validators.sh
98 args:
99 - name: yieldId
100 description: The unique yield identifier to list validators for
101 required: true
102 - name: limit
103 description: Maximum validators to return (default 20)
104 required: false
105---
106
107# YieldAgent by Yield.xyz
108
109Access 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.
110
111## CRITICAL: Never Modify Transactions From The API
112
113> **DO NOT MODIFY `unsignedTransaction` returned by the API UNDER ANY CIRCUMSTANCES.**
114>
115> Do not change, reformat, or "fix" any part of it — not addresses, amounts, fees, encoding, or any other field, on any chain.
116>
117> **If the amount is wrong:** Request a NEW action from the API with the correct amount.
118> **If gas is insufficient:** Ask the user to add funds, then request a NEW action.
119> **If anything looks wrong:** STOP. Always request a new action with corrected arguments. Never attempt to "fix" an existing transaction.
120>
121> Modifying `unsignedTransaction` WILL RESULT IN PERMANENT LOSS OF FUNDS.
122
123---
124
125## Key Rules
126
127> **The API is self-documenting.** Every yield describes its own requirements through the `YieldDto`. Before taking any action, always fetch the yield and inspect it. The `mechanics` field tells you everything: what arguments are needed (`mechanics.arguments.enter`, `.exit`), entry limits (`mechanics.entryLimits`), and what tokens are accepted (`inputTokens[]`). Never assume — always check the yield first.
128
1291. **Always fetch the yield before calling an action.** Call `GET /v1/yields/{yieldId}` and read `mechanics.arguments.enter` (or `.exit`) to discover the exact fields required. Each yield is different — the schema is the contract. Do not guess or hardcode arguments.
130
131 Each field in the schema (`ArgumentFieldDto`) tells you:
132 - `name`: the field name (e.g., `amount`, `validatorAddress`, `inputToken`)
133 - `type`: the value type (`string`, `number`, `address`, `enum`, `boolean`)
134 - `required`: whether it must be provided
135 - `options`: static choices for enum fields (e.g., `["individual", "batched"]`)
136 - `optionsRef`: a dynamic API endpoint to fetch choices (e.g., `/api/v1/validators?integrationId=...`) — if present, call it to get the valid options (validators, providers, etc.)
137 - `minimum` / `maximum`: value constraints
138 - `isArray`: whether the field expects an array
139
140 If a field has `optionsRef`, you must call that endpoint to get the valid values. This is how validators, providers, and other dynamic options are discovered.
141
1422. **For manage actions, always fetch balances first.** Call `POST /v1/yields/{yieldId}/balances` and read `pendingActions[]` on each balance. Each pending action tells you its `type`, `passthrough`, and optional `arguments` schema. Only call manage with values from this response.
143
1443. **Amounts are human-readable.** `"100"` means 100 USDC. `"1"` means 1 ETH. `"0.5"` means 0.5 SOL. Do NOT convert to wei or raw integers — the API handles decimals internally.
145
1464. **Set `inputToken` to what the user wants to deposit** — but only if `inputToken` appears in the yield's `mechanics.arguments.enter` schema. The API handles the full flow (swaps, wrapping, routing) to get the user into the position.
147
1485. **ALWAYS submit the transaction hash after broadcasting — no exceptions.** For every transaction: sign, broadcast, then submit the hash via `PUT /v1/transactions/{txId}/submit-hash` with `{ "hash": "0x..." }`. Balances will not appear until the hash is submitted. This is the most common mistake — do not skip this step.
149
1506. **Execute transactions in exact order.** If an action has multiple transactions, they are ordered by `stepIndex`. Wait for `CONFIRMED` before proceeding to the next. Never skip or reorder.
151
1527. **Consult `{baseDir}/references/openapi.yaml` for types.** All enums, DTOs, and schemas are defined there. Do not hardcode values.
153
154## Quick Start
155
156```bash
157# Discover yields on a network
158./scripts/find-yields.sh base USDC
159
160# Inspect a yield's schema before entering
161./scripts/get-yield-info.sh base-usdc-aave-v3-lending
162
163# Enter a position (amounts are human-readable)
164./scripts/enter-position.sh base-usdc-aave-v3-lending 0xYOUR_ADDRESS '{"amount":"100"}'
165
166# Check balances and pending actions
167./scripts/check-portfolio.sh base-usdc-aave-v3-lending 0xYOUR_ADDRESS
168```
169
170## Scripts
171
172| Script | Purpose |
173|--------|---------|
174| `find-yields.sh` | Discover yields by network/token |
175| `get-yield-info.sh` | Inspect yield schema, limits, token details |
176| `list-validators.sh` | List validators for staking yields |
177| `enter-position.sh` | Enter a yield position |
178| `exit-position.sh` | Exit a yield position |
179| `manage-position.sh` | Claim, restake, redelegate, etc. |
180| `check-portfolio.sh` | Check balances and pending actions |
181
182## Common Patterns
183
184### Enter a Position
1851. Discover yields: `find-yields.sh base USDC`
1862. Inspect the yield: `get-yield-info.sh <yieldId>` — read `mechanics.arguments.enter`
1873. Enter: `enter-position.sh <yieldId> <address> '{"amount":"100"}'`
1884. For each transaction: wallet signs → broadcast → **submit hash** → wait for CONFIRMED
189
190### Manage a Position
1911. Check balances: `check-portfolio.sh <yieldId> <address>`
1922. Read `pendingActions[]` — each has `{ type, passthrough, arguments? }`
1933. Manage: `manage-position.sh <yieldId> <address> <action> <passthrough>`
194
195### Full Lifecycle
1961. Discover → 2. Enter → 3. Check balances → 4. Claim rewards → 5. Exit
197
198## Transaction Flow
199
200After any action (enter/exit/manage), the response contains `transactions[]`. For EACH transaction:
201
2021. Pass `unsignedTransaction` to wallet skill for signing and broadcasting
2032. **Submit the hash** — `PUT /v1/transactions/{txId}/submit-hash` with `{ "hash": "0x..." }`
2043. Poll `GET /v1/transactions/{txId}` until `CONFIRMED` or `FAILED`
2054. Proceed to next transaction
206
207Every transaction must follow this flow. Example with 3 transactions:
208```
209TX1: sign → broadcast → submit-hash → poll until CONFIRMED
210TX2: sign → broadcast → submit-hash → poll until CONFIRMED
211TX3: sign → broadcast → submit-hash → poll until CONFIRMED
212```
213
214`unsignedTransaction` format varies by chain. See `{baseDir}/references/chain-formats.md` for details.
215
216## API Endpoints
217
218All endpoints documented in `{baseDir}/references/openapi.yaml`. Quick reference:
219
220| Method | Endpoint | Description |
221|--------|----------|-------------|
222| GET | `/v1/yields` | List yields (with filters) |
223| GET | `/v1/yields/{yieldId}` | Get yield metadata (schema, limits, tokens) |
224| GET | `/v1/yields/{yieldId}/validators` | List validators |
225| POST | `/v1/actions/enter` | Enter a position |
226| POST | `/v1/actions/exit` | Exit a position |
227| POST | `/v1/actions/manage` | Manage a position |
228| POST | `/v1/yields/{yieldId}/balances` | Get balances for a yield |
229| POST | `/v1/yields/balances` | Aggregate balances across yields/networks |
230| PUT | `/v1/transactions/{txId}/submit-hash` | Submit tx hash after broadcasting |
231| GET | `/v1/transactions/{txId}` | Get transaction status |
232| GET | `/v1/networks` | List all supported networks |
233| GET | `/v1/providers` | List all providers |
234
235## References
236
237Detailed reference files — read on demand when you need specifics.
238
239- **API types and schemas:** `{baseDir}/references/openapi.yaml` — source of truth for all DTOs, enums, request/response shapes
240- **Chain transaction formats:** `{baseDir}/references/chain-formats.md` — `unsignedTransaction` encoding per chain family (EVM, Cosmos, Solana, Substrate, etc.)
241- **Wallet integration:** `{baseDir}/references/wallet-integration.md` — Crossmint, Portal, Turnkey, Privy, signing flow
242- **Agent conversation examples:** `{baseDir}/references/examples.md` — 10 conversation patterns with real yield IDs
243- **Safety checks:** `{baseDir}/references/safety.md` — pre-execution checks, constraints
244
245## Error Handling
246
247The 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.
248
249## Add-on Modules
250
251Modular instructions that extend core functionality. Read when relevant.
252
253
254- `{baseDir}/references/superskill.md` — 40 advanced capabilities: rate monitoring, cross-chain comparison, portfolio diversification, rotation workflows, reward harvesting, scheduled checks
255
256## Resources
257
258- API Docs: https://docs.yield.xyz
259- API Recipes: https://github.com/stakekit/api-recipes
260- Get API Key: https://dashboard.yield.xyz