| title | CLI |
|---|---|
| description | Use LP Agent from terminal or inside AI agent workflows |
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
curl -fsSL https://raw.githubusercontent.com/lpagent/cli/main/install.sh | bash# 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 --helplpagent auth set-key
lpagent auth set-default-owner <wallet-address>Then verify access:
lpagent positions open -o table --nativelpagent 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>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
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.jsonlpagent token balance --owner <addr>
lpagent api get /lp-positions/opening --query "owner=<addr>"
lpagent api post /position/decrease-quotes --data '{"id":"...","bps":5000}'All commands support:
json(default)tablequiet
Use:
lpagent positions open -o json
lpagent positions open -o table --nativeConfig file path:
~/.lpagent/config.json
Override sources:
| Variable | Flag | Description |
|---|---|---|
LPAGENT_API_KEY |
--api-key |
API key |
LPAGENT_API_URL |
- | Base API URL |
LPAGENT_DEFAULT_OWNER |
--owner |
Default wallet address |
Priority order:
- CLI flags
- Environment variables
- Config file
When integrating lpagent into AI workflows:
- prefer
-o jsonfor machine parsing - keep wallet signing in trusted runtime boundaries
- run a dry read step (
positions open,pools info) before execution commands - use generated transaction + landing command pairs for reliability