微算力 · API 导航与自营网关
API 接入 EN
未登录登录
💰

端到端自动化流动性挖矿专家

full-lp-workflow · vv0.1.0
专业技能 安全 A 级 作者 wpank 公开目录收录
1.8k 下载 405 安装 8.2k 收藏 49.4k 浏览

简介

基于Uniswap的多智能体编排系统,实现从机会扫描到仓位进入的全自动化LP管理,双重确认机制保障资金安全。

原始描述

Full LP workflow from opportunity scanning to position entry. Autonomously finds the best LP opportunity, designs a strategy, assesses risk, executes any needed swaps, enters the position, and reports portfolio impact. Use when user has capital and wants end-to-end LP management. Most complex multi-agent orchestration in the system.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/full-lp-workflow/
其它 Agent解压到它自己的 skills 目录,目录名用 full-lp-workflow

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心应用场景:一键式 LP 部署

full-lp-workflow 是一个旨在将 DeFi 流动性提供(LP)操作完全自动化的编排技能。它适用于想要将闲置资金(例如 "我有 2 万美元")投入去中心化交易所赚取收益,但不清楚当前有哪些最优机会、也不知如何设计仓位策略的用户。该技能通过串联 6 个专业的 AI 子代理,将扫描市场、设计策略、风险评估、准备代币、注入流动性以及最终的投资组合分析整合为一个端到端工作流,用户只需输入资金规模和风险偏好,即可完成整个过程。

显著优点:深度编排与安全控制

该技能最大的优势在于其复杂的多代理编排和内置的双重用户确认机制。它不是简单地把工具罗列出来,而是让"机会扫描器"、"LP 策略师"、"风险评估师"、"交易执行器"、"流动性管理器"和"投资组合分析师"六个子代理依次运行,每个代理都接收了前序代理的上下文,确保决策基于完整信息。在资金安全上,技能强制在"代币交换"和"注入流动性"两个关键节点要求用户显式确认,任何风险评估结果为"否决"都会直接终止流程,明文强调"绝不自动执行",在自动化与安全性之间取得了很好的平衡。

潜在缺点与局限

作为一个纯编排层技能,其效力完全取决于下游 6 个子代理本身的安全性与准确性。如果"机会扫描器"给出的收益率估算失真,或"交易执行器"在链上遇到了未曾预料的 gas 费飙升,都可能导致最终收益不达预期甚至亏损。此外,技能本身缺乏动态市场应对能力,如果用户在确认期间市场剧烈波动,预设的策略和价格区间(±15%)可能很快失效,导致仓位立即处于非活跃状态。

适合的目标群体

此技能适合拥有一定闲置加密资产、对 DeFi 有一定了解但对手动管理流动性仓位感到繁琐的用户。特别适合那些相信被动收益潜力,但不愿花费大量时间盯着行情图表和频繁调整仓位的个人投资者。对于完全不了解"无常损失"、"活跃区间"等 DeFi 概念的新手,建议先理解基础知识后再使用,以免对潜在亏损感到困惑。

常规使用风险

  1. 子代理依赖风险:技能依赖的 6 个子代理目前来源为 T3 个人开发者,其本身的安全审计状态未知,尤其是直接操作资金的 trade-executor 和 liquidity-manager。任何一个子代理存在漏洞或恶意逻辑,都可能直接造成资产损失。
  2. Gas 费侵蚀收益:在以太坊主网上执行全流程可能产生 $15-$50 的 Gas 费,对于小额仓位(如少于 $1,000),交易成本会严重侵蚀甚至耗尽预期收益。
  3. 市场波动与搁浅风险:从策略生成到用户最终确认执行存在时间差,期间市场的大幅波动会使预设的价格区间迅速过时,导致资产被搁置在即将退出活跃状态的区间内,从而错过收益。
  4. 跨链资金问题:当技能扫描全链发现的最佳机会所在链上用户没有资金时,需额外执行跨链桥操作,这不仅增加成本和时间,也引入了桥合约的额外安全风险。

技能正文


