home / skills / openclaw / skills / defi

defi skill

/skills/agisearch/defi

This skill manages DeFi protocol interactions across chains, swapping tokens, checking yields, and tracking positions with safety checks.

npx playbooks add skill openclaw/skills --skill defi

Review the files below or copy the command above to add this skill to your agents.

Files (2)
skill.md
9.2 KB
No content available

Overview

This skill manages DeFi protocol interactions across Ethereum, Polygon, Arbitrum, Optimism, Base, and Solana. It provides token price lookups, yield discovery, cross-chain bridging quotes, swap routing via DEX aggregators with referral support, and wallet balance checks. It is focused on producing quotes and transaction data; it never executes transactions without explicit user approval.

How this skill works

The skill queries public APIs (CoinGecko, DefiLlama, 1inch, Jupiter, LI.FI) to fetch prices, yields, TVL, and swap/bridge quotes. For EVM swaps it prepares 1inch quotes including a configurable referral fee; for Solana it uses Jupiter quotes and platform fee parameters. It aggregates balances using RPC calls and applies safety checks like price impact and slippage thresholds before returning transaction payloads for user signing.

When to use it

  • Get up-to-date token prices across chains and markets.
  • Find top yields or filter yield pools by token or chain.
  • Prepare swap quotes and transaction data with referral routing (EVM and Solana).
  • Estimate and compare cross-chain bridge outputs and durations.
  • Check wallet balances on EVM chains and Solana before making trades.

Best practices

  • Always display full quote details (src/dst amounts, price impact, gas/fees) and require explicit user confirmation before returning transactions.
  • Warn users if price impact > 1% or slippage > 3% and recommend reducing size or increasing tolerance.
  • Verify token allowances on EVM before attempting swaps to avoid failed transactions.
  • For bridges, confirm destination chain token addresses and check recent bridge security audits or status.
  • Use free public endpoints for quick insights but respect rate limits and back off on 429s.

Example use cases

  • Compare top USDC yield pools across Ethereum and Arbitrum and show top 5 by APY with TVL.
  • Quote a 1 ETH -> USDC swap on Ethereum via 1inch including 0.3% referral fee, display gas estimate and price impact, then return tx data after confirmation.
  • Get a Jupiter quote for swapping 1 SOL to USDC on Solana including 0.2% platform fee and show price impact.
  • Request a LI.FI bridge quote to move 100 USDC from Ethereum to Arbitrum, display expected output and estimated execution time.
  • Check an EVM wallet balance and token holdings via RPC, converting native balance to human-readable units.

FAQ

Does the skill execute transactions automatically?

No. It prepares quotes and transaction data but never signs or broadcasts transactions without explicit user action.

Which chains and aggregators are supported?

Supported chains include Ethereum, Arbitrum, Polygon, Optimism, Base, and Solana. Aggregators: 1inch for EVM, Jupiter for Solana, and LI.FI for cross-chain routing.

What safety checks are applied to swaps and bridges?

The skill warns on price impact > 1%, slippage > 3%, checks EVM token allowances, and prompts verification of bridge security before cross-chain transfers.