uniswap-liquidity

Manage Uniswap V4 liquidity positions in C# using Nethereum.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill uniswap-liquidity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uniswap-liquidity
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/uniswap-liquidity
Command: npx skills add https://github.com/Nethereum/Nethereum --skill uniswap-liquidity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Nethereum.Uniswap.

What problem does it solve?

Managing Uniswap V4 liquidity positions from .NET requires assembling complex multi-command transactions against the Position Manager contract. This Skill provides ready-to-use C# patterns for the full position lifecycle — minting, increasing, decreasing, collecting fees, rebalancing, and burning — using Nethereum's actions builder.

Core Features & Use Cases

  • Position Lifecycle Management: Mint new concentrated-liquidity positions as ERC-721 NFTs, increase or decrease liquidity, and burn positions, all via the Position Manager actions builder.
  • Fee Collection & Rebalancing: Collect accumulated fees with zero-liquidity decrease commands and atomically rebalance into new tick ranges in a single transaction.
  • Position Analytics: Query position liquidity, decode tick ranges, and calculate current token amounts and position value with built-in calculators.
  • Use Case: A DeFi portfolio service in .NET needs to automatically rebalance LP positions when prices move out of range. Use this Skill to decrease the old position, mint a new one at updated ticks, and settle the net token difference atomically.

Quick Start

Ask the AI to create a Uniswap V4 liquidity position in C# with Nethereum for an ETH/USDC pool with a specified tick range and deposit amounts.

Frequently Asked Questions about uniswap-liquidity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Uniswap V4 liquidity position in C#?

Use Nethereum's Position Manager actions builder to add a MintPosition command with the pool key, tick range, liquidity amount, and slippage limits, then submit via ModifyLiquiditiesRequestAndWaitForReceiptAsync. The minted NFT token ID is extracted from the transaction receipt.

How to collect fees from a Uniswap LP position with Nethereum?

Add a DecreaseLiquidity command with Liquidity set to zero, which collects accumulated fees without removing liquidity, followed by a TakePair command to receive the tokens. Multiple positions can be batched into one transaction.

Does Nethereum support Uniswap V4 position rebalancing?

Yes, Nethereum supports atomic rebalancing by combining DecreaseLiquidity on the old position and MintPosition for the new range in one transaction. CloseCurrency commands settle the net token difference between the two positions.

What NuGet package is needed for Uniswap liquidity in .NET?

Install the Nethereum.Uniswap NuGet package with dotnet add package Nethereum.Uniswap. It provides the UniswapV4 service, Position Manager actions builder, and position value and liquidity calculators.

How do I calculate token amounts for a Uniswap position?

Use the PositionValueCalculator's GetPositionValueAsync to get current token holdings by token ID, or the LiquidityCalculator's GetAmountsForLiquidityByTicks to convert liquidity units into token0 and token1 amounts for a given price and tick range.