Skip to content

Add SwapExecutor support#136

Closed
fengtality wants to merge 17 commits intomainfrom
feature/swap-executor
Closed

Add SwapExecutor support#136
fengtality wants to merge 17 commits intomainfrom
feature/swap-executor

Conversation

@fengtality
Copy link
Copy Markdown
Contributor

Summary

  • Register SwapExecutor in EXECUTOR_REGISTRY
  • Add swap_executor to available executor types endpoint

Dependencies

Test plan

  • Verify swap_executor appears in /executors/types/available
  • Verify swap_executor can be created via POST /executors/
  • Verify swap completes and custom_info is populated

🤖 Generated with Claude Code

fengtality and others added 2 commits March 4, 2026 12:56
Split the single api_route handler into separate handlers for each HTTP
method (GET, POST, PUT, DELETE, PATCH) with explicit operation_ids.
This ensures unique operation IDs in the OpenAPI schema.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Register SwapExecutor in EXECUTOR_REGISTRY
- Add swap_executor to available executor types

Requires: hummingbot/hummingbot#8117

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fengtality added a commit to hummingbot/mcp that referenced this pull request Mar 11, 2026
- Add swap_executor guide with documentation
- Update gateway_swap execute action to use swap_executor instead of
  direct gateway calls (provides retry logic and tracking)
- Add swap_executor to executor types and preferences
- Add account_name parameter to GatewaySwapRequest schema
- Update connector format documentation (jupiter/router)

Requires: hummingbot/hummingbot#8117, hummingbot/hummingbot-api#136

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fengtality added a commit to hummingbot/condor that referenced this pull request Mar 11, 2026
- Add SWAP_EXECUTOR_DEFAULTS with jupiter/router connector
- Update get_executor_type() to recognize swap and lp executor types
- Update init_new_executor_config() to handle swap executors

This enables swap executors to be displayed correctly in the
executors menu. A full swap wizard can be added in a future PR.

Requires: hummingbot/hummingbot#8117, hummingbot/hummingbot-api#136

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rapcmia rapcmia requested review from cardosofede and rapcmia March 12, 2026 05:12
Tokens are available immediately after adding - no Gateway restart needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rapcmia
Copy link
Copy Markdown
Contributor

rapcmia commented Mar 13, 2026

Verify swap_executor appears in /executors/types/available


curl -s -u admin:XXX http://localhost:8000/executors/types/available | jq
{
  "executor_types": [
    {
      "type": "position_executor",
      "description": "Single position with triple barrier (stop loss, take profit, time limit)",
      "use_case": "Directional trading with risk management"
    },
    {
      "type": "grid_executor",
      "description": "Grid trading with multiple buy/sell levels",
      "use_case": "Range-bound market trading"
    },
    {
      "type": "dca_executor",
      "description": "Dollar-cost averaging with multiple entry points",
      "use_case": "Gradual position building"
    },
    {
      "type": "twap_executor",
      "description": "Time-weighted average price execution",
      "use_case": "Large order execution with minimal market impact"
    },
    {
      "type": "arbitrage_executor",
      "description": "Cross-exchange price arbitrage",
      "use_case": "Exploiting price differences between exchanges"
    },
    {
      "type": "xemm_executor",
      "description": "Cross-exchange market making",
      "use_case": "Providing liquidity across exchanges"
    },
    {
      "type": "order_executor",
      "description": "Simple order execution with retry logic",
      "use_case": "Basic order placement with reliability"
    },
    {
      "type": "lp_executor",
      "description": "LP position management for CLMM pools (Meteora, Raydium) ",
      "use_case": "Automated liquidity provision with position tracking"
    },
    {
      "type": "swap_executor",
      "description": "Single swap execution on Gateway AMM connectors",
      "use_case": "Executing swaps on DEXs like Jupiter with retry logic"
    }
  ]
}
logs: INFO:     172.18.0.1:56034 - "GET /executors/types/available HTTP/1.1" 200 OK

Verify swap_executor can be created via POST /executors/

  curl -s -u admin:XXX -H "Content-Type: application/json" -d '
  {
    "account_name": "master_account",
    "executor_config": {
      "type": "swap_executor",
      "connector_name": "jupiter",
      "trading_pair": "SOL-USDC",
      "side": 1,
      "amount": "0.1",
      "slippage_pct": "1.0"
    }
  }' http://localhost:8000/executors/ | jq
  • User should add /router, /clmm, and /amm connectors (e.g., jupiter/router, meteora/clmm)
  • Executed swaps on side 1 and side 2, both completed successfully
  • Verified executor/id status is TERMINATED with close type: completed ✅

fengtality and others added 14 commits March 23, 2026 09:47
Gateway templates use placeholder addresses like '<ethereum-wallet-address>'
which cause errors when the API tries to fetch balances. Now detects and
skips these placeholder patterns.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Issue #129: Restore deploy-v2-script endpoint
- Add V2ScriptDeployment model for script-based bot deployment
- Add POST /bot-orchestration/deploy-v2-script endpoint
- Track bot runs in database for script deployments

Issue #124: Add set-default wallet functionality
- Add set_default parameter to POST /accounts/gateway/add-wallet (default: true)
- Add POST /gateway/wallets/set-default endpoint to change default wallet
- Add set_default_wallet method to GatewayClient

Also:
- Enable CLMM add/remove liquidity endpoints (uncommented)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moved from /gateway/wallets/* to /accounts/gateway/wallet/*:
- POST /accounts/gateway/wallet/create
- POST /accounts/gateway/wallet/show-private-key
- POST /accounts/gateway/wallet/send
- POST /accounts/gateway/wallet/set-default

This consolidates all account/wallet management under the Accounts router.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace debug print statements with proper logging.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consistent endpoint naming for all wallet operations under /accounts/gateway/wallet/*.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…/{chain}/{address}

Consistent endpoint naming for all wallet operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Logical grouping: add -> set-default -> delete -> create -> show-private-key -> send

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reverts the endpoint moves from PR #131 to save for a different PR:
- POST /gateway/wallets/create (stays in gateway.py)
- POST /gateway/wallets/show-private-key (stays in gateway.py)
- POST /gateway/wallets/send (stays in gateway.py)
- GET /accounts/gateway/wallets (back to accounts.py)
- POST /accounts/gateway/add-wallet (back to accounts.py)
- DELETE /accounts/gateway/{chain}/{address} (back to accounts.py)
- POST /accounts/gateway/wallet/set-default (new, in accounts.py)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reverted unnecessary function name changes:
- create_gateway_wallet -> create_wallet
- show_gateway_wallet_private_key -> show_private_key
- send_gateway_wallet_transaction -> send_transaction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add get_bot_lp_history() method to BotsOrchestrator
- Add GET /{bot_name}/lphistory endpoint to bot_orchestration router
- Add "lphistory" to known MQTT command channels

Returns LP-specific data: position_address, order_action, fees collected,
price ranges, and amounts for AMM/CLMM strategies like Meteora.

Fixes #132

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add swap_executor to EXECUTOR_TYPES for single swaps via Gateway
- Add swap_executor example in CreateExecutorRequest
- Handle swap_executor using network instead of connector_name
- Make trading_pair optional for lp_executor (resolved from pool_address)
- Update lp_executor example with simplified config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants