Automate passive DeFi yield for your wallet using non-custodial subaccounts.

Install

mkdir -p .claude/skills/zyfai && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11826" && unzip -o skill.zip -d .claude/skills/zyfai && rm skill.zip

Installs to .claude/skills/zyfai

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit/withdraw anytime.
262 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Create a subaccount (Safe smart wallet) linked to an EOA
  • Enable automated yield optimization using session keys
  • Deposit funds into the subaccount to start earning yield
  • Withdraw funds from the subaccount back to the EOA
  • Connect to Zyfai SDK using an API key and private key
  • Check if a subaccount is already deployed for a given EOA

How it works

Zyfai creates a non-custodial subaccount (Safe smart wallet) linked to the user's EOA. Funds deposited into this subaccount are automatically optimized across DeFi protocols using session keys.

Inputs & outputs

You give it
User's EOA address, private key, API key, chain ID, deposit/withdrawal amount
You get back
Subaccount address, deployment status, transaction results, yield-earning status

When to use zyfai

  • Earn yield on crypto
  • Setup automated DeFi rebalancing
  • Deploy subaccount for yield

About this skill

Zyfai — Yield for Any Wallet

Turn any Ethereum wallet into a yield-generating account.

What This Does

When a user wants to earn yield on their crypto, Zyfai creates a subaccount (Safe smart wallet) linked to their existing wallet (EOA). Funds deposited into this subaccount are automatically optimized across DeFi protocols. The user stays in full control and can withdraw anytime.

┌─────────────────┐      ┌──────────────────────┐
│   User's EOA    │ ───► │  Zyfai Subaccount    │
│  (their wallet) │      │  (Safe smart wallet) │
│                 │      │                      │
│  Owns & controls│      │  • Auto-rebalancing  │
│                 │      │  • Yield optimization│
│                 │      │  • Non-custodial     │
└─────────────────┘      └──────────────────────┘

Key points:

  • The subaccount is owned by the user's EOA — only they can withdraw
  • Session keys allow automated rebalancing but cannot withdraw to other addresses
  • Same EOA = same subaccount address across all chains

The Flow

1. DEPLOY    →  Create subaccount linked to user's wallet
2. SESSION   →  Enable automated yield optimization  
3. DEPOSIT   →  Send funds to subaccount (starts earning)
4. WITHDRAW  →  Pull funds back to wallet (anytime)

Prerequisites

  • API Key from sdk.zyf.ai (connect wallet to get one)
  • Private Key of the user's EOA (the agent must provide this)
  • Node.js 18+
npm install @zyfai/sdk viem

Supported Chains

ChainID
Arbitrum42161
Base8453
Plasma9745

Important: Always Use EOA Address