name: full-lp-workflow description: >- Full LP workflow from opportunity scanning to position entry. Autonomously finds the best LP opportunity, designs a strategy, assesses risk, executes any needed swaps, enters the position, and reports portfolio impact. Use when user has capital and wants end-to-end LP management. Most complex multi-agent orchestration in the system. model: opus allowed-tools:

  • Task(subagent_type:opportunity-scanner)
  • Task(subagent_type:lp-strategist)
  • Task(subagent_type:risk-assessor)
  • Task(subagent_type:trade-executor)
  • Task(subagent_type:liquidity-manager)
  • Task(subagent_type:portfolio-analyst)
  • mcp__uniswap__check_safety_status
  • mcp__uniswap__get_agent_balance

Full LP Workflow

Overview

This is the most complex multi-agent orchestration in the system. It turns a single intent -- "I have $20K, find me the best yield" -- into a fully researched, risk-assessed, optimally-structured LP position through a 6-agent pipeline.

Why this is 10x better than calling agents individually:

  1. End-to-end automation: Manually, you'd need to scan opportunities, research pools, design a strategy, assess risk, potentially swap tokens, add liquidity, and verify -- each requiring different tools and expertise. This does it all in one command.
  2. Intelligent pipeline with compound context: Each agent builds on all prior agents' findings. The lp-strategist doesn't just get a token pair -- it gets the opportunity-scanner's full analysis of why this pool is optimal. The risk-assessor evaluates the actual strategy designed by the lp-strategist, not a generic assessment.
  3. Two user confirmation points: Before spending any money (swap) and before committing capital (LP entry), the skill pauses for explicit user approval. You stay in control.
  4. Conditional swap step: If you don't hold the right tokens for the LP position, the skill automatically handles the token swap -- but only after showing you exactly what it plans to do.
  5. Portfolio impact reporting: After entering the position, the portfolio-analyst shows you exactly how your portfolio changed, with ongoing monitoring instructions.
  6. Failure recovery at every stage: If any agent fails mid-pipeline, you see what was accomplished and get recovery suggestions.

When to Use

Activate when the user says anything like:

  • "I have $20K, find the best LP opportunity and enter"
  • "Autonomous LP: find yield and enter position"
  • "Full LP workflow with $10,000"
  • "Find me the best yield and set up a position"
  • "I want to LP but don't know where -- find the best option"
  • "Put $5K to work in Uniswap -- find the best opportunity"
  • "End-to-end LP: scan, strategize, and enter"
  • "What's the best LP opportunity right now? Set it up for me"

Do NOT use when the user already knows which pool they want (use manage-liquidity instead), just wants strategy comparison without execution (use lp-strategy), or just wants to scan without entering (use scan-opportunities).

Parameters

Parameter Required Default How to Extract
capital Yes -- Total capital to deploy: "$20,000", "10 ETH", "$5K"
chain No all Target chain or "all" for cross-chain scan
riskTolerance No moderate "conservative", "moderate", "aggressive"
pairPreference No -- Optional token pair preference: "ETH/USDC", "stablecoin pairs"
excludeTokens No -- Tokens to exclude: "PEPE, SHIB" (avoid memecoins, etc.)
capitalToken No auto-detect What token the capital is in: "USDC", "ETH", auto-detect from wallet

If the user doesn't provide capital amount, ask for it -- never guess how much to deploy.

