Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LP Agent CLI

`lpagent` is the command-line interface for [LP Agent](https://lpagent.io). Manage Solana LP positions, discover pools, and generate liquidity transactions from your terminal or through AI agents.
`lpagent` is the command-line interface for [LP Agent](https://lpagent.io). Manage LP positions on Solana (Meteora, Orca) and the Robinhood chain (Uniswap v3/v4), discover pools, and generate liquidity transactions from your terminal or through AI agents.

- Works standalone or as a Claude agent skill
- Single binary, no runtime dependencies
Expand Down Expand Up @@ -46,41 +46,64 @@ make build
# Positions
lpagent positions open --owner <addr> # Open positions
lpagent positions open -o table --native # Table view in SOL
lpagent positions open --chain ROBINHOOD --owner <0xaddr> # Open positions on Robinhood
lpagent positions historical --owner <addr> --from 2025-01-01 # Closed positions
lpagent positions overview -o table --native # Portfolio metrics
lpagent positions logs --position <id> # Transaction logs
lpagent positions logs --chain ROBINHOOD --owner <0xaddr> # Logs for a Robinhood wallet
lpagent positions get --position <id> # Position details
lpagent positions revenue <addr> # Revenue data

# Pools
lpagent pools discover --chain SOL --sort-by tvl # Discover pools
lpagent pools discover --chain SOL --sort-by tvl # Discover pools (Solana)
lpagent pools discover --chain ROBINHOOD --sort-by tvl # Discover Uniswap v3/v4 pools on Robinhood
lpagent pools info <poolId> # Pool details
lpagent pools positions <poolId> --status Open # Positions in a pool
lpagent pools onchain-stats <poolId> # TVL, volume, fees
lpagent pools top-lpers <poolId> # Top LPs

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

# Zap-Out (remove liquidity)
# Zap-Out (remove liquidity) - Solana only
lpagent tx zap-out-estimates --position-id <id> --bps 10000 # real payout per output option, after swap + fee
lpagent tx decrease-tx --position-id <id> --bps 10000 --owner <addr> --slippage-bps 500
lpagent tx landing-decrease-tx --file signed-tx.json

# Claim fees (position stays open) - Solana only
lpagent tx claim-fee-tx --position-id <id> --owner <addr> # add --swap-to-sol to get the fees in SOL
lpagent tx landing-claim-fee-tx --file signed-tx.json

# Token
lpagent token balance --owner <addr>
lpagent token balance --chain ROBINHOOD --owner <0xaddr>

# Raw API access
lpagent api get /lp-positions/opening --query "owner=<addr>"
lpagent api post /position/zap-out-estimates --data '{"position_id":"...","bps":5000}'
```

## Chains

| Chain | `--chain` | Protocols | Native token |
|-----------|-------------|-------------------------------------|--------------|
| Solana | `SOL` (default) | Meteora DLMM, Meteora DAMM v2, Orca | SOL |
| Robinhood | `ROBINHOOD` | Uniswap v3, Uniswap v4 | ETH |

Read commands take `--chain SOL` (default) or `--chain ROBINHOOD`: `positions open`, `historical`,
`overview`, `logs` and `revenue`, `token balance`, `pools discover` and `pools positions`.
`positions get`, `pools onchain-stats` and `pools top-lpers` read the chain from the id you pass.

`pools info` and every command that builds or sends a transaction (`add-tx`, `zap-out-estimates`,
`decrease-tx`, `claim-fee-tx` and their `landing-` commands) are Solana only.
See [Chain Support](https://docs.lpagent.io/ai-api-guide#chain-support).

## Output Formats

All commands support `--output` / `-o`: `json` (default), `table`, `quiet`.

Use `--native` on `positions open` and `positions overview` to show values in SOL instead of USD.
Use `--native` on `positions open` and `positions overview` to show values in the native token (SOL on Solana, ETH on Robinhood) instead of USD.

## Configuration

Expand Down
6 changes: 3 additions & 3 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ var (
func newRootCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "lpagent",
Short: "LP Agent CLI — manage Solana LP positions from the terminal",
Short: "LP Agent CLI - manage Solana and Robinhood LP positions from the terminal",
Long: `LP Agent CLI is a command-line interface for the LP Agent Open API.
It provides access to LP position management, pool discovery, and
transaction generation for Solana DeFi protocols.
It tracks LP positions and discovers pools on Solana and Robinhood Chain,
and generates liquidity and fee-claim transactions on Solana.

Get started:
lpagent auth set-key Set your API key
Expand Down
9 changes: 7 additions & 2 deletions internal/commands/pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func newPoolsDiscoverCmd() *cobra.Command {
Short: "Discover and filter liquidity pools",
Example: ` lpagent pools discover
lpagent pools discover --chain SOL --sort-by tvl --page-size 20 -o table
lpagent pools discover --chain ROBINHOOD --sort-by tvl -o table
lpagent pools discover --search "SOL" --min-liquidity 10000`,
RunE: func(cmd *cobra.Command, args []string) error {
app := appctx.FromContext(cmd.Context())
Expand Down Expand Up @@ -137,7 +138,7 @@ func newPoolsDiscoverCmd() *cobra.Command {
},
}

cmd.Flags().StringVar(&chain, "chain", "SOL", "Blockchain network")
cmd.Flags().StringVar(&chain, "chain", "SOL", "Blockchain network: SOL or ROBINHOOD")
cmd.Flags().StringVar(&sortBy, "sort-by", "mcap", "Sort by: mcap, created_at, vol_24h, tvl, fee_tvl_ratio, volatility")
cmd.Flags().StringVar(&sortOrder, "sort-order", "desc", "Sort order: asc, desc")
cmd.Flags().IntVar(&page, "page", 1, "Page number")
Expand Down Expand Up @@ -185,6 +186,7 @@ func newPoolsInfoCmd() *cobra.Command {
func newPoolsPositionsCmd() *cobra.Command {
var (
owner string
chain string
status string
page int
pageSize int
Expand All @@ -202,7 +204,9 @@ func newPoolsPositionsCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
app := appctx.FromContext(cmd.Context())

params := map[string]string{}
params := map[string]string{
"chain": chain,
}
if owner != "" {
params["owner"] = owner
}
Expand Down Expand Up @@ -242,6 +246,7 @@ func newPoolsPositionsCmd() *cobra.Command {
}

cmd.Flags().StringVar(&owner, "owner", "", "Filter by wallet address")
cmd.Flags().StringVar(&chain, "chain", "SOL", "Blockchain network: SOL or ROBINHOOD")
cmd.Flags().StringVar(&status, "status", "", "Filter by status: Open, Close")
cmd.Flags().IntVar(&page, "page", 0, "Page number")
cmd.Flags().IntVar(&pageSize, "page-size", 0, "Items per page (max 20)")
Expand Down
Loading
Loading