Skip to main content

LP Agent CLI

lpagent is the command-line interface for LP Agent. It lets users and AI agents discover pools, inspect positions, and execute zap-in/zap-out transaction workflows from terminal scripts.
  • Works as a standalone CLI
  • Works well in coding-agent environments
  • JSON output for automation, table output for humans

CLI Repository

Source code, releases, and issue tracking for the LP Agent CLI.

Install

Quick install script

curl -fsSL https://raw.githubusercontent.com/lpagent/cli/main/install.sh | bash

Alternative install methods

# Go install
go install github.com/lpagent/cli/cmd/lpagent@latest

# Build from source
git clone https://github.com/lpagent/cli.git && cd cli
make build
./bin/lpagent --help

Initial setup

lpagent auth set-key
lpagent auth set-default-owner <wallet-address>
Then verify access:
lpagent positions open -o table --native

Core command groups

Positions

lpagent positions open --owner <addr>
lpagent positions historical --owner <addr> --from 2025-01-01
lpagent positions overview -o table --native
lpagent positions logs --position <id>
lpagent positions get --position <id>
lpagent positions revenue <addr>

Pools

lpagent pools discover --chain SOL --sort-by tvl
lpagent pools info <poolId>
lpagent pools positions <poolId> --status Open
lpagent pools onchain-stats <poolId>
lpagent pools top-lpers <poolId>

Zap-In / Zap-Out transaction flow

# Zap-In
lpagent pools add-tx <poolId> --owner <addr> --strategy Spot --input-sol 1
lpagent pools landing-add-tx --file signed-tx.json

# Zap-Out
lpagent tx decrease-quotes --id <id> --bps 10000
lpagent tx decrease-tx --position-id <id> --bps 10000 --owner <addr> --slippage-bps 500
lpagent tx landing-decrease-tx --file signed-tx.json

Token and raw API access

lpagent token balance --owner <addr>

lpagent api get /lp-positions/opening --query "owner=<addr>"
lpagent api post /position/decrease-quotes --data '{"id":"...","bps":5000}'

Output modes

All commands support:
  • json (default)
  • table
  • quiet
Use:
lpagent positions open -o json
lpagent positions open -o table --native

Configuration

Config file path:
  • ~/.lpagent/config.json
Override sources:
VariableFlagDescription
LPAGENT_API_KEY--api-keyAPI key
LPAGENT_API_URL-Base API URL
LPAGENT_DEFAULT_OWNER--ownerDefault wallet address
Priority order:
  1. CLI flags
  2. Environment variables
  3. Config file

AI Agent usage pattern

When integrating lpagent into AI workflows:
  1. prefer -o json for machine parsing
  2. keep wallet signing in trusted runtime boundaries
  3. run a dry read step (positions open, pools info) before execution commands
  4. use generated transaction + landing command pairs for reliability