Workflow

                          FULL LP WORKFLOW PIPELINE
  ┌─────────────────────────────────────────────────────────────────────┐
  │                                                                     │
  │  Step 1: SCAN (opportunity-scanner)                                 │
  │  ├── Scan LP opportunities across chains                            │
  │  ├── Filter by risk tolerance and capital size                      │
  │  ├── Rank top 3-5 by risk-adjusted yield                           │
  │  └── Output: Ranked Opportunity List                                │
  │          │                                                          │
  │          ▼ USER CHOICE POINT                                        │
  │  ┌───────────────────────────────────────────────────┐              │
  │  │  Present top opportunities to user.               │              │
  │  │  User picks one OR accepts recommendation (#1).   │              │
  │  └───────────────────────────────────────────────────┘              │
  │          │                                                          │
  │          ▼                                                          │
  │                                                                     │
  │  Step 2: STRATEGIZE (lp-strategist)                                 │
  │  ├── Design optimal strategy for chosen opportunity                 │
  │  ├── Version, fee tier, range width, rebalance plan                 │
  │  ├── Conservative/moderate/optimistic APY estimates                 │
  │  └── Output: LP Strategy Recommendation                             │
  │          │                                                          │
  │          ▼                                                          │
  │                                                                     │
  │  Step 3: RISK CHECK (risk-assessor)                                 │
  │  ├── Receives: opportunity data + strategy details                  │
  │  ├── Evaluates: IL, slippage, liquidity, smart contract             │
  │  ├── Decision: APPROVE / CONDITIONAL / VETO / HARD_VETO            │
  │  └── Output: Risk Assessment Report                                 │
  │          │                                                          │
  │          ▼ CONDITIONAL GATE                                         │
  │  ┌───────────────────────────────────────────────────┐              │
  │  │  APPROVE / COND. APPROVE → Continue               │              │
  │  │  VETO / HARD_VETO → STOP with full report         │              │
  │  └───────────────────────────────────────────────────┘              │
  │          │                                                          │
  │          ▼                                                          │
  │                                                                     │
  │  Step 4: SWAP IF NEEDED (trade-executor) -- CONDITIONAL             │
  │  ├── Check wallet balances vs required tokens                       │
  │  ├── If tokens needed: calculate swap amounts                       │
  │  ├── USER CONFIRMATION #1: "Swap X for Y to prepare for LP?"       │
  │  ├── Execute swap(s) if confirmed                                   │
  │  └── Output: Swap result OR "tokens already held"                   │
  │          │                                                          │
  │          ▼                                                          │
  │                                                                     │
  │  Step 5: ENTER POSITION (liquidity-manager)                         │
  │  ├── USER CONFIRMATION #2: "Add liquidity with these params?"      │
  │  ├── Handle approvals (Permit2)                                     │
  │  ├── Add liquidity at recommended range                             │
  │  ├── Wait for transaction confirmation                              │
  │  └── Output: Position ID, amounts deposited, tick range             │
  │          │                                                          │
  │          ▼                                                          │
  │                                                                     │
  │  Step 6: CONFIRM & REPORT (portfolio-analyst)                       │
  │  ├── Verify position was created successfully                       │
  │  ├── Show portfolio impact (before vs after)                        │
  │  ├── Monitoring instructions                                        │
  │  └── Output: Portfolio Report + Next Steps                          │
  │                                                                     │
  └─────────────────────────────────────────────────────────────────────┘

Step 0: Pre-Flight

Before starting the pipeline:

  1. Check safety status via mcp__uniswap__check_safety_status -- verify spending limits can accommodate the capital amount.
  2. Check wallet balance via mcp__uniswap__get_agent_balance on the target chain(s) -- verify the wallet has the stated capital.
  3. If either check fails, stop and inform the user before wasting agent compute.

Step 1: Scan Opportunities (opportunity-scanner)

Delegate to Task(subagent_type:opportunity-scanner) with:

Scan for LP opportunities with these parameters:
- Available capital: {capital}
- Chains: {chain or "all supported chains"}
- Risk tolerance: {riskTolerance}
- Type: "lp" (LP opportunities only)
- Minimum TVL: $50,000
- Top N: 5

Additional filters:
- Pair preference: {pairPreference or "none"}
- Exclude tokens: {excludeTokens or "none"}

Return the top 5 LP opportunities ranked by risk-adjusted yield.
Each opportunity must include fee APY, estimated IL, risk-adjusted yield,
TVL, volume, and risk rating.

Present to user with a choice:

Step 1/6: Opportunity Scan Complete

  Found 5 LP opportunities (filtered from 200+ pools):

  #  Pool                Chain    Fee APY  Est. IL  Net APY  Risk    TVL
  1  WETH/USDC 0.05%     ETH      21%      -6%      15%     MEDIUM  $332M
  2  WETH/USDC 0.05%     Base     18%      -5%      13%     MEDIUM  $45M
  3  ARB/WETH 0.30%      Arb      35%      -12%     23%     HIGH    $12M
  4  USDC/USDT 0.01%     ETH      8%       -0.1%    7.9%    LOW     $200M
  5  cbETH/WETH 0.05%    Base     12%      -3%      9%      LOW     $28M

  Recommended: #1 (WETH/USDC 0.05% on Ethereum) — best balance of yield and risk

  Which opportunity would you like to pursue? (1-5, or "1" to accept recommendation)

Wait for user selection before proceeding.

Step 2: Design Strategy (lp-strategist)

Delegate to Task(subagent_type:lp-strategist) with the chosen opportunity:

Design an optimal LP strategy for this opportunity:

Opportunity details (from opportunity-scanner):
{Full opportunity data from Step 1 for chosen pool}

LP parameters:
- Capital: {capital}
- Risk tolerance: {riskTolerance}
- Chain: {chain of chosen opportunity}

Provide:
1. Recommended version and fee tier (with rationale)
2. Optimal tick range (lower/upper prices, width %)
3. Conservative/moderate/optimistic APY and IL estimates
4. Rebalance strategy (trigger, frequency, estimated cost)
5. Comparison to the next-best alternative

Present to user:

Step 2/6: Strategy Designed

  Pool:     WETH/USDC 0.05% (V3, Ethereum)
  Range:    $1,700 - $2,300 (±15%, medium width)
  Expected: 15% net APY (moderate estimate)

  Strategy Details:
    Fee APY (moderate): 21%
    Estimated IL: -6%
    Net APY: 15%
    Rebalance: every 2-3 weeks (trigger: price within 10% of boundary)
    Rebalance cost: ~$15/rebalance on Ethereum

  Proceeding to risk assessment...

Step 3: Risk Assessment (risk-assessor)

Delegate to Task(subagent_type:risk-assessor) with compound context:

Evaluate risk for this LP strategy:

Operation: add liquidity
Token pair: {token0}/{token1}
Pool: {pool address}
Chain: {chain}
Capital: {capital}
Risk tolerance: {riskTolerance}

Strategy context (from lp-strategist):
{Full strategy recommendation from Step 2}

Opportunity context (from opportunity-scanner):
{Key metrics from Step 1: TVL, volume trend, risk rating}

Evaluate: impermanent loss risk, slippage risk (entry/exit), liquidity risk,
smart contract risk. Provide APPROVE/CONDITIONAL_APPROVE/VETO/HARD_VETO.

Conditional gate (same logic as research-and-trade):

Decision Action
APPROVE Present risk summary, proceed to Step 4
CONDITIONAL_APPROVE Show conditions, ask user if they accept
VETO STOP. Show opportunity + strategy + veto reason. Suggest fallbacks.
HARD_VETO STOP. Show reason. Non-negotiable.

Present to user (APPROVE case):

Step 3/6: Risk Assessment Passed

  Decision: APPROVE
  Composite Risk: MEDIUM
  IL Risk: MEDIUM (8.2% annual estimate for volatile pair)
  Slippage: LOW (deep pool, entry < 0.1% impact)
  Liquidity: LOW (TVL 6,640x your position)
  Smart Contract: LOW (V3, established pool)

  Proceeding to prepare tokens...

Step 4: Swap If Needed (trade-executor) -- Conditional

Check wallet balances against required token amounts for the LP position:

  1. The strategy specifies how much of each token is needed (e.g., 50/50 split for a centered range).
  2. Check current wallet holdings via mcp__uniswap__get_agent_balance.
  3. Calculate what swaps are needed (if any).

If no swaps needed:

Step 4/6: Token Preparation — Skipped

  You already hold sufficient WETH and USDC for this position.
  No swaps required.

If swaps needed, present and ask USER CONFIRMATION #1:

Step 4/6: Token Preparation Required

  Your position needs:
    0.5 WETH  (~$980)
    980 USDC  (~$980)

  You currently hold:
    2.0 WETH  ($3,920)
    0 USDC    ($0)

  Proposed swap:
    Sell 0.5 WETH → Buy ~980 USDC
    Estimated slippage: 0.05%
    Gas: ~$8

  Approve this swap to prepare tokens for LP? (yes/no)

Only execute the swap if the user explicitly confirms. If the user declines, stop the pipeline and present what was accomplished (scan + strategy + risk assessment).

Step 5: Enter Position (liquidity-manager)

Present the full LP entry details and ask USER CONFIRMATION #2:

Step 5/6: Ready to Add Liquidity

  Pool:     WETH/USDC 0.05% (V3, Ethereum)
  Deposit:
    0.5 WETH  (~$980)
    980 USDC  (~$980)
    Total:    ~$1,960

  Range:
    Lower: $1,700 (tick -204714)
    Upper: $2,300 (tick -199514)
    Current: $1,963 — IN RANGE
    Width: ±15% (medium)

  Expected Fee APY: ~15-21% (based on 7d pool data)

  Add liquidity with these parameters? (yes/no)

Only proceed if the user confirms. Then delegate to Task(subagent_type:liquidity-manager):

Add liquidity to this pool:

Pool: {pool address}
Chain: {chain}
Version: {version}
Token0: {token0 address} — Amount: {amount0}
Token1: {token1 address} — Amount: {amount1}
Tick lower: {tick_lower}
Tick upper: {tick_upper}

Strategy context:
- Range strategy: {medium/narrow/wide}
- From lp-strategist recommendation

Execute: handle approvals, simulate, route through safety-guardian, add liquidity,
wait for confirmation. Return position ID and actual amounts deposited.

Step 6: Confirm & Report (portfolio-analyst)

Delegate to Task(subagent_type:portfolio-analyst) with the new position:

Report on the portfolio impact of this new LP position:

New position:
- Position ID: {position_id from Step 5}
- Pool: {pool_address}
- Chain: {chain}
- Tokens deposited: {amounts}
- Tick range: {lower} to {upper}
- Transaction: {tx_hash}

Wallet address: {wallet_address}

Provide:
1. New position details and current status (in-range confirmation)
2. Portfolio impact (if other positions exist, show before/after composition)
3. Total portfolio value across all chains
4. Monitoring recommendations

Present final result:

Step 6/6: Position Confirmed & Portfolio Updated

  New Position: #456789
  Pool:     WETH/USDC 0.05% (V3, Ethereum)
  Status:   IN RANGE
  Value:    $1,960

  Deposited:
    0.5 WETH  ($980)
    980 USDC  ($980)

  Range:
    $1,700 — $2,300 (current: $1,963)

  Expected Returns:
    Fee APY: 15-21% (moderate-optimistic)
    Est. IL: -5 to -8% annualized
    Net: 9-15% annualized

  Portfolio Impact:
    Total LP Value:  $1,960 (new) + $45,000 (existing) = $46,960
    LP Allocation:   42% WETH, 35% USDC, 23% other
    Chain Split:     85% Ethereum, 15% Base

  ──────────────────────────────────────
  Pipeline Summary
  ──────────────────────────────────────
  Scan:      5 opportunities found, #1 selected
  Strategy:  V3 0.05%, ±15% range, bi-weekly rebalance
  Risk:      APPROVED (MEDIUM composite)
  Swap:      0.5 WETH → 980 USDC (preparation)
  Position:  #456789 — IN RANGE
  Cost:      $15.20 total gas (swap + LP entry)

  Next Steps:
  - Monitor: "How are my positions doing?"
  - Rebalance when needed: "Rebalance position #456789"
  - Collect fees: "Collect fees from position #456789"

Critical Decision Points

These are the moments where the skill must stop and ask rather than assume:

Situation Action
Capital amount not specified Ask: "How much capital would you like to deploy?"
Multiple good opportunities Present top 3-5, let user choose
Risk-assessor VETO Stop. Show research + strategy + veto reason.
Swap needed for token preparation USER CONFIRMATION #1: show swap details, ask to proceed
Ready to add liquidity USER CONFIRMATION #2: show position details, ask to proceed
Capital exceeds safety spending limit Stop. Show limit. Suggest reducing amount or adjusting limits.
Wallet doesn't have stated capital Stop. Show actual balance. Ask to adjust amount.
Best opportunity is on a different chain than wallet funds Explain cross-chain situation, suggest bridge or chain choice

Partial Completion Recovery

If the pipeline fails mid-way, report what was accomplished and what remains:

LP Workflow — Partial Completion

  Completed:
    [done] Step 1: Scan — 5 opportunities found, #1 selected
    [done] Step 2: Strategy — V3 0.05%, ±15% range designed
    [done] Step 3: Risk — APPROVED (MEDIUM)
    [FAIL] Step 4: Swap — Transaction reverted (insufficient gas)

  Remaining:
    [ ] Step 5: Add liquidity
    [ ] Step 6: Portfolio report

  Recovery Options:
    - Ensure sufficient ETH for gas and retry: "Continue LP workflow"
    - Add liquidity manually with the strategy above: "Add liquidity to WETH/USDC 0.05%"
    - Start over: "Full LP workflow with $X"

Output Format

Successful Pipeline (all 6 steps)

Full LP Workflow Complete

  Opportunity: {pool_pair} {fee}% on {chain}
  Strategy:    {version}, {range_width} range, {rebalance_frequency} rebalance
  Risk:        {decision} ({composite_risk})
  Position:    #{position_id} — {status}
  Value:       ${total_value}

  Returns (moderate estimate):
    Fee APY: {fee_apy}%
    Est. IL: {il}%
    Net APY: {net_apy}%

  Cost: ${total_gas} gas across {n} transactions

  Pipeline: Scan -> Strategy -> Risk -> Swap -> Enter -> Confirm (all passed)

Important Notes

  • This is the most complex skill. It orchestrates 6 agents with 2 user confirmation points and a conditional swap step. Each agent receives compound context from all predecessors.
  • Two explicit confirmations: Before any swap and before adding liquidity. The user must say "yes" at both gates.
  • Conditional swap: Step 4 only executes if the user doesn't already hold the right tokens. If they do, it's skipped entirely.
  • Chain considerations: If scanning "all" chains, the best opportunity might be on a chain where the user's funds aren't located. The skill should flag this and suggest bridging or narrowing the chain filter.
  • Gas budget: On Ethereum, the full pipeline (swap + LP) costs $15-50 in gas. For small positions (< $1K), warn that gas costs significantly eat into returns.
  • Never auto-execute: Despite being an "autonomous" workflow, every spend of user capital requires explicit confirmation.

Error Handling

Error User-Facing Message Suggested Action
No opportunities found "No LP opportunities match your criteria on {chain}." Broaden chain filter or lower minTVL
Opportunity-scanner fails "Opportunity scan failed. Cannot identify LP targets." Try scan-opportunities directly
LP-strategist fails "Strategy design failed for {pool}. Scan results preserved." Try lp-strategy or optimize-lp directly
Risk-assessor VETO "Risk assessment vetoed: {reason}. Strategy: {summary}." Pick a different opportunity or reduce size
Risk-assessor HARD_VETO "Strategy blocked: {reason}. This cannot be overridden." Choose a lower-risk opportunity
Insufficient balance for swap "Not enough {token} to prepare for LP. Have {X}, need {Y}." Reduce capital or acquire tokens
Swap execution fails "Token swap failed: {reason}. Strategy and risk data preserved." Retry or swap manually
Liquidity add fails "Failed to add liquidity: {reason}. Tokens are still in your wallet." Retry or use manage-liquidity directly
Position not confirmed "Position created but not yet confirmed on-chain. Check back in a moment." Wait and check with track-performance
Safety spending limit exceeded "Capital of ${X} exceeds spending limit of ${Y}." Reduce amount or adjust safety config
Wallet not configured "No wallet configured. Cannot execute transactions." Set up wallet with setup-agent-wallet
User declines swap confirmation "Token swap cancelled. Strategy preserved — you can proceed manually." Use manage-liquidity with manual prep
User declines LP confirmation "LP entry cancelled. All prior research is shown above." Adjust parameters and retry

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

finance-accountingautomationdata-analyticsdefiyield-farming

同类 Skill