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…
от Uniswap★ 236 звёзд на GitHubОб этом скилле
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/v1prefix), not thehttps://trade-api.gateway.uniswap.org/v1host 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. 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_feeswithprotocol: "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 as0x0000000000000000000000000000000000000000. - Chain IDs: MUST be one of the supported LP chain IDs (see 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: current reserves, ticks,
sqrtRatioX96, and onchain position data. - Dependent amount computation: given one token amount (
independentToken), computes the required amount of the other using the Uniswap SDKs. - **Transaction
Установить lp-integration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditGlobGrepBash(npm:*)Bash(npx:*)Bash(yarn:*)Bash(curl:*)WebFetchAskUserQuestionTask(subagent_type:swap-integration-expert)Вложенные файлы
FAQ
Что делает скилл 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 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.
Как установить скилл lp-integration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lp-integration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic