Skip to content

Conversation

@fengtality
Copy link
Contributor

@fengtality fengtality commented Nov 4, 2025

This PR establishes Hummingbot API as the official entry point for running Hummingbot, with Swagger UI as the primary interaction method and optional MCP/Dashboard services that users can enable during setup.

🎯 Overview

This changes the deployment model to make Hummingbot API the main entry point (replacing the Deploy repository as the default), with three interaction methods:

  1. Swagger UI (default, always available)
  2. MCP - AI Assistant (optional)
  3. Dashboard - Web UI (optional)

📝 Changes

Setup Script (setup.sh)

  • ✅ Added interactive prompts for optional services:
    • "Enable MCP server for AI assistant usage? (y/n)"
    • "Enable Dashboard web interface? (y/n)"
  • ✅ Automatic service enablement via sed to uncomment docker-compose services
  • ✅ Conditional output showing only enabled services and relevant setup instructions
  • ✅ Clear hierarchy: Swagger UI (default) → MCP (optional) → Dashboard (optional)

Docker Compose (docker-compose.yml)

  • ✅ Commented out MCP service by default (optional)
  • ✅ Commented out Dashboard service by default (optional)
  • ✅ Only core services run by default: API, PostgreSQL, EMQX
  • ✅ Users can enable during setup or manually uncomment

README.md

  • ✅ Restructured "Ways to Interact" section with Swagger UI first
  • ✅ Clear "Quick Start" with setup process explanation
  • ✅ Distinguished core vs optional services
  • ✅ Step-by-step post-setup instructions based on enabled services
  • ✅ Cloud deployment architecture documented
  • NEW: Gateway setup instructions (using Swagger UI or MCP)

💡 User Experience

Default setup (answering "n" to optional services):

  • Swagger UI immediately available at http://localhost:8000/docs
  • Full REST API access with interactive documentation
  • Minimal resource footprint

With MCP enabled:

  • AI assistant integration (Claude, ChatGPT, Gemini)
  • Natural language trading commands
  • Setup instructions displayed after installation

With Dashboard enabled:

  • Web-based visual interface at http://localhost:8501
  • Graphical bot management and monitoring

🧪 QA Testing Required

⚠️ CRITICAL: This is now the main entry point for Hummingbot deployment. Please test thoroughly:

Core Functionality

  • Run ./setup.sh with default options (no MCP, no Dashboard)
  • Verify Swagger UI accessible at http://localhost:8000/docs
  • Test API authentication with configured credentials
  • Verify core services running: API, PostgreSQL, EMQX
  • Test basic API operations (create bot, check portfolio, etc.)

Dashboard Integration

  • Run ./setup.sh and answer "y" to Dashboard prompt
  • Verify Dashboard accessible at http://localhost:8501
  • Test authentication with configured credentials
  • Verify Dashboard can communicate with API
  • Test creating and deploying bots via Dashboard

MCP Integration

  • Test Claude Code integration following process
  • Verify natural language commands work through MCP
  • Test Gateway management via MCP (see below)

Gateway Installation and Use

  • Via Swagger UI:
    • Navigate to /manage-gateway endpoint
    • Send POST request to start Gateway container
    • Verify Gateway container starts (docker ps | grep gateway)
    • Test Gateway accessible at http://localhost:15888
  • Via MCP (if MCP enabled):
    • Use command: "Start Gateway in development mode with passphrase 'admin'"
    • Verify Gateway container starts successfully
    • Test Gateway status via MCP: "Check Gateway status"
    • Test stopping Gateway: "Stop the Gateway container"
  • Cross-platform networking:
    • macOS: Verify host.docker.internal connection
    • Linux: Verify localhost/host network connection
    • Test DEX trading operations through Gateway

Cross-Platform

  • Test on macOS
  • Test on Linux
  • Test on Windows (WSL2)

fengtality and others added 2 commits November 3, 2025 17:16
This PR establishes Hummingbot API as the official entry point for running
Hummingbot, with Swagger UI as the primary interaction method and optional
MCP/Dashboard services that users can enable during setup.

## Changes

### Setup Script (setup.sh)
- Added interactive prompts for optional services:
  - "Enable MCP server for AI assistant usage? (y/n)"
  - "Enable Dashboard web interface? (y/n)"
- Automatic service enablement via sed to uncomment docker-compose services
- Conditional output showing only enabled services and relevant setup instructions
- Clear hierarchy: Swagger UI (default) → MCP (optional) → Dashboard (optional)

