Skip to content

feat(amm): manage_amm tool + Meteora Launch LP agent - #192

Open
fengtality wants to merge 2 commits into
mainfrom
feat/gateway-amm
Open

feat(amm): manage_amm tool + Meteora Launch LP agent#192
fengtality wants to merge 2 commits into
mainfrom
feat/gateway-amm

Conversation

@fengtality

@fengtality fengtality commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

manage_amm — direct, chain- & DEX-agnostic AMM tool (Meteora DAMM v2 / Raydium CPMM / Uniswap V2) over client.gateway_amm, position-addressed for Meteora, with a progressive-disclosure guide. Adds AMMRequest, tools/gateway_amm.py, guides/gateway_amm.md, format_amm_result, server registration.

Meteora Launch LP agent (agents/meteora_launch_lp) — early LP on tokens graduating from launchpads (EasyA) into Meteora DAMM v2:

  • easya_graduation_monitor: detect graduations off the Meteora data API via the EASY vanity mint-suffix (no launchpad API)
  • launch_safety_check routine+skill: mint/freeze authority (RPC) + top-holder concentration + LP lock gates
  • damm_v2_scanner: fee-yield harvest
  • launch_lp_operator strategy: detect → gate → enter → monitor → exit

Top of the 4-layer stack; depends on the SDK router.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N1YS88ZAY2rXVLmgvyN4oY


Related PRs — 4-layer AMM integration (merge bottom-up, each depends on the one below):

  1. Gateway: feat(meteora): add DAMM v2 (cp-amm) AMM connector gateway#671 — DAMM v2 (cp-amm) connector + unified /trading/amm/*
  2. hummingbot-api: feat(gateway): AMM liquidity + pool-creation endpoints (/gateway/amm/*) hummingbot-api#206/gateway/amm/* router
  3. SDK: feat(gateway): GatewayAMMRouter (client.gateway_amm) hummingbot-api-client#24client.gateway_amm
  4. condor: feat(amm): manage_amm tool + Meteora Launch LP agent #192manage_amm tool + Meteora Launch LP agent

manage_amm — a direct, chain- & DEX-agnostic AMM tool (Meteora DAMM v2 / Raydium CPMM /
Uniswap V2) over client.gateway_amm: pool_info, position_info, positions_owned, quote_swap,
execute_swap, quote_liquidity, add_liquidity, remove_liquidity, create_pool. Position-addressed
for Meteora (remove requires position_address, add optional = new position); progressive-disclosure
guide. Adds AMMRequest (schemas), tools/gateway_amm.py, guides/gateway_amm.md, format_amm_result,
registration in server.py, and manage_amm to the condor assistant prose.

Meteora Launch LP agent (agents/meteora_launch_lp) — early LP on tokens graduating from
launchpads (EasyA) into Meteora DAMM v2:
- routines/easya_graduation_monitor.py: detect graduations off the Meteora data API via the
  EASY vanity mint-suffix (no launchpad API needed)
- routines/launch_safety_check.py: objective gates (mint/freeze authority via RPC, top-holder
  concentration, LP lock, verified) -> PASS/FAIL
- routines/damm_v2_scanner.py: fee-yield harvest on established pools
- skills/launch_safety_check + strategies/launch_lp_operator: detect -> gate -> enter -> monitor -> exit

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1YS88ZAY2rXVLmgvyN4oY
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a chain- and DEX-agnostic manage_amm MCP tool and a Meteora Launch LP agent that discovers, safety-checks, enters, monitors, and exits DAMM v2 positions.

  • Adds AMM request schemas, SDK dispatch, result formatting, server registration, and usage guidance.
  • Adds Meteora graduation monitoring, fee-yield scanning, launch safety checks, and an autonomous LP strategy.
  • Preserves Meteora NFT position addresses in formatted position results and normalizes empty RPC configuration to the public Solana endpoint.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
mcp_servers/hummingbot_api/tools/gateway_amm.py Implements per-action validation and dispatch from the MCP tool to the SDK AMM router.
mcp_servers/hummingbot_api/formatters/gateway.py Formats AMM pool, transaction, and Meteora per-position results, including position addresses.
mcp_servers/hummingbot_api/schemas.py Defines the connector-agnostic AMM request contract and position-addressed Meteora parameters.
mcp_servers/hummingbot_api/server.py Registers manage_amm and connects MCP arguments to request validation, dispatch, and formatting.
agents/meteora_launch_lp/routines/launch_safety_check.py Implements launch-token safety gates and normalizes empty RPC configuration before performing Solana checks.
agents/meteora_launch_lp/strategies/launch_lp_operator/strategy.md Defines the autonomous discovery, gating, position-management, and exit lifecycle for Meteora launch LPs.

Sequence Diagram

sequenceDiagram
    participant Agent as Meteora Launch LP Agent
    participant Routine as Discovery/Safety Routines
    participant AMM as manage_amm
    participant SDK as gateway_amm SDK
    participant Gateway as Gateway AMM Router
    Agent->>Routine: Scan EasyA graduations
    Routine-->>Agent: Ranked pool candidates
    Agent->>Routine: Run launch safety checks
    Routine-->>Agent: PASS/FAIL gates
    Agent->>AMM: Quote and add liquidity
    AMM->>SDK: Dispatch connector action
    SDK->>Gateway: Execute AMM request
    Gateway-->>SDK: Position and transaction result
    SDK-->>AMM: Structured response
    AMM-->>Agent: Formatted position_address/signature
    Agent->>AMM: Monitor or remove named position
Loading

Reviews (2): Last reviewed commit: "fix(amm): list position addresses in pos..." | Re-trigger Greptile

Comment thread mcp_servers/hummingbot_api/formatters/gateway.py
min_wallet_sol_reserve: 0.3
max_positions: 3
max_quote_per_position: 0.5
rpc_url: ''

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Empty RPC disables safety checks

With the supplied default configuration, the strategy explicitly forwards an empty rpc_url; the safety routine posts to that invalid URL, records a failed RPC gate, and rejects every candidate instead of using its public-mainnet default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4a04f2blaunch_safety_check now treats a falsy rpc_url as the public-mainnet default via a field_validator, so the empty-string default config no longer fails every RPC gate.

…pty rpc_url as public default

- positions_owned formatter now lists each position's address (needed for
  restart adoption and position-specific remove_liquidity), not just
  pool-level aggregates.
- launch_safety_check treats a falsy rpc_url as DEFAULT_RPC instead of
  posting to an invalid empty URL and failing every RPC gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@rapcmia rapcmia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup this PR with the ff


  • Loaded the AMM guide through the correct Meteora Launch LP context.
  • Verified pool, position, positions-owned, and swap-quote reads without moving funds.
  • Confirmed Raydium and missing-position guard cases fail cleanly.
  • Completed the small real-funds SWCH buy, LP open, and exact 100% removal cycle.
  • Confirmed Condor delegated correctly to meteora_launch_lp.
  • Verified the active DAMM v2 NFT position through consult and manage_amm(position_info).
  • Added liquidity to the existing NFT position, waited 15 seconds, removed 100%, and confirmed zero remaining liquidity.
  • Completed the Launch LP dry-run with no trades or executors. Candidates failing safety checks were rejected safely.
  • Tested using DLMM pool was rejected by the managed_amm since it focused on DAMMv2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants