Skip to main content
Give AI agents access to 2,900+ yield opportunities across 80+ blockchain networks. Yield.xyz AgentKit discovers and constructs unsigned transactions for staking, lending, vaults, liquid staking, and restaking. Privy handles wallet creation, policy enforcement, and transaction signing. The two systems never overlap: Yield.xyz never signs, Privy never builds transactions.

Resources

Yield.xyz AgentKit

GitHub repository for the Yield.xyz AgentKit MCP server.

Yield.xyz AgentKit docs

Official documentation for the Yield.xyz AgentKit.

Privy agentic wallets

Set up Privy server wallets for autonomous agents.

Privy manual approvals

Intents API reference for semi-autonomous workflows.

What is Yield.xyz AgentKit?

Yield.xyz AgentKit is an MCP server that provides AI agents with tools to search yield opportunities, build deposit/withdraw/claim transactions, and check balances across 80+ networks. All yield operations go through MCP tools — agents never call the Yield.xyz REST API directly.
ToolPurpose
yields_get_allSearch and filter yields by network, token, type, or provider
yields_getRetrieve full metadata for a specific yield
yields_get_validatorsFetch validator options for delegation-based yields
yields_get_balancesCheck balances and pending actions
actions_enterBuild transactions to deposit or stake into a yield
actions_exitBuild transactions to withdraw or unstake from a yield
actions_manageBuild transactions for pending actions (claim rewards, restake)
Yield.xyz AgentKit is maintained by the Yield.xyz team. For AgentKit-specific issues, refer to their GitHub repository.

Prerequisites

  • A Privy account with API credentials (dashboard.privy.io)
  • PRIVY_APP_ID and PRIVY_APP_SECRET set as environment variables
  • Optionally PRIVY_WALLET_ID if a wallet already exists
  • Claude Code installed
  • Privy Enterprise plan (required for the semi-autonomous workflow only)
To set up Privy server wallets before continuing: Agentic wallets guide · Privy dashboard

Installation

Install the Yield.xyz AgentKit skill:
npx skills add https://github.com/stakekit/agentkit
The installer prompts for a skill selection (yield-agentkit-privy) and an agent choice (Claude Code, Cursor, or Codex CLI). Once complete, the skill is symlinked into the project at .agents/skills/yield-agentkit-privy. Open the agent in the project directory and run:
Set up the yield-agentkit-privy skill
The skill verifies Privy credentials and prompts for a workflow selection: Autonomous or Semi-Autonomous.

Workflows

Privy supports two control models depending on approval requirements.

Autonomous

The agent signs and broadcasts transactions directly via Privy’s wallet RPC endpoint. Policies are enforced automatically within the TEE. No manual approval is required. Available on any Privy plan.
1

Verify credentials

The skill checks that PRIVY_APP_ID, PRIVY_APP_SECRET, and optionally PRIVY_WALLET_ID are present.
2

Register the MCP server

The skill registers the Yield.xyz AgentKit MCP server:
claude mcp add --transport http yield-agentkit https://mcp.yield.xyz/mcp
3

Configure a policy (optional)

The skill offers to attach a policy (conservative, balanced, or skip). Policies restrict per-transaction spend, allowed chains, or allowlisted protocols. All enforcement happens inside the TEE.
4

Create the wallet

The skill creates a wallet and attaches the policy if one was configured.
5

Fund the wallet

Send assets to the displayed wallet address.
6

Issue DeFi instructions

The agent is ready. Example prompt: "Deposit USDC into Aave V3 on Base."

Semi-autonomous (Enterprise)

Every transaction is submitted as an intent via Privy’s Intents API. A designated approver must review and approve each transaction on the Privy dashboard before it executes. Intents expire after 72 hours if not approved. Intent statuses: pending (awaiting approval), executed (broadcast), failed (execution error), expired (72h elapsed), rejected (cancelled), dismissed (resource changed).
1

Complete autonomous setup steps 1–3

Follow the credential verification, MCP registration, and policy configuration steps from the autonomous workflow above.
2

Confirm Enterprise prerequisites

Verify the Enterprise plan is active and the approver has been invited and completed MFA.
3

Create a key quorum

Create a key quorum in the Privy dashboard under Wallet Infrastructure → Authorization → New Key → Register Key Quorum Instead. Copy the Quorum ID and provide it to the agent. The agent verifies it via GET /v1/key_quorums/{id}.
4

Create the wallet

The skill creates the wallet with the key quorum as owner:
POST /v1/wallets
  chain_type: "ethereum"
  owner_id: <key_quorum_id>
  policy_ids: [<policy_id>]
5

Set up webhooks (optional)

Register an HTTPS endpoint under Configuration → Webhooks in the Privy dashboard and enable all four intent events: intent.created, intent.authorized, intent.executed, and intent.failed. See Privy intent webhooks.For testing without a backend, use webhook.site.
Once setup is complete, every transaction follows this cycle: agent builds via MCP → submits as intent → approver reviews on dashboard → Privy signs and broadcasts → agent polls until executed → reads hash.

Transaction flow

Every yield action — enter, exit, or manage — follows the same sequence:
  1. Call yields_get to inspect the yield schema
  2. Call actions_enter, actions_exit, or actions_manage to build unsigned transactions
  3. MCP returns an array of transactions with stepIndex, type, and unsignedTransaction
  4. For each transaction in stepIndex order:
    • Autonomous: POST /v1/wallets/{id}/rpc → immediate hash
    • Semi-autonomous: POST /v1/intents/wallets/{id}/rpc → poll until executed
  5. Report results with on-chain confirmation hashes

EVM transactions

Extract only the fields Privy accepts from the unsigned transaction:
PRIVY_TX=$(echo "$UNSIGNED_TX" | jq '{from, to, value, data, nonce, type} | with_entries(select(.value != null))')
Submit to Privy:
# Example uses Base (chainId: 8453)
curl -s -X POST "https://api.privy.io/v1/wallets/$PRIVY_WALLET_ID/rpc" \
  --user "$PRIVY_APP_ID:$PRIVY_APP_SECRET" \
  -H "privy-app-id:$PRIVY_APP_ID" \
  -H "Content-Type: application/json" \
  -d "{
    \"method\":\"eth_sendTransaction\",
    \"caip2\":\"eip155:8453\",
    \"params\": { \"transaction\":$PRIVY_TX }
  }"

Solana transactions

Convert hex to base64 before submitting:
TX_BASE64=$(echo "$UNSIGNED_TX" | xxd -r -p | base64)

curl -s -X POST "https://api.privy.io/v1/wallets/$PRIVY_WALLET_ID/rpc" \
  --user "$PRIVY_APP_ID:$PRIVY_APP_SECRET" \
  -H "privy-app-id:$PRIVY_APP_ID" \
  -H "Content-Type: application/json" \
  -d "{
    \"method\":\"signAndSendTransaction\",
    \"caip2\":\"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp\",
    \"params\": { \"transaction\":\"$TX_BASE64\", \"encoding\":\"base64\" }
  }"

Multi-transaction ordering

Transactions are processed sequentially in stepIndex order. For EVM chains, the nonce increments for each subsequent transaction. If any transaction fails, execution stops immediately and the failure is returned.
For detailed transaction guides, see Send EVM transaction and Send Solana transaction.
The skill never modifies values inside an unsignedTransaction. Amounts, recipient addresses, fees, and calldata are passed through exactly as returned by the MCP. Only structural fields are adjusted for Privy’s signing format.

Error handling

ErrorCauseAction
POLICY_VIOLATIONTransaction exceeds policy limitsReport which rule triggered. Do not retry without user instruction.
INSUFFICIENT_FUNDSWallet lacks gasAsk the user to add native token to the wallet address.
FAILEDTransaction failed on-chainProvide the hash for block explorer inspection. Stop all subsequent transactions.

What cannot be automated

ActionReason
Fund the agent walletRequires an existing external wallet
Invite approver to Privy appTied to authenticated user account
Complete MFADevice-bound
Create key quorumAPI requires user ID input — kept manual for better UX
Approve pending intentBy design — this is the point of the workflow
Upgrade to EnterpriseBilling — done on the Privy dashboard
Webhook setupNo API available — done in Configuration → Webhooks in the dashboard

Learn more

Yield.xyz AgentKit

Skill repository and MCP server source.

Yield.xyz AgentKit docs

AgentKit reference documentation.

Privy agentic wallets

Wallet setup guide for autonomous agents.

Privy manual approvals

Intents API reference.

Privy webhooks

Webhooks overview for transaction events.

Privy dashboard

Wallet and policy management.