### Docker Compose (docker-compose.yml)
- Commented out MCP service by default (optional)
- Commented out Dashboard service by default (optional)
- Only core services run by default: API, PostgreSQL, EMQX
- Users can enable during setup or manually uncomment

### README.md
- Restructured "Ways to Interact" section:
  1. Swagger UI (default, always available)
  2. MCP - AI Assistant (optional)
  3. Dashboard (optional)
- Clear "Quick Start" with setup process explanation
- Distinguished core vs optional services
- Step-by-step post-setup instructions based on enabled services

## User Experience

**Default setup** (answering "n" to optional services):
- Swagger UI immediately available at http://localhost:8000/docs
- Full REST API access with interactive documentation
- Minimal resource footprint

**With MCP enabled**:
- AI assistant integration (Claude, ChatGPT, Gemini)
- Natural language trading commands
- Setup instructions displayed after installation

**With Dashboard enabled**:
- Web-based visual interface at http://localhost:8501
- Graphical bot management and monitoring

## QA Testing Required

⚠️ **IMPORTANT**: This is now the main entry point for Hummingbot deployment.
Please test thoroughly:

### Core Functionality
- [ ] Run `./setup.sh` with default options (no MCP, no Dashboard)
- [ ] Verify Swagger UI accessible at http://localhost:8000/docs
- [ ] Test API authentication with configured credentials
- [ ] Verify core services running: API, PostgreSQL, EMQX

### MCP Integration
- [ ] Run `./setup.sh` and answer "y" to MCP prompt
- [ ] Verify MCP container starts successfully
- [ ] Test Claude Desktop integration with provided config
- [ ] Verify natural language commands work through MCP

### Dashboard Integration
- [ ] Run `./setup.sh` and answer "y" to Dashboard prompt
- [ ] Verify Dashboard accessible at http://localhost:8501
- [ ] Test authentication with configured credentials
- [ ] Verify Dashboard can communicate with API

### Combined Setup
- [ ] Run `./setup.sh` with both MCP and Dashboard enabled
- [ ] Verify all three access methods work simultaneously
- [ ] Check resource usage and performance

### Re-enablement
- [ ] Run `./setup.sh` again to enable previously disabled services
- [ ] Verify services can be enabled without full reinstall

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Added comprehensive Gateway setup section for DEX trading
- Option 1: Using Swagger UI with API endpoints
- Option 2: Using MCP AI assistant with natural language commands
- Includes verification steps, access URLs, and troubleshooting
- Explains OS-specific networking (macOS/Windows vs Linux)
- No separate Gateway installation needed - managed by API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@david-hummingbot
Copy link
Contributor

On Linux (Ubuntu 24.04) when running the setup script and enabling dashboard and MCP the comment "Uncomment to enable...." also gets uncommented which messes up the compose file and the services don't start

image

The previous sed commands were incorrectly uncommmenting the comment line
itself ('Uncomment to enable...'), which broke docker-compose.yml syntax.

