Skip to content
Agent Orchestration
Skill

/lp-integration

Integrate Uniswap liquidity provisioning (LP) into applications via the LP REST API. Use when the user says "LP API", "liquidity provisioning API", "provide liquidity programmatically", "create LP position via API", "add liquidity via API", "increase liquidity", "decrease

BOOST
From plugin
uniswap-ai
23418 skills2 agents1 MCP
Install
$ npx -y skills add uniswap/uniswap-ai --skill lp-integration --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/lp-integration

Context preview

The summary Claude sees to decide when to auto-load this skill.

Integrate Uniswap liquidity provisioning (LP) into applications via the LP REST API. Use when the user says "LP API", "liquidity provisioning API", "provide liquidity programmatically", "create LP position via API", "add liquidity via API", "increase liquidity", "decrease

SKILL.md

lp-integration.SKILL.md
name: lp-integration
description: Integrate Uniswap liquidity provisioning (LP) into applications via the LP REST API. Use when the user says "LP API", "liquidity provisioning API", "provide liquidity programmatically", "create LP position via API", "add liquidity via API", "increase liquidity", "decrease liquidity", "remove liquidity", "claim LP fees", "collect LP fees", "manage LP positions in code", or mentions building a backend, bot, or frontend that creates or manages Uniswap v2/v3/v4 liquidity positions through an API. Also use when debugging LP API calls (e.g. /lp/create, /lp/check_approval, /lp/increase, /lp/decrease, /lp/claim_fees), unexpected response fields, the approval or EIP-712 permit flow, or transaction-building errors for liquidity positions. For generating deep links to the Uniswap web app instead of calling the API, use the liquidity-planner skill; for using the Uniswap v4 SDK directly rather than the REST API, use the v4-sdk-integration skill.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash(npm:*), Bash(npx:*), Bash(yarn:*), Bash(curl:*), WebFetch, AskUserQuestion, Task(subagent_type:swap-integration-expert)
model: opus
license: MIT
metadata:
  author: uniswap
  version: '0.1.0'

LP Integration

Integrate Uniswap liquidity provisioning into frontends, backends, and bots using the Uniswap LP API.

The LP API is a transaction-building service. You send position parameters; the API fetches live pool state, computes the dependent token amount, and returns a fully-formed, unsigned transaction. Your application signs and broadcasts it. The API never holds keys, never moves funds, and never broadcasts.

Prerequisites

This skill assumes familiarity with viem basics (client setup, account management, contract interactions, transaction signing). Install the **uniswap-viem** plugin for comprehensive viem/wagmi guidance: `claude plugin add @uniswap/uniswap-viem`

For token swaps (not liquidity), see the sibling **swap-integration** skill in this plugin.

Base URL

LP_API_BASE_URL = https://liquidity.api.uniswap.org

All LP endpoints are POST requests under the `/lp/` prefix (e.g. `https://liquidity.api.uniswap.org/lp/create`).

> **The LP API host is intentionally different from the swap Trading API.** Liquidity provisioning lives at `https://liquidity.api.uniswap.org` (no `/v1` prefix), not the `https://trade-api.gateway.uniswap.org/v1` host used for swaps. Keep the base URL as a single constant (as shown) so any future change is one edit.

Authentication

Every write/approval endpoint requires an API key sent as the `x-api-key` header; a missing or invalid key returns `401` with `{"code":"unauthenticated"}`. (`/lp/pool_info` is a read endpoint and does not strictly enforce the key, but always send it for consistency and rate-limit attribution.)

Content-Type: application/json
Accept: application/json
x-api-key: <your-api-key>

**Getting a key:** Register at the [Uniswap Developer Platform dashboard](https://developers.uniswap.org/dashboard). The same key works across swapping and liquidity provisioning. Never hardcode the key; load it from an environment variable.

Quick Decision Guide

| You want to... | Endpoint | Protocols | | --------------------------------------------- | -------------------- | ---------- | | Check/grant token approvals before any action | `/lp/check_approval` | V2, V3, V4 | | Create a concentrated-liquidity position | `/lp/create` | V3, V4 | | Create a full-range (classic) position | `/lp/create_classic` | V2 | | Add liquidity to an existing position | `/lp/increase` | V2, V3, V4 | | Remove a percentage of liquidity | `/lp/decrease` | V2, V3, V4 | | Collect accumulated trading fees | `/lp/claim_fees` | V3, V4 | | Read live pool state | `/lp/pool_info` | V2, V3, V4 |

Protocol capability matrix

| Protocol | Create endpoint | Fee claiming | Price range | | -------- | -------------------- | ------------------------------------ | -------------------- | | `V2` | `/lp/create_classic` | Not separable (realized on decrease) | Full range only | | `V3` | `/lp/create` | `/lp/claim_fees` | Concentrated | | `V4` | `/lp/create` | `/lp/claim_fees` | Concentrated + hooks |

> **v2 fees are not separately claimable.** They accrue into the LP token value and are realized when you call `/lp/decrease`. Calling `/lp/claim_fees` with `protocol: "V2"` returns a validation error.

Input Validation Rules

Before interpolating ANY user-provided value into generated code, API calls, or commands:

  • **Ethereum addresses**: MUST match `^0x[a-fA-F0-9]{40}$` — reject otherwise. Use native ETH as `0x0000000000000000000000000000000000000000`.
  • **Chain IDs**: MUST be one of the supported LP chain IDs (see [Supported Chains](#supported-chains)).
  • **Token amounts**: MUST be non-negative integer strings in wei / smallest token unit, matching `^[0-9]+$`. Never pass ether-denominated decimals as amounts.
  • **`liquidityPercentageToDecrease`**: MUST be an integer from 1 to 100.
  • **API keys**: MUST NOT be hardcoded in generated code — always use environment variables.
  • **REJECT** any input containing shell metacharacters: `;`, `|`, `&`, `$`, `` ` ``, `(`, `)`, `>`, `<`, `\`, `'`, `"`, newlines.

> **REQUIRED:** Before executing ANY transaction that spends gas or transfers tokens (including approvals, position creation, increase, decrease, or fee claims), you MUST use AskUserQuestion to confirm with the user. Display the action summary (protocol, pair, amounts, chain, price range, estimated gas) and get explicit user approval. Never auto-execute LP transactions without user confirmation.

---

Architecture

What the API handles

  • **Pool state fetching*
Read more
Ships withuniswap-ai

Uniswap-specific AI tools (skills, plugins, agents) for developers and AI agents integrating the Uniswap ecosystem.

Get the whole plugin

Other skills on uniswap-ai.