Skip to main content

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.txt

Base URL and Authentication

  • Base URL: https://api.lpagent.io/open-api/v1
  • Authentication: API key in request header
  • Header name: x-api-key
Never expose API keys or private keys in frontend code, shared prompts, screenshots, or logs. Use a secure backend for production agents.

Capability Map

1) Discover pools and market state

  • GET /pools/discover → find pools with filters/sorting (Fee/TVL sort over a 5m, 1h, 6h or 24h window on Solana)
  • GET /pools/{poolId}/info → inspect pool state and active bin context
  • GET /pools/{poolId}/positions → positions opened in a pool
  • GET /pools/{poolId}/onchain-stats → on-chain pool metrics
  • GET /pools/{poolId}/top-lpers → top liquidity providers (Premium)

2) Track positions and portfolio analytics

  • GET /lp-positions/open → open positions for owner
  • GET /lp-positions/historical → historical/closed positions
  • GET /lp-positions/overview → aggregated portfolio metrics
  • GET /lp-positions/logs → position activity logs
  • GET /lp-positions/position → one position in detail
  • GET /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 txs
  • POST /pools/landing-add-tx → submit signed zap-in txs
  • POST /position/zap-out-estimates → estimate what each zap-out output pays out
  • POST /position/decrease-tx → generate unsigned zap-out txs
  • POST /position/landing-decrease-tx → submit signed zap-out txs

4) Claim fees

  • POST /position/claim-fee-tx → generate unsigned claim-fee txs, optionally with swap-to-SOL txs
  • POST /position/landing-claim-fee-tx → submit signed claim-fee txs

5) Wallet and network utility

  • GET /token/balance → wallet token balances
  • POST /rpc, POST /rpc/historical → Solana JSON-RPC (Premium)
  • POST /jito → send a Jito bundle (Premium)

Chain Support

Read endpoints take chain=SOL (default) or chain=ROBINHOOD. Everything that builds or sends a transaction is Solana only. See API Reference Introduction for how chain and platform behave on each endpoint.

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

1) Discover candidate pools

Call GET /pools/discover with your chain, liquidity, market cap, and volume filters.
2

2) Read selected pool info

Call GET /pools/{poolId}/info and use active bin data to define fromBinId / toBinId.
3

3) Generate add transactions

Call POST /pools/{poolId}/add-tx with stratergy, owner, range, slippage, and input amount.
4

4) Sign locally

Sign base64 transactions with the user wallet in your runtime.
5

5) Land transactions

Submit signed txs to POST /pools/landing-add-tx.

Flow B: List positions -> Estimate -> Zap-Out

Use this when your AI wants to close all or part of an LP position.
1

1) Get open positions

Call GET /lp-positions/open?owner=<wallet> and choose a target position id.
2

2) Estimate the payout (optional)

Call POST /position/zap-out-estimates with position_id (the position’s id) and bps. Each estimate shows what the wallet receives for one output option. Meteora DLMM positions only.
3

3) Generate withdraw transactions

Call POST /position/decrease-tx with position_id, bps, owner, slippage_bps, and output mode. For a DAMM V2 position, also send type: "meteora_damm_v2" (the position’s protocol).
4

4) Sign locally

Sign base64 transactions with the owner wallet.
5

5) Land transactions

Submit signed txs to POST /position/landing-decrease-tx.

Flow C: Auto-rebalancing loop

Use this when your AI should continuously keep positions in-range.
  1. Poll GET /lp-positions/open?owner=...
  2. For each position with inRange=false:
    • zap-out old position (decrease-tx + landing-decrease-tx, with type set from the position’s protocol)
    • check available SOL (GET /token/balance)
    • get pool active bin (GET /pools/{poolId}/info)
    • zap-in new position (add-tx + landing-add-tx)
  3. Repeat every interval (for example, every 60s)

Critical Parameters and Constraints

  • bps: 0..10000 on decrease-tx, 1..10000 on zap-out-estimates (10000 = 100%)
  • slippage_bps: 0..10000
  • position type enum on decrease-tx and claim-fee-tx: meteora (DLMM, default), meteora_damm_v2
  • feeTVLInterval on pools/discover: 5m, 1h, 6h, 24h
  • percentX: 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
  • Stay under your plan’s requests per minute (Basic 5, Premium 10, Enterprise 20); a 429 means wait and retry
  • A 401 with Unauthorized means the key is missing, unknown, or out of access (for example a paid plan that ended); see When a paid plan ends
  • Always log request IDs, endpoint, and owner (without leaking keys)

Minimal TypeScript API wrapper

  1. API Reference Introduction
  2. Zap-In & Zap-Out via API
  3. Auto-Rebalancing Bot
  4. Compound LP Fees
  5. AI page

Need complete endpoint schemas?

Open the API Reference tab for full OpenAPI-generated endpoint details.