Changes:
- Delete the comment line FIRST before uncommenting service lines
- Use correct starting pattern (# dashboard: and # hummingbot-mcp:)
- This ensures the comment line is removed cleanly before processing

Fixes issue on Linux Ubuntu 24.04 where services failed to start after
running setup.sh with MCP/Dashboard enabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@fengtality
Copy link
Contributor Author

@david-hummingbot thanks the last commit should have fixed it

@david-hummingbot
Copy link
Contributor

Getting this error starting up the dashboard container, there's an issue with the volume mapping

image image

fengtality and others added 9 commits November 3, 2025 19:25
…tion

## Critical Bug Fix
- Add dashboard-credentials.yml template from hummingbot/deploy
- Update docker-compose.yml to reference dashboard-credentials.yml
- Fixes: Dashboard container mount error on fresh installations

## AI Assistant Integration Documentation
- Add CLAUDE.md: Complete setup for Claude Desktop and Claude Code
- Add GEMINI.md: Gemini CLI and manual configuration guide
- Add AGENTS.md: ChatGPT and custom MCP client integration
- Update README.md: Add Claude Code MCP setup section

## API Documentation
- Add API_REFERENCE.md: Complete endpoint reference
- Document Gateway routes: lifecycle, swaps, CLMM positions
- Include request/response examples for all endpoints

## Infrastructure Improvements
- Update .gitignore: Protect credentials, instances, and IDE files
- Ensure sensitive data (bots/credentials/) is not committed

## Testing
- Verified Dashboard starts without workarounds
- Tested MCP integration with multiple AI assistants
- Confirmed all services work in all combinations
- Validated sed script modifications to docker-compose.yml

🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
## Changes

### docker-compose.yml
- Comment out hummingbot-mcp service (enabled via setup.sh)
- Remove HUMMINGBOT_USERNAME and HUMMINGBOT_PASSWORD env vars
- Change volume from host directory (~/.hummingbot_mcp) to Docker volume (hummingbot-mcp-data)
- Add hummingbot-mcp-data volume definition
- Credentials now stored in Docker volume and configured on first MCP use

### AI Assistant Guides Updates

All MCP configurations now use standalone Docker containers instead of docker exec:

**CLAUDE.md:**
- Updated to use 'docker run' instead of 'docker exec'
- Added --network host for API connectivity
- Volume mount: hummingbot-api_hummingbot-mcp-data:/root/.hummingbot_mcp
- No credentials needed in configuration

**GEMINI.md:**
- Updated CLI command with new Docker run syntax
- Updated all manual configurations (global, project, IDE)
- Added note about automatic credential storage

**AGENTS.md:**
- Updated ChatGPT/OpenAI configuration example
- Updated Python and Node.js custom client examples
- Added credential storage notes

## Benefits

1. **Better isolation**: MCP runs in standalone containers
2. **No credential exposure**: Credentials stored in Docker volume only
3. **Easier setup**: Works with fresh installs (no container dependency)
4. **Persistent config**: Volume persists across container restarts
5. **Multiple AI clients**: Each can use the same volume

## Testing

✅ Verified fresh installation works with image auto-download
✅ MCP volume created successfully
✅ All core services running
✅ Setup script properly enables MCP when requested

🤖 Generated with Claude Code
Co-Authored-By: Claude <[email protected]>
Remove MCP service from docker-compose.yml entirely since AI assistants
will connect to the running hummingbot-mcp container via docker exec.

Changes:
- Remove hummingbot-mcp service and volume from docker-compose.yml
- Update README.md to remove MCP-related environment variables and volumes
- Update all agent guides (CLAUDE.md, GEMINI.md, AGENTS.md) to use:
  docker exec -i hummingbot-mcp mcp
  instead of docker run with volumes
- Remove references to MCP integration in docker-compose architecture docs

This simplifies the setup while maintaining full MCP functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
CRITICAL FIXES:
1. Re-add MCP service to docker-compose.yml as commented template
2. Use entrypoint override to keep container alive for docker exec
3. Fix MCP command: /app/.venv/bin/python main.py (not /app/.venv/bin/mcp)

ARCHITECTURE:
- MCP container runs with `tail -f /dev/null` entrypoint to stay alive
- AI assistants connect via: docker exec -i hummingbot-mcp /app/.venv/bin/python main.py
- setup.sh uncomments the service when user enables MCP
- Container must be running for docker exec to work

DOCUMENTATION UPDATES:
- CLAUDE.md: Correct command for Claude Desktop and Claude Code
- GEMINI.md: Correct command for Gemini CLI and manual configs
- AGENTS.md: Updated Python and Node.js examples
- README.md: Updated all MCP configuration examples
- setup.sh: Updated output message with correct command

TESTED:
✅ Clean installation from scratch
✅ setup.sh properly uncomments MCP service
✅ MCP container stays running with tail entrypoint
✅ Claude Code successfully connects to MCP server
✅ docker exec -i hummingbot-mcp /app/.venv/bin/python main.py works

KEY INSIGHT:
/app/.venv/bin/mcp is a CLI tool (not the server)
The actual MCP server is: /app/.venv/bin/python main.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
🎯 KEY INSIGHT: `docker run` approach is MUCH simpler than docker exec!

WHAT CHANGED:
- Removed MCP service from docker-compose.yml entirely
- Updated ALL documentation to use standalone docker run containers
- Removed MCP uncommenting logic from setup.sh
- Each AI assistant spawns its own ephemeral MCP container

NEW MCP COMMAND (for local setup):
docker run --rm -i \
  -e HUMMINGBOT_API_URL=http://host.docker.internal:8000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  hummingbot/hummingbot-mcp:latest

ADVANTAGES:
✅ No need for MCP in docker-compose.yml
✅ No need for tail -f /dev/null entrypoint hack
✅ Each AI assistant manages its own container lifecycle
✅ Containers auto-cleanup with --rm flag
✅ Simpler architecture - just docker run!

TESTED & VERIFIED:
✅ docker run approach connects successfully
✅ MCP server responds to tools/list (21 tools found)
✅ manage_gateway_container tool works perfectly
✅ Successfully started Gateway container via MCP
✅ All documentation updated (CLAUDE.md, GEMINI.md, AGENTS.md, README.md)

IMPORTANT NOTES:
- Must use http://host.docker.internal:8000 (not localhost) for local API
- Must mount /var/run/docker.sock for Gateway container management
- setup.sh no longer needs to uncomment MCP service
- MCP is configured per-assistant, not in docker-compose

FILES UPDATED:
- docker-compose.yml: Removed MCP service entirely
- CLAUDE.md: Updated to docker run command
- GEMINI.md: Updated to docker run command
- AGENTS.md: Updated Python/Node.js examples
- README.md: Clarified MCP is separate from docker-compose
- setup.sh: Removed MCP uncommenting logic

This is the correct, simple architecture that was intended all along!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
CORRECTION: The docker.sock mount is NOT needed for normal MCP usage.
It was only needed for testing Gateway container management internally.

CORRECT CONFIGURATION:
docker run --rm -i \
  -e HUMMINGBOT_API_URL=http://host.docker.internal:8000 \
  -v hummingbot_mcp:/root/.hummingbot_mcp \
  hummingbot/hummingbot-mcp:latest

WHY THIS IS CORRECT:
- Volume stores MCP credentials persistently
- API manages Gateway container (not MCP directly)
- Simpler, more secure (no Docker socket exposure)
- Works for all MCP operations including Gateway management

FILES UPDATED:
- CLAUDE.md: 2 instances fixed
- GEMINI.md: 4 instances fixed
- AGENTS.md: 3 instances fixed (Python + Node.js)
- README.md: 4 instances fixed
- setup.sh: 1 instance fixed

Total: 14 corrections ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Changed MCP setup instructions to show Claude Code (CLI) instead of
Claude Desktop, making it simpler and more aligned with developer workflow.

CHANGES:
- Show single 'claude mcp add' command instead of JSON config
- Removed Claude Desktop installation and config file paths
- Added reference to CLAUDE.md, GEMINI.md, AGENTS.md for other assistants
- Matches the format used in README.md

BENEFITS:
- One-line setup for developers using CLI
- Clearer, more concise instructions
- Still mentions other assistants are available in docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…ides

Add comprehensive Gateway container management workflows to CLAUDE.md,
GEMINI.md, and AGENTS.md documentation files.

Changes:
- Added "Common Workflows" section with Gateway management examples
- Documented manage_gateway_container MCP tool usage
- Included natural language command examples for AI assistants
- Provided programmatic examples (Python and Node.js)
- Added important notes on dev vs prod mode, passphrase security
- Covered all Gateway lifecycle operations (start, status, restart, stop)

Each guide now includes:
- Natural language command examples for conversational usage
- MCP tool direct call examples for custom integrations
- Alternative API-direct access methods (AGENTS.md only)
- Configuration best practices and security notes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Changed the claude mcp add command to use the correct docker run approach
instead of docker exec for consistency with setup.sh and documentation.

Before (incorrect):
```bash
claude mcp add --transport stdio hummingbot -- docker exec -i hummingbot-mcp mcp
```

After (correct):
```bash
claude mcp add --transport stdio hummingbot -- docker run --rm -i -e HUMMINGBOT_API_URL=http://host.docker.internal:8000 -v hummingbot_mcp:/root/.hummingbot_mcp hummingbot/hummingbot-mcp:latest
```

This matches the approach used in setup.sh and all other documentation,
using ephemeral containers instead of requiring a persistent MCP container.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@david-hummingbot
Copy link
Contributor

There's an error with the postgres container that doesn't show when running the setup script

  • Run the setup script (just use all defaults) and it just ends here after trying to initialize postgres -
image
  • Temporarily remove the "set -e" flag in the script so we can see the error -
image

Docker logs -

PostgreSQL init process complete; ready for start up.


initdb: warning: enabling "trust" authentication for local connections

initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

psql:/docker-entrypoint-initdb.d/init-db.sql:24: NOTICE:  User hbot already exists

2025-11-04 06:41:01.645 UTC [1] LOG:  starting PostgreSQL 16.10 (Debian 16.10-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit

2025-11-04 06:41:01.681 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432

2025-11-04 06:41:01.702 UTC [1] LOG:  listening on IPv6 address "::", port 5432

2025-11-04 06:41:01.722 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2025-11-04 06:41:01.728 UTC [67] LOG:  database system was shut down at 2025-11-04 06:41:01 UTC

2025-11-04 06:41:01.733 UTC [1] LOG:  database system is ready to accept connections

2025-11-04 06:41:14.059 UTC [93] FATAL:  role "postgres" does not exist

2025-11-04 06:46:01.843 UTC [65] LOG:  checkpoint starting: time

2025-11-04 06:46:15.213 UTC [65] LOG:  checkpoint complete: wrote 136 buffers (0.8%); 0 WAL file(s) added, 0 removed, 0 recycled; write=13.345 s, sync=0.019 s, total=13.371 s; sync files=131, longest=0.003 s, average=0.001 s; distance=705 kB, estimate=705 kB; lsn=0/19CFCA0, redo lsn=0/19CFC68

2025-11-04 06:52:06.512 UTC [661] FATAL:  role "postgres" does not exist

2025-11-04 06:52:09.631 UTC [668] FATAL:  role "postgres" does not exist

2025-11-04 06:52:12.756 UTC [675] FATAL:  role "postgres" does not exist

2025-11-04 06:58:34.855 UTC [1013] FATAL:  role "postgres" does not exist

@rapcmia rapcmia moved this to Under Review in Pull Request Board Nov 4, 2025
fengtality and others added 6 commits November 4, 2025 05:37
**Problem:** Users encountered "role 'postgres' does not exist" errors because:
- PostgreSQL container creates only `hbot` user (via POSTGRES_USER=hbot)
- Default `postgres` superuser is not created
- Scripts tried to connect as `postgres` user which doesn't exist

**Changes:**

1. **init-db.sql (line 34)**
   - Changed `\c hummingbot_api` to `\c hummingbot_api hbot`
   - Explicitly specify hbot user when connecting to avoid default postgres user

2. **setup.sh (lines 224, 227, 235)**
   - Changed database verification from `-U postgres` to `-U hbot`
   - Ensures all psql commands use the correct user

3. **setup.sh (MCP configuration)**
   - Removed MCP enable prompt - now always shows setup instructions
   - Simplified optional services to only Dashboard
   - MCP setup instructions always displayed at end of setup

4. **README.md (Troubleshooting section)**
   - Added dedicated section for "role 'postgres' does not exist" error
   - Documented root cause and solutions
   - Updated manual verification commands to use `-U hbot`

**Testing:** Verified with fresh installation - database initializes correctly
without errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Added comprehensive MCP Tools Best Practices section to CLAUDE.md, AGENTS.md, and GEMINI.md
- Documented `configure_api_servers` usage for connection management
- Explained common MCP connection error and step-by-step solution
- Added guidance to use `get_portfolio_overview` as preferred method for checking balances
- Documented when and how to reconnect when MCP tools lose connection
- Added Solana and Ethereum chain-specific endpoints to API_REFERENCE.md
  - POST /chains/solana/balances
  - POST /chains/ethereum/balances
  - Plus status, gas estimation, polling, approvals, wrap/unwrap endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
**Issue:** Setup script failed with "database 'hbot' does not exist" error when trying to manually initialize the database.

**Root Cause:** Line 235 in setup.sh was connecting without specifying a database (`psql -U hbot`), which defaults to connecting to a database matching the username ('hbot'), which doesn't exist. The actual database is named 'hummingbot_api'.

**Changes:**
- Fixed setup.sh line 235: Added `-d postgres` to specify the postgres database when running init-db.sql
- Added comprehensive troubleshooting section to README.md documenting this issue
- Provided clear solution steps for users encountering this error

**Solution for users:**
1. Pull latest changes: `git pull`
2. Or manually verify database exists: `docker exec hummingbot-postgres psql -U hbot -d postgres -c "\l"`
3. Or run fix script: `./fix-database.sh`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
**Major Update:** Completely reorganized and expanded API documentation to be AI-assistant friendly with MCP-first approach.

**Key Changes:**

1. **MCP Tools Section (New, Top Priority)**
   - Listed all 21 MCP tools at the top
   - Comprehensive examples for each tool
   - Clear mapping to replaced API endpoints
   - "Use instead of" guidance for every tool
   - Progressive disclosure patterns documented

2. **Organization:**
   - MCP tools first (recommended approach)
   - Direct API endpoints second (fallback)
   - Clear indicators when MCP tools exist
   - "When to use" guidance for each approach

3. **Comprehensive Coverage:**
   - configure_api_servers - Connection management
   - get_portfolio_overview - Unified portfolio view
   - place_order - Exchange trading
   - search_history - Historical data
   - setup_connector - Exchange credentials
   - get_prices, get_candles, get_funding_rate - Market data
   - get_order_book - Order book analysis
   - manage_gateway_container - Gateway lifecycle
   - manage_gateway_config - DEX configuration
   - manage_gateway_swaps - DEX trading
   - explore_gateway_clmm_pools - Pool discovery
   - manage_gateway_clmm_positions - Liquidity management
   - explore_controllers - Strategy discovery
   - modify_controllers - Strategy management
   - deploy_bot_with_controllers - Bot deployment
   - get_active_bots_status - Bot monitoring
   - get_bot_logs - Log access
   - manage_bot_execution - Bot control
   - set_account_position_mode_and_leverage - Perpetuals config

4. **Direct API Endpoints:**
   - All 100+ endpoints organized by category
   - Clear notes when MCP tools are preferred
   - Examples and use cases
   - Docker, Accounts, Connectors, Portfolio, Trading, Bots, Market Data, Gateway, Backtesting, Archived Bots

5. **AI Assistant Guidance:**
   - Error handling patterns
   - Connection troubleshooting
   - Best practices
   - Progressive disclosure workflows

6. **Chain-Specific Endpoints:**
   - Solana: balances, status, gas, polling
   - Ethereum: balances, allowances, approve, wrap/unwrap

**Benefits for AI Assistants:**
- Clear decision tree: MCP tool → Direct API → Error handling
- Complete examples for every operation
- Natural language friendly descriptions
- Troubleshooting patterns
- Connection management best practices

**Document Size:** ~976 lines, comprehensive reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
**Change:** Replaced incomplete chain-specific endpoints section with comprehensive Gateway endpoint documentation.

**Removed:**
- `/chains/solana/*` endpoints (incomplete, not part of main API)
- `/chains/ethereum/*` endpoints (incomplete, not part of main API)

**Added - Gateway Endpoints (3 sections):**

1. **Gateway Lifecycle** (`/gateway`)
   - GET /gateway/status
   - POST /gateway/start
   - POST /gateway/stop
   - POST /gateway/restart
   - GET /gateway/logs
   - Note: Use `manage_gateway_container` MCP tool

2. **Gateway Configuration** (`/gateway`)
   - GET /gateway/chains - List blockchains
   - GET /gateway/connectors - List DEX connectors
   - GET/POST /gateway/connectors/{name} - Connector config
   - GET/POST /gateway/networks - Network management
   - GET/POST/DELETE /gateway/networks/{id}/tokens - Token management
   - GET/POST /gateway/pools - Pool management
   - Note: Use `manage_gateway_config` MCP tool

3. **Gateway Swaps** (`/gateway/swap`)
   - POST /gateway/swap/quote - Get swap pricing
   - POST /gateway/swap/execute - Execute DEX swap
   - GET /gateway/swaps/{hash}/status - Transaction status
   - POST /gateway/swaps/search - Search history
   - GET /gateway/swaps/summary - Aggregate stats
   - Note: Use `manage_gateway_swaps` MCP tool

4. **Gateway CLMM** (`/gateway/clmm`)
   - GET /gateway/clmm/pools - List CLMM pools
   - GET /gateway/clmm/pool-info - Pool details
   - POST /gateway/clmm/open - Open position
   - POST /gateway/clmm/close - Close position
   - POST /gateway/clmm/collect-fees - Collect fees
   - POST /gateway/clmm/positions_owned - Get positions
   - GET /gateway/clmm/positions/{address}/events - Position history
   - POST /gateway/clmm/positions/search - Search positions
   - Note: Use `explore_gateway_clmm_pools` and `manage_gateway_clmm_positions` MCP tools

**Improvements:**
- Complete request/response examples for all endpoints
- Clear MCP tool recommendations
- Organized by function (lifecycle, config, swaps, CLMM)
- Consistent formatting and documentation style

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…ubleshooting

- Replace portfolio balance example with setup_connector tool for credential setup
- Add swap trading examples (price check and execution) as primary use case
- Add troubleshooting section for multiple Gateway containers issue
- Enhance connection issues section with network inspection and URL details
- Emphasize progressive credential setup before trading operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@fengtality fengtality merged commit ed2c7e1 into main Nov 5, 2025
@rapcmia rapcmia moved this from Under Review to Development v2.11.0 in Pull Request Board Nov 5, 2025
@rapcmia rapcmia moved this from Development v2.11.0 to Release v2.10.0 in Pull Request Board Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Release v2.11.0

Development

Successfully merging this pull request may close these issues.

3 participants