{
  "schemaVersion": "1.0",
  "item": {
    "slug": "rebalance-position",
    "name": "Uniswap Rebalance Position",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/wpank/rebalance-position",
    "canonicalUrl": "https://clawhub.ai/wpank/rebalance-position",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/rebalance-position",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=rebalance-position",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/rebalance-position"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/rebalance-position",
    "agentPageUrl": "https://openagent3.xyz/skills/rebalance-position/agent",
    "manifestUrl": "https://openagent3.xyz/skills/rebalance-position/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/rebalance-position/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "When a V3/V4 LP position goes out of range, it stops earning fees. This skill handles the full rebalance workflow: collect accumulated fees, close the old position, calculate a new optimal range centered on the current price, and open a new position — all in a single operation.\n\nThis is a high-value skill because out-of-range positions are effectively dead capital. The difference between a monitored position that gets rebalanced promptly and an unmonitored one can be 15-30% APY in lost fee revenue."
      },
      {
        "title": "When to Use",
        "body": "Activate when the user says:\n\n\"Rebalance my position\"\n\"My position is out of range\"\n\"Adjust my LP range\"\n\"Re-center my liquidity\"\n\"Position #12345 is out of range, fix it\"\n\"My ETH/USDC position stopped earning\"\n\"Move my range to the current price\"\n\"My LP isn't earning fees anymore\"\n\nAlso proactively suggest rebalancing when:\n\nA track-performance or portfolio-report shows an out-of-range position\nThe user asks \"why am I not earning fees?\""
      },
      {
        "title": "Parameters",
        "body": "ParameterRequiredDefaultHow to ExtractpositionIdNo*—Position ID, or \"my ETH/USDC position\" (resolved by search)chainNoethereumChain where the position livesnewRangeNoAuto-optimal\"narrow\" (±5%), \"medium\" (±15%), \"wide\" (±50%)\n\n*If no position ID: search with get_positions_by_owner, filter for out-of-range positions, and confirm with the user."
      },
      {
        "title": "Pre-Rebalance Analysis",
        "body": "Before executing anything, gather data and present the situation to the user:\n\nStep 1: IDENTIFY THE POSITION\n├── If position ID given → fetch via get_position\n├── If \"my X/Y position\" → search via get_positions_by_owner\n│   ├── Filter by token pair and out-of-range status\n│   ├── If multiple out-of-range → list all, ask which one\n│   └── If none out-of-range → \"All your positions are in range!\"\n└── Validate: confirm the position IS actually out of range\n\nStep 2: ANALYZE CURRENT SITUATION\n├── Current pool state via get_pool_info\n│   ├── Current price\n│   ├── Pool TVL, volume, fee APY\n│   └── Tick distribution (where is liquidity concentrated?)\n├── Position details\n│   ├── Current tick range (lower, upper)\n│   ├── How far out of range (above or below?)\n│   ├── Uncollected fees\n│   ├── Current token balances in position\n│   └── Time since going out of range (if estimable)\n└── Cost-benefit calculation\n    ├── Estimated gas cost for full rebalance (remove + add = ~$30-60 on mainnet)\n    ├── Estimated daily fee revenue if rebalanced (from pool APY + position size)\n    ├── Break-even time: gas_cost / daily_revenue\n    └── If break-even > 30 days → WARN that rebalancing may not be worth it"
      },
      {
        "title": "Present the Rebalance Plan",
        "body": "Before executing, show the user exactly what will happen:\n\nRebalance Plan for Position #12345\n\n  Current Situation:\n    Pool:      WETH/USDC 0.05% (V3, Ethereum)\n    Status:    OUT OF RANGE ⚠ (price moved above your range)\n    Current:   $1,963\n    Your range: $1,500 - $1,800 (position is 9% above upper bound)\n    \n  Uncollected Fees: 0.01 WETH ($19.60) + 15.20 USDC ($15.20)\n  Position Value: ~$3,940\n\n  Proposed New Range:\n    Strategy: Medium (±15%)\n    Lower:    $1,668 (current - 15%)\n    Upper:    $2,258 (current + 15%)\n    Expected time-in-range: ~80-85%\n\n  Cost:\n    Gas (remove + add): ~$35\n    Break-even: ~2 days at current fee APY\n\n  Steps:\n    1. Collect uncollected fees ($34.80)\n    2. Remove all liquidity from position #12345\n    3. Add liquidity at new range ($1,668 - $2,258)\n    4. New position created with new NFT ID\n\n  Proceed? (yes/no)"
      },
      {
        "title": "Execution (after user confirms)",
        "body": "Step 3: DELEGATE TO LIQUIDITY-MANAGER\n├── The agent executes atomically:\n│   a. Collect fees from old position\n│   b. Remove 100% liquidity from old position\n│   c. Calculate new tick range based on:\n│      - Current pool price\n│      - Selected range strategy (narrow/medium/wide)\n│      - Pool tick spacing\n│   d. Approve tokens for new position (if needed)\n│   e. Add liquidity at new range\n│   f. Each step validated by safety-guardian\n└── Returns: old position closed, fees collected, new position ID, new range, tx hashes\n\nStep 4: PRESENT RESULT\n├── Confirmation of old position closure\n├── Fees collected (amounts + USD)\n├── New position details (ID, range, amounts deposited)\n├── Total gas cost for the operation\n├── Net cost/benefit of the rebalance\n└── Next steps for monitoring"
      },
      {
        "title": "Range Strategy Guide",
        "body": "When the user doesn't specify a range, use this decision framework:\n\nPair TypeRecommended RangeWidthRationaleStable-stableNarrow±0.5%Price barely moves; maximize capital efficiencyStable-volatileMedium±15%Balance between earning and avoiding rebalanceVolatile-volatileWide±30%Reduce rebalance frequency; accept lower APYUser says \"aggressive\"Narrow±5%Higher fees but frequent rebalancing neededUser says \"passive\"Wide±50%Low maintenance, lower returnsSmall position (<$1K)Wide±50%Gas costs make frequent rebalancing uneconomical"
      },
      {
        "title": "When NOT to Rebalance",
        "body": "Proactively advise against rebalancing in these situations:\n\nSituationAdvicePosition size < 10x gas cost\"Gas would cost ${gas} but your position is only ${value}.\"Price is near range boundary (within 2%)\"Price is close to your range — wait to see if it re-enters.\"Position went out of range < 1 hour ago\"Give it time — price may return to your range.\"User has no strong view on direction\"Consider a wider range to reduce future rebalances.\"Break-even time > 14 days\"At current fee rates, rebalancing won't pay for itself for {days} days.\""
      },
      {
        "title": "Successful Rebalance",
        "body": "Position Rebalanced Successfully\n\n  Old Position: #12345 (CLOSED)\n    Received: 0.52 WETH + 950 USDC ($1,970)\n    Fees collected: 0.01 WETH + 15.20 USDC ($34.80)\n\n  New Position: #67890\n    Pool: WETH/USDC 0.05% (V3, Ethereum)\n    Deposited: 0.51 WETH + 965 USDC ($1,960)\n    Range: $1,668 - $2,258 (medium, ±15%)\n    Current: $1,963 — IN RANGE ✓\n    \n  Cost:\n    Gas: $32.50 (2 transactions)\n    \n  Net: Position rebalanced with $2.30 lost to gas\n       Now earning ~15-21% APY in fees\n\n  Txs:\n    Remove: https://etherscan.io/tx/0x...\n    Add:    https://etherscan.io/tx/0x...\n\n  Monitor: \"How are my positions doing?\" or \"Track position #67890\""
      },
      {
        "title": "Position Already In Range",
        "body": "Position #12345 is IN RANGE ✓\n\n  Pool:    WETH/USDC 0.05% (V3, Ethereum)\n  Current: $1,963\n  Range:   $1,700 - $2,300\n  Status:  Actively earning fees\n\n  No rebalance needed. Your position is healthy.\n  \n  Uncollected fees: $34.80\n  Want to collect them? (This doesn't affect your position.)"
      },
      {
        "title": "Important Notes",
        "body": "Always confirm before executing. Rebalancing involves closing and reopening a position — it's irreversible.\nGas matters. On Ethereum mainnet, a full rebalance costs $30-60 in gas. On L2s (Base, Arbitrum), it's < $1. Factor this into recommendations.\nIL is locked in. When you close a position, any impermanent loss becomes realized. Mention this if the position has significant IL.\nNew NFT ID. The rebalanced position gets a new NFT token ID. The old one is burned. Make sure the user understands this.\nV2 positions cannot be rebalanced — they have full range. If a user asks to rebalance a V2 position, explain that V2 positions cover the entire price range and don't go \"out of range.\"\nSlippage on exit. For large positions relative to pool TVL, exiting may cause slippage. Warn if position is > 5% of pool TVL."
      },
      {
        "title": "Error Handling",
        "body": "ErrorUser-Facing MessageSuggested ActionPosition not found\"Position #{id} not found.\"Check ID and chainPosition already in range\"Position is already in range — no rebalance needed.\"Show position status insteadV2 position\"V2 positions cover the full price range and can't go out of range.\"Explain V2 vs V3 differencesWallet not configured\"No wallet configured for transactions.\"Set WALLET_TYPE + PRIVATE_KEYInsufficient gas\"Not enough ETH for gas.\"Fund wallet with ETHSafety check failed\"Safety blocked the rebalance: {reason}\"Review safety configurationRemove tx failed\"Failed to remove liquidity: {reason}\"Check position status and try againAdd tx failed\"Removed old position but failed to add new one.\"Tokens are in wallet; retry add manuallyliquidity-manager unavailable\"Liquidity agent is not available.\"Check agent configuration"
      }
    ],
    "body": "Rebalance Position\nOverview\n\nWhen a V3/V4 LP position goes out of range, it stops earning fees. This skill handles the full rebalance workflow: collect accumulated fees, close the old position, calculate a new optimal range centered on the current price, and open a new position — all in a single operation.\n\nThis is a high-value skill because out-of-range positions are effectively dead capital. The difference between a monitored position that gets rebalanced promptly and an unmonitored one can be 15-30% APY in lost fee revenue.\n\nWhen to Use\n\nActivate when the user says:\n\n\"Rebalance my position\"\n\"My position is out of range\"\n\"Adjust my LP range\"\n\"Re-center my liquidity\"\n\"Position #12345 is out of range, fix it\"\n\"My ETH/USDC position stopped earning\"\n\"Move my range to the current price\"\n\"My LP isn't earning fees anymore\"\n\nAlso proactively suggest rebalancing when:\n\nA track-performance or portfolio-report shows an out-of-range position\nThe user asks \"why am I not earning fees?\"\nParameters\nParameter\tRequired\tDefault\tHow to Extract\npositionId\tNo*\t—\tPosition ID, or \"my ETH/USDC position\" (resolved by search)\nchain\tNo\tethereum\tChain where the position lives\nnewRange\tNo\tAuto-optimal\t\"narrow\" (±5%), \"medium\" (±15%), \"wide\" (±50%)\n\n*If no position ID: search with get_positions_by_owner, filter for out-of-range positions, and confirm with the user.\n\nWorkflow\nPre-Rebalance Analysis\n\nBefore executing anything, gather data and present the situation to the user:\n\nStep 1: IDENTIFY THE POSITION\n├── If position ID given → fetch via get_position\n├── If \"my X/Y position\" → search via get_positions_by_owner\n│   ├── Filter by token pair and out-of-range status\n│   ├── If multiple out-of-range → list all, ask which one\n│   └── If none out-of-range → \"All your positions are in range!\"\n└── Validate: confirm the position IS actually out of range\n\nStep 2: ANALYZE CURRENT SITUATION\n├── Current pool state via get_pool_info\n│   ├── Current price\n│   ├── Pool TVL, volume, fee APY\n│   └── Tick distribution (where is liquidity concentrated?)\n├── Position details\n│   ├── Current tick range (lower, upper)\n│   ├── How far out of range (above or below?)\n│   ├── Uncollected fees\n│   ├── Current token balances in position\n│   └── Time since going out of range (if estimable)\n└── Cost-benefit calculation\n    ├── Estimated gas cost for full rebalance (remove + add = ~$30-60 on mainnet)\n    ├── Estimated daily fee revenue if rebalanced (from pool APY + position size)\n    ├── Break-even time: gas_cost / daily_revenue\n    └── If break-even > 30 days → WARN that rebalancing may not be worth it\n\nPresent the Rebalance Plan\n\nBefore executing, show the user exactly what will happen:\n\nRebalance Plan for Position #12345\n\n  Current Situation:\n    Pool:      WETH/USDC 0.05% (V3, Ethereum)\n    Status:    OUT OF RANGE ⚠ (price moved above your range)\n    Current:   $1,963\n    Your range: $1,500 - $1,800 (position is 9% above upper bound)\n    \n  Uncollected Fees: 0.01 WETH ($19.60) + 15.20 USDC ($15.20)\n  Position Value: ~$3,940\n\n  Proposed New Range:\n    Strategy: Medium (±15%)\n    Lower:    $1,668 (current - 15%)\n    Upper:    $2,258 (current + 15%)\n    Expected time-in-range: ~80-85%\n\n  Cost:\n    Gas (remove + add): ~$35\n    Break-even: ~2 days at current fee APY\n\n  Steps:\n    1. Collect uncollected fees ($34.80)\n    2. Remove all liquidity from position #12345\n    3. Add liquidity at new range ($1,668 - $2,258)\n    4. New position created with new NFT ID\n\n  Proceed? (yes/no)\n\nExecution (after user confirms)\nStep 3: DELEGATE TO LIQUIDITY-MANAGER\n├── The agent executes atomically:\n│   a. Collect fees from old position\n│   b. Remove 100% liquidity from old position\n│   c. Calculate new tick range based on:\n│      - Current pool price\n│      - Selected range strategy (narrow/medium/wide)\n│      - Pool tick spacing\n│   d. Approve tokens for new position (if needed)\n│   e. Add liquidity at new range\n│   f. Each step validated by safety-guardian\n└── Returns: old position closed, fees collected, new position ID, new range, tx hashes\n\nStep 4: PRESENT RESULT\n├── Confirmation of old position closure\n├── Fees collected (amounts + USD)\n├── New position details (ID, range, amounts deposited)\n├── Total gas cost for the operation\n├── Net cost/benefit of the rebalance\n└── Next steps for monitoring\n\nRange Strategy Guide\n\nWhen the user doesn't specify a range, use this decision framework:\n\nPair Type\tRecommended Range\tWidth\tRationale\nStable-stable\tNarrow\t±0.5%\tPrice barely moves; maximize capital efficiency\nStable-volatile\tMedium\t±15%\tBalance between earning and avoiding rebalance\nVolatile-volatile\tWide\t±30%\tReduce rebalance frequency; accept lower APY\nUser says \"aggressive\"\tNarrow\t±5%\tHigher fees but frequent rebalancing needed\nUser says \"passive\"\tWide\t±50%\tLow maintenance, lower returns\nSmall position (<$1K)\tWide\t±50%\tGas costs make frequent rebalancing uneconomical\nWhen NOT to Rebalance\n\nProactively advise against rebalancing in these situations:\n\nSituation\tAdvice\nPosition size < 10x gas cost\t\"Gas would cost ${gas} but your position is only ${value}.\"\nPrice is near range boundary (within 2%)\t\"Price is close to your range — wait to see if it re-enters.\"\nPosition went out of range < 1 hour ago\t\"Give it time — price may return to your range.\"\nUser has no strong view on direction\t\"Consider a wider range to reduce future rebalances.\"\nBreak-even time > 14 days\t\"At current fee rates, rebalancing won't pay for itself for {days} days.\"\nOutput Format\nSuccessful Rebalance\nPosition Rebalanced Successfully\n\n  Old Position: #12345 (CLOSED)\n    Received: 0.52 WETH + 950 USDC ($1,970)\n    Fees collected: 0.01 WETH + 15.20 USDC ($34.80)\n\n  New Position: #67890\n    Pool: WETH/USDC 0.05% (V3, Ethereum)\n    Deposited: 0.51 WETH + 965 USDC ($1,960)\n    Range: $1,668 - $2,258 (medium, ±15%)\n    Current: $1,963 — IN RANGE ✓\n    \n  Cost:\n    Gas: $32.50 (2 transactions)\n    \n  Net: Position rebalanced with $2.30 lost to gas\n       Now earning ~15-21% APY in fees\n\n  Txs:\n    Remove: https://etherscan.io/tx/0x...\n    Add:    https://etherscan.io/tx/0x...\n\n  Monitor: \"How are my positions doing?\" or \"Track position #67890\"\n\nPosition Already In Range\nPosition #12345 is IN RANGE ✓\n\n  Pool:    WETH/USDC 0.05% (V3, Ethereum)\n  Current: $1,963\n  Range:   $1,700 - $2,300\n  Status:  Actively earning fees\n\n  No rebalance needed. Your position is healthy.\n  \n  Uncollected fees: $34.80\n  Want to collect them? (This doesn't affect your position.)\n\nImportant Notes\nAlways confirm before executing. Rebalancing involves closing and reopening a position — it's irreversible.\nGas matters. On Ethereum mainnet, a full rebalance costs $30-60 in gas. On L2s (Base, Arbitrum), it's < $1. Factor this into recommendations.\nIL is locked in. When you close a position, any impermanent loss becomes realized. Mention this if the position has significant IL.\nNew NFT ID. The rebalanced position gets a new NFT token ID. The old one is burned. Make sure the user understands this.\nV2 positions cannot be rebalanced — they have full range. If a user asks to rebalance a V2 position, explain that V2 positions cover the entire price range and don't go \"out of range.\"\nSlippage on exit. For large positions relative to pool TVL, exiting may cause slippage. Warn if position is > 5% of pool TVL.\nError Handling\nError\tUser-Facing Message\tSuggested Action\nPosition not found\t\"Position #{id} not found.\"\tCheck ID and chain\nPosition already in range\t\"Position is already in range — no rebalance needed.\"\tShow position status instead\nV2 position\t\"V2 positions cover the full price range and can't go out of range.\"\tExplain V2 vs V3 differences\nWallet not configured\t\"No wallet configured for transactions.\"\tSet WALLET_TYPE + PRIVATE_KEY\nInsufficient gas\t\"Not enough ETH for gas.\"\tFund wallet with ETH\nSafety check failed\t\"Safety blocked the rebalance: {reason}\"\tReview safety configuration\nRemove tx failed\t\"Failed to remove liquidity: {reason}\"\tCheck position status and try again\nAdd tx failed\t\"Removed old position but failed to add new one.\"\tTokens are in wallet; retry add manually\nliquidity-manager unavailable\t\"Liquidity agent is not available.\"\tCheck agent configuration"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wpank/rebalance-position",
    "publisherUrl": "https://clawhub.ai/wpank/rebalance-position",
    "owner": "wpank",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/rebalance-position",
    "downloadUrl": "https://openagent3.xyz/downloads/rebalance-position",
    "agentUrl": "https://openagent3.xyz/skills/rebalance-position/agent",
    "manifestUrl": "https://openagent3.xyz/skills/rebalance-position/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/rebalance-position/agent.md"
  }
}