When calling SDK methods, always pass the EOA address (the user's wallet address) as userAddress — never the subaccount/Safe address. The SDK derives the subaccount address automatically from the EOA.

Step-by-Step

1. Connect to Zyfai

import { ZyfaiSDK } from "@zyfai/sdk";

const sdk = new ZyfaiSDK({ apiKey: "your-api-key" });

// Use the private key provided by the agent
await sdk.connectAccount(privateKey, 8453); // chainId

Important: Always use the private key that the agent has access to. The private key must correspond to the EOA you're operating on.

2. Deploy Subaccount

const userAddress = "0x..."; // User's EOA (NOT the subaccount address!)
const chainId = 8453; // Base

// Check if subaccount exists
const wallet = await sdk.getSmartWalletAddress(userAddress, chainId);
console.log(`Subaccount: ${wallet.address}`);
console.log(`Deployed: ${wallet.isDeployed}`);

// Deploy if needed
if (!wallet.isDeployed) {
  const result = await sdk.deploySafe(userAddress, chainId, "conservative");
  console.log("Subaccount deployed:", result.safeAddress);
}

Strategies:

  • "conservative" — Stable yield, lower risk
  • "aggressive" — Higher yield, higher risk

3. Enable Yield Optimization

await sdk.createSessionKey(userAddress, chainId);

This allows Zyfai to rebalance funds automatically. Session keys cannot withdraw to arbitrary addresses — only optimize within the protocol.

4. Deposit Funds

// Deposit 10 USDC (6 decimals)
await sdk.depositFunds(userAddress, chainId, "10000000");

Funds move from EOA → Subaccount and start earning yield immediately.

5. Withdraw Funds

// Withdraw everything
await sdk.withdrawFunds(userAddress, chainId);

// Or withdraw partial (5 USDC)
await sdk.withdrawFunds(userAddress, chainId, "5000000");

Funds return to the user's EOA. Withdrawals are processed asynchronously.

6. Disconnect

await sdk.disconnectAccount();

Complete Example

import { ZyfaiSDK } from "@zyfai/sdk";

async function startEarningYield(userAddress: string, privateKey: string) {
  const sdk = new ZyfaiSDK({ apiKey: process.env.ZYFAI_API_KEY! });
  const chainId = 8453; // Base
  
  // Connect using the agent's private key
  await sdk.connectAccount(privateKey, chainId);
  
  // Deploy subaccount if needed (always pass EOA as userAddress)
  const wallet = await sdk.getSmartWalletAddress(userAddress, chainId);
  if (!wallet.isDeployed) {
    await sdk.deploySafe(userAddress, chainId, "conservative");
    console.log("Subaccount created:", wallet.address);
  }
  
  // Enable automated optimization
  await sdk.createSessionKey(userAddress, chainId);
  
  // Deposit 100 USDC
  await sdk.depositFunds(userAddress, chainId, "100000000");
  console.log("Deposited! Now earning yield.");
  
  await sdk.disconnectAccount();
}

async function withdrawYield(userAddress: string, privateKey: string, amount?: string) {
  const sdk = new ZyfaiSDK({ apiKey: process.env.ZYFAI_API_KEY! });
  const chainId = 8453; // Base
  
  // Connect using the agent's private key
  await sdk.connectAccount(privateKey, chainId);
  
  // Withdraw funds (pass EOA as userAddress)
  if (amount) {
    // Partial withdrawal
    await sdk.withdrawFunds(userAddress, chainId, amount);
    console.log(`Withdrawn ${amount} (6 decimals) to EOA`);
  } else {
    // Full withdrawal
    await sdk.withdrawFunds(userAddress, chainId);
    console.log("Withdrawn all funds to EOA");
  }
  
  await sdk.disconnectAccount();
}

API Reference

MethodParamsDescription
connectAccount(privateKey, chainId)Authenticate with Zyfai
getSmartWalletAddress(userAddress, chainId)Get subaccount address & status
deploySafe(userAddress, chainId, strategy)Create subaccount
createSessionKey(userAddress, chainId)Enable auto-optimization
depositFunds(userAddress, chainId, amount)Deposit USDC (6 decimals)
withdrawFunds(userAddress, chainId, amount?)Withdraw (all if no amount)
getPositions(userAddress, chainId?)Get active DeFi positions
getAvailableProtocols(chainId)Get available protocols & pools
getAPYPerStrategy(crossChain?, days?, strategyType?)Get APY for conservative/aggressive strategies
getUserDetails()Get authenticated user details
getOnchainEarnings(walletAddress)Get earnings data
registerAgentOnIdentityRegistry(smartWallet, chainId)Register agent on ERC-8004 Identity Registry
disconnectAccount()End session

Note: All methods that take userAddress expect the EOA address, not the subaccount/Safe address.

Data Methods

getPositions

Get all active DeFi positions for a user across protocols. Optionally filter by chain.

Parameters:

ParameterTypeRequiredDescription
userAddressstringUser's EOA address
chainIdSupportedChainIdOptional: Filter by specific chain ID

Example:

// Get all positions across all chains
const positions = await sdk.getPositions("0xUser...");

// Get positions on Arbitrum only
const arbPositions = await sdk.getPositions("0xUser...", 42161);

Returns:

interface PositionsResponse {
  success: boolean;
  userAddress: string;
  positions: Position[];
}

getAvailableProtocols

Get available DeFi protocols and pools for a specific chain with APY data.

const protocols = await sdk.getAvailableProtocols(42161); // Arbitrum

protocols.protocols.forEach((protocol) => {
  console.log(`${protocol.name} (ID: ${protocol.id})`);
  if (protocol.pools) {
    protocol.pools.forEach((pool) => {
      console.log(`  Pool: ${pool.name} - APY: ${pool.apy || "N/A"}%`);
    });
  }
});

Returns:

interface ProtocolsResponse {
  success: boolean;
  chainId: SupportedChainId;
  protocols: Protocol[];
}

getUserDetails

Get current authenticated user details including smart wallet, chains, protocols, and settings. Requires SIWE authentication.

await sdk.connectAccount(privateKey, chainId);
const user = await sdk.getUserDetails();

console.log("Smart Wallet:", user.user.smartWallet);
console.log("Chains:", user.user.chains);
console.log("Has Active Session:", user.user.hasActiveSessionKey);

Returns:

interface UserDetailsResponse {
  success: boolean;
  user: {
    id: string;
    address: string;
    smartWallet?: string;
    chains: number[];
    protocols: Protocol[];
    hasActiveSessionKey: boolean;
    email?: string;
    strategy?: string;
    telegramId?: string;
    walletType?: string;
    autoSelectProtocols: boolean;
    autocompounding?: boolean;
    omniAccount?: boolean;
    crosschainStrategy?: boolean;
    agentName?: string;
    customization?: Record<string, string[]>;
  };
}

getAPYPerStrategy

Get global APY by strategy type (conservative or aggressive), time period, and chain configuration. Use this to compare expected returns between strategies before deploying.

Parameters:

ParameterTypeRequiredDescription
crossChainbooleanIf true, returns APY for cross-chain strategies; if false, single-chain
daysnumberPeriod over which APY is calculated. One of 7, 15, 30, 60
strategyTypestringStrategy risk profile. One of 'conservative' or 'aggressive'

Example:

// Get 7-day APY for conservative single-chain strategy
const conservativeApy = await sdk.getAPYPerStrategy(false, 7, 'conservative');
console.log("Conservative APY:", conservativeApy.data);

// Get 30-day APY for aggressive cross-chain strategy
const aggressiveApy = await sdk.getAPYPerStrategy(true, 30, 'aggressive');
console.log("Aggressive APY:", aggressiveApy.data);

// Compare strategies
const conservative = await sdk.getAPYPerStrategy(false, 30, 'conservative');
const aggressive = await sdk.getAPYPerStrategy(false, 30, 'aggressive');
console.log(`Conservative 30d APY: ${conservative.data[0]?.apy}%`);
console

---

*Content truncated.*

When not to use it

  • When the user does not want passive DeFi yield on their funds
  • When the user wants to withdraw funds to addresses other than their EOA
  • When the user does not have an API key or the private key of their EOA

Prerequisites

API Key from sdk.zyf.aiPrivate Key of the user's EOANode.js 18+

Limitations

  • Session keys cannot withdraw to arbitrary addresses
  • Requires the private key of the user's EOA to connect to the SDK
  • Withdrawals are processed asynchronously

How it compares

This skill automates the creation and management of a yield-generating subaccount, allowing for automated rebalancing and yield optimization, unlike manual DeFi interactions.

Compared to similar skills

zyfai side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
zyfai (this skill)06moReviewIntermediate
open-eth-terminal-agent07moReviewIntermediate
binary-options06moReviewIntermediate
telegram-bot-builder1066moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

open-eth-terminal-agent

jfarid27

An agent that can help users with creating and running open-eth-terminal scripts to support

00

binary-options

Signal-Execution-Labs

Binary Options trading via BinaryFaster. Execute CALL/PUT trades, manage positions, track results.

00

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

playwright-browser-automation

lackeyjb

Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.

29146

workflow-orchestration-patterns

wshobson

Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.

10117

codex-skill

feiskyer

Use when user asks to leverage codex, gpt-5, or gpt-5.1 to implement something (usually implement a plan or feature designed by Claude). Provides non-interactive automation mode for hands-off task execution without approval prompts.

12110

Search skills

Search the agent skills registry