Skill 03 defi operations
Skill vaquarkhan/web3-agent-skills/skills/skill-03-defi-operations
Production-grade Agent Skills for Web3 AI agents: 15 workflows, 6 MCP servers, DeFi/NFT/compliance guardrails, and VS Code/JetBrains installers.
npx -y skills add vaquarkhan/web3-agent-skills --skill skill-03-defi-operationsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Executes DeFi operations including token swaps, lending/borrowing, staking, liquidity provision, flash loans, perpetuals, and vault strategies. Use when interacting with Uniswap, Aave, Compound, Lido, or other DeFi protocols.
SKILL.md
2.7 KB, as published. Nobody here has run it
DeFi Operations
When to Use
- Swapping tokens on DEXs (Uniswap, Curve, 1inch)
- Lending/borrowing (Aave, Compound, Morpho)
- Staking (Lido stETH, EigenLayer restaking)
- Providing/removing liquidity (Uniswap V3, Curve)
- Flash loans (Aave, Balancer, dYdX)
- Perpetual trading (GMX, dYdX v4)
- Yield vaults (Yearn, ERC-4626 vaults)
Prerequisites
- MCP:
blockchain-rpc-server,defi-protocol-server,price-feed-server - Skills: skill-02 (contract calls), skill-12 (gas), skill-15 (MEV for swaps)
- Guardrails: simulate all txs; screen counterparties
Workflow
1. Swap
- Get quote from
defi-protocol-serveror 1inch API - Check price impact (< 1% for large trades; use TWAP if higher — skill-15)
- Verify router address against known-good list
- Set slippage tolerance (default 0.5%, max 3% without confirmation)
- Approve exact amount (never unlimited without explicit user consent)
- Execute swap; verify received amount ≥ minOut
2. Lend / Borrow
| Protocol | Supply | Borrow | Liquidation Threshold |
|---|---|---|---|
| Aave V3 | supply() | borrow() | Health factor > 1.5 recommended |
| Compound V3 | supply() | N/A (Comet) | Collateral factor varies |
| Morpho | Optimizer bundles | Peer-matched rates | Check LLTV |
Always maintain health factor buffer. Monitor oracle price feeds (skill-11).
3. Stake / Restake
- Lido:
submit()ETH → stETH; check rebasing vs wstETH for integrations - EigenLayer: deposit into strategy contracts; track withdrawal queues
- Liquid staking: verify validator set and slashing risk
4. Liquidity Provision
- Uniswap V3: select tick range; narrow ranges = higher IL risk
- Calculate impermanent loss before deposit
- Use
defi-protocol-serverfor current pool APR/TVL
5. Flash Loans
- Identify provider (Aave: 0.09% fee, Balancer: 0% on some pools)
- Build callback contract with atomic repay logic
- Simulate full transaction — revert if unprofitable
- Never use flash loans for unbounded external calls
Protocol References
See knowledge-base/protocols/ for addresses, ABIs, and subgraph endpoints per chain.
Risk Checklist
- Contract verified and on protocol allowlist
- Slippage and deadline set
- Health factor / collateral ratio safe
- Token approvals scoped to exact amount
- MEV protection enabled for swaps > $1,000 (skill-15)