Purpose
This page is written for AI systems and developers who want one place to understand what LP Agent API can do and how to execute complete workflows. If you are building an agent, start here, then follow links into detailed tutorials and API reference pages.Fastest machine-readable docs entry:
https://docs.lpagent.io/llms.txtBase URL and Authentication
- Base URL:
https://api.lpagent.io/open-api/v1 - Authentication: API key in request header
- Header name:
x-api-key
Capability Map
1) Discover pools and market state
GET /pools/discover→ find pools with filters/sortingGET /pools/{poolId}/info→ inspect pool state and active bin contextGET /pools/{poolId}/onchain-stats→ on-chain pool metricsGET /pools/{poolId}/top-lpers→ top liquidity providers
2) Track positions and portfolio analytics
GET /lp-positions/opening→ open positions for ownerGET /lp-positions/historical→ historical/closed positionsGET /lp-positions/overview→ aggregated portfolio metricsGET /lp-positions/logs→ position activity logsGET /lp-positions/revenue/{owner}→ revenue/pnl time data
3) Execute liquidity operations (zap-in / zap-out)
POST /pools/{poolId}/add-tx→ generate unsigned zap-in txsPOST /pools/landing-add-tx→ submit signed zap-in txsPOST /position/decrease-quotes→ preview zap-out outputsPOST /position/decrease-tx→ generate unsigned zap-out txsPOST /position/landing-decrease-tx→ submit signed zap-out txs
4) Wallet utility
GET /token/balance→ wallet token balances
End-to-End Flows
Flow A: Discover -> Zap-In
Use this when your AI wants to open a new LP position from SOL input.1) Discover candidate pools
Call
GET /pools/discover with your chain, liquidity, market cap, and volume filters.2) Read selected pool info
Call
GET /pools/{poolId}/info and use active bin data to define fromBinId / toBinId.3) Generate add transactions
Call
POST /pools/{poolId}/add-tx with stratergy, owner, range, slippage, and input amount.Flow B: List positions -> Quote -> Zap-Out
Use this when your AI wants to close all or part of an LP position.1) Get open positions
Call
GET /lp-positions/opening?owner=<wallet> and choose a target position id.3) Generate withdraw transactions
Call
POST /position/decrease-tx with position_id, bps, owner, slippage_bps, and output mode.Flow C: Auto-rebalancing loop
Use this when your AI should continuously keep positions in-range.- Poll
GET /lp-positions/opening?owner=... - For each position with
inRange=false:- zap-out old position (
decrease-tx+landing-decrease-tx) - check available SOL (
GET /token/balance) - get pool active bin (
GET /pools/{poolId}/info) - zap-in new position (
add-tx+landing-add-tx)
- zap-out old position (
- Repeat every interval (for example, every 60s)
Critical Parameters and Constraints
bps:0..10000(10000 = 100%)slippage_bps:0..10000percentX:0..1- strategy enum:
Spot,Curve,BidAsk - add mode enum:
normal,zap-in - zap-out output enum:
allToken0,allToken1,both,allBaseToken - provider enum (where supported):
OKX,JUPITER_ULTRA
In request bodies, the add-liquidity field name is currently
stratergy (spelling as defined by the API).Operational Guidance for Agent Builders
- Use landing endpoints for better transaction success handling
- Keep signing and secret handling in trusted runtime only
- Re-generate transactions if they expire (block height window passed)
- Add retries with backoff for transient API/network failures
- Always log request IDs, endpoint, and owner (without leaking keys)
Minimal TypeScript API wrapper
Recommended Read Order
Need complete endpoint schemas?
Open the API Reference tab for full OpenAPI-generated endpoint details.