Skip to content

feat / Use network as connector_name for Gateway executors#142

Merged
rapcmia merged 36 commits intomainfrom
feature/connector-level-retry
Apr 20, 2026
Merged

feat / Use network as connector_name for Gateway executors#142
rapcmia merged 36 commits intomainfrom
feature/connector-level-retry

Conversation

@fengtality
Copy link
Copy Markdown
Contributor

@fengtality fengtality commented Mar 29, 2026

Summary

  • For Gateway executors, connector_name now uses the network identifier (e.g., solana-mainnet-beta) instead of connector type
  • LP executor uses new lp_provider field for DEX/trading_type (e.g., meteora/clmm)
  • Order executor works with Gateway connectors using network-based connector_name

Key Changes

  • models/executors.py: Update lp_executor example to use connector_name: "solana-mainnet-beta" and lp_provider: "meteora/clmm"
  • services/executor_service.py: Handle optional trading_pair - use add_market() when provided, ensure_connector() otherwise
  • services/unified_connector_service.py: Detect Gateway connectors via AllConnectorSettings
  • bots/controllers/generic/lp_rebalancer/lp_rebalancer.py: Update to use new provider architecture with autoswap via OrderExecutor

API Changes

Before:

{
  "executor_config": {
    "type": "lp_executor",
    "connector_name": "meteora/clmm",
    "trading_pair": "SOL-USDC",
    "pool_address": "..."
  }
}

After:

{
  "executor_config": {
    "type": "lp_executor",
    "connector_name": "solana-mainnet-beta",
    "lp_provider": "meteora/clmm",
    "pool_address": "..."
  }
}

Related PRs

Repo PR Description
hummingbot #8150 Use network as connector_name
hummingbot-api #142 Use network as connector_name (this PR)
gateway #620 Fix fee calculation, add error parsing

Dependencies

Test plan

  • Verify lp_executor can be created with connector_name: "solana-mainnet-beta" and lp_provider: "meteora/clmm"
  • Verify lp_executor can be created with connector_name: "ethereum-base" and lp_provider: "uniswap/clmm"
  • Verify lp_executor can be created with connector_name: "ethereum-bsc" and lp_provider: "pancakeswap/clmm"
  • Verify order_executor works with Gateway connector (solana-mainnet-beta)
  • Verify order_executor works with Gateway connector on Ethereum (ethereum-base)
  • Verify order_executor works with Gateway connector on Ethereum (ethereum-bsc)
  • Verify that all LP positions are created and tracked correctly

fengtality and others added 7 commits March 11, 2026 19:42
- 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>
Tokens are available immediately after adding - no Gateway restart needed.

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>
- Create GatewaySwap connector for router-type connectors (e.g., jupiter/router)
- Update executor_service to ensure swap connector is loaded before execution
- Add database access documentation for debugging executors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains user-specific config and shouldn't be modified in the PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fengtality fengtality force-pushed the feature/connector-level-retry branch from c1953f0 to 51f48de Compare March 29, 2026 04:04
- Remove wallet_address param from poll_transaction (Gateway PR #620)
- Handle new txStatus=-1 for failed transactions
- Use Gateway's parsed error messages (e.g., "SLIPPAGE_EXCEEDED (0x1771): ...")
- Fallback to meta.err if parsed error not available

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The executor_service validates that connector_name is required for swap_executor,
but the example in models/executors.py was missing it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rapcmia rapcmia self-requested a review March 30, 2026 01:53
@rapcmia
Copy link
Copy Markdown
Contributor

rapcmia commented Mar 31, 2026

Commit 6aafc3b

  • Clone and build local whl and images for ✅
  • Update dockerfile and build docker image ✅
  • Start hummingbot-api and gateway ✅
  • Added solana wallet and setup helius (free ver) as nodeURL ✅
  • Verify if swap_executor exist in /executors/types/available
    curl -s -u admin:XXX http://localhost:8000/executors/types/available | jq '.executor_types[] | select(.type=="swap_executor")'
    {
      "type": "swap_executor",
      "description": "Single swap execution on Gateway AMM connectors",
      "use_case": "Executing swaps on DEXs like Jupiter with retry logic"
    }
    logs: not found related error on logs
    
  • Verify swap_executor can be created via POST /executors/
    • Tested swap_executor using jupiter/router but failed ❌
      curl -s -u admin:XXX -X POST http://localhost:8000/executors/ -H 'Content-Type: application/json' -d '
      {
        "account_name": "master_account",
        "executor_config": {
          "type": "swap_executor",
          "connector_name": "jupiter/router",
          "trading_pair": "SOL-USDC",
          "network": "solana-mainnet-beta",
          "side": 1,
          "amount": "0.035855"
        }
      }' | jq
      
      {
        "executor_id": "rEcgC9dS8673Xgic4WTo5d9aerhz9CGuZkJd8BNZDqx",
        "executor_type": "swap_executor",
        "connector_name": "jupiter/router",
        "trading_pair": "SOL-USDC",
        "status": "TERMINATED",
        "created_at": "2026-03-31T06:01:19.825662+00:00"
      }
      
      logs: 2026-03-31 06:01:19,826 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - ERROR - Connector 'jupiter/router' not found in Gateway. Available router connectors: []
      
      • Same response with side 2
      • logs returned 2026-03-31 06:01:19,826 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - ERROR - Connector 'jupiter/router' not found in Gateway. Available router connectors: []
  • I still tried to use amm or clmm type and got expected return ✅
    2026-03-31 06:09:24,665 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - ERROR - Executor requires /router connector type. 'clmm' is not supported.
    

Pending:

  • Verify swap_executor can be created via POST /executors/
  • Verify swap completes with retry on pending transactions
  • Verify order is created in orders table
  • Verify trade fill is recorded in trades table
  • Test with Gateway PR #620 for proper error messages

- Consolidate swap_executor and lp_executor validation into single block
- Network is optional - uses connector's defaultNetwork if not provided
- Executor handles connector normalization in on_start

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

rapcmia commented Apr 1, 2026

PR update:

Tested swap_executor using jupiter/router but failed ❌

  • This is fixed ✅

Verify swap_executor can be created via POST /executors/ ✅

  • Buy and Sell swap_executor worked ok
  • Hummingbot-api logs display status of orders when swap_executor is used
    06:12:04.057 GET /
    INFO:     172.20.0.1:40358 - "GET / HTTP/1.1" 200 OK
    06:12:12.168 POST /gateway/swap/quote
    INFO:     172.20.0.1:49024 - "POST /gateway/swap/quote HTTP/1.1" 200 OK
    2026-04-01 06:12:19,282 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Executing swap: SELL 0.035855 SOL on jupiter/router
    06:12:19.280 POST /executors/
    INFO:     172.20.0.1:52096 - "POST /executors/ HTTP/1.1" 201 Created
    2026-04-01 06:12:19,459 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Swap order placed: sell-SOL-USDC-1775023939459564
    2026-04-01 06:12:23,723 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Order completed: sell-SOL-USDC-1775023939459564
    06:12:40.148 GET /executors/GNydLDkm9CYHbEFfyq3E3HLZEz6U1ZTEbwG3NYJsy5Qt
    

Verify swap completes with retry on pending transactions ✅

  • Set nodeURL to default and do multiple swaps
  • Found the behavior occurred on logs
    INFO:     172.20.0.1:52384 - "GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw HTTP/1.1" 200 OK
    2026-04-01 06:32:53,512 - GatewaySwap - WARNING - swap BUY 0.035855 on SOL-USDC transaction pending (retry 1/10). Signature: 3n8gUwPaqgt3EpG7WhNVeWRT3gZaHdeTz3Brdfyi7VTKQk4kcjk9r5wkQKyZuHoRH9Cn82jBt2CUdNE56YNqAEVS. Retrying...
    2026-04-01 06:33:10,192 - GatewaySwap - WARNING - swap BUY 0.035855 on SOL-USDC transaction pending (retry 2/10). Signature: 2m5AEfGaKEuFuLtkgPWk8DynyZpxZsDjtktiGKgtvGDrNQFhitQyom7MffcnqsgKLKMmBWtvnPki9DdfcyX7485D. Retrying...
    

Verify swap completes with retry on pending transactions ✅

  • Observed pending txns that are retried are completed
  • From hummingbot-api
      2026-04-01 06:32:36,452 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Executing swap: BUY 0.035855 SOL on jupiter/router
      2026-04-01 06:32:36,519 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Swap order placed: buy-SOL-USDC-1775025156519266
      2026-04-01 06:32:53,512 - GatewaySwap - WARNING - swap BUY 0.035855 on SOL-USDC transaction pending (retry 1/10). Signature: 3n8gUwPaqgt3EpG7WhNVeWRT3gZaHdeTz3Brdfyi7VTKQk4kcjk9r5wkQKyZuHoRH9Cn82jBt2CUdNE56YNqAEVS. Retrying...
      2026-04-01 06:33:10,192 - GatewaySwap - WARNING - swap BUY 0.035855 on SOL-USDC transaction pending (retry 2/10). Signature: 2m5AEfGaKEuFuLtkgPWk8DynyZpxZsDjtktiGKgtvGDrNQFhitQyom7MffcnqsgKLKMmBWtvnPki9DdfcyX7485D. Retrying...
      2026-04-01 06:33:13,783 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Order completed: buy-SOL-USDC-1775025156519266
    
  • From gateway
      2026-03-31 22:32:37 | info |  🚀 Sent transaction 3n8gUwPaqgt3EpG7WhNVeWRT3gZaHdeTz3Brdfyi7VTKQk4kcjk9r5wkQKyZuHoRH9Cn82jBt2CUdNE56YNqAEVS, polling for confirmation...
      2026-03-31 22:32:53 | warn |  ❌ Transaction 3n8gUwPaqgt3EpG7WhNVeWRT3gZaHdeTz3Brdfyi7VTKQk4kcjk9r5wkQKyZuHoRH9Cn82jBt2CUdNE56YNqAEVS not confirmed after 10 attempts
      2026-03-31 22:32:53 | warn |  Transaction 3n8gUwPaqgt3EpG7WhNVeWRT3gZaHdeTz3Brdfyi7VTKQk4kcjk9r5wkQKyZuHoRH9Cn82jBt2CUdNE56YNqAEVS pending. No transaction data available.
      2026-03-31 22:32:54 | info |  🚀 Sent transaction 2m5AEfGaKEuFuLtkgPWk8DynyZpxZsDjtktiGKgtvGDrNQFhitQyom7MffcnqsgKLKMmBWtvnPki9DdfcyX7485D, polling for confirmation...
      2026-03-31 22:33:10 | warn |  ❌ Transaction 2m5AEfGaKEuFuLtkgPWk8DynyZpxZsDjtktiGKgtvGDrNQFhitQyom7MffcnqsgKLKMmBWtvnPki9DdfcyX7485D not confirmed after 10 attempts
      2026-03-31 22:33:10 | warn |  Transaction 2m5AEfGaKEuFuLtkgPWk8DynyZpxZsDjtktiGKgtvGDrNQFhitQyom7MffcnqsgKLKMmBWtvnPki9DdfcyX7485D pending. No transaction data available.
      2026-03-31 22:33:11 | info |  🚀 Sent transaction 2WpTP7kQbSXp1GMDdgfnRKoKLXM26H8X4D9NjSfoZRhyT27yTRwLmVgWe8g1Ezto5s1TtWdrvP1yWLjfdJ9BAgw9, polling for confirmation...
      2026-03-31 22:33:13 | info |  ✅ Transaction 2WpTP7kQbSXp1GMDdgfnRKoKLXM26H8X4D9NjSfoZRhyT27yTRwLmVgWe8g1Ezto5s1TtWdrvP1yWLjfdJ9BAgw9 confirmed after 2 attempts
      2026-03-31 22:33:13 | info |  Swap executed successfully: 3.0283 USDC -> 0.0358 SOL
    

Verify order is created in orders table ❌

  • I found that the order that was under retry on pending txn tests is still on open status on DB orde table, see buy-SOL-USDC-1775025156519266
    image
    INFO:     172.20.0.1:47992 - "GET /executors/28W6EDb33NgzAQw7vZLvewRFBNWfGMaY8R6j8nATxQ59 HTTP/1.1" 200 OK
    06:32:36.279 POST /gateway/swap/quote
    INFO:     172.20.0.1:52946 - "POST /gateway/swap/quote HTTP/1.1" 200 OK
    2026-04-01 06:32:36,452 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Executing swap: BUY 0.035855 SOL on jupiter/router
    06:32:36.451 POST /executors/
    INFO:     172.20.0.1:52958 - "POST /executors/ HTTP/1.1" 201 Created
    2026-04-01 06:32:36,519 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Swap order placed: buy-SOL-USDC-1775025156519266
    06:32:41.472 GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw
    INFO:     172.20.0.1:44520 - "GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw HTTP/1.1" 200 OK
    06:32:50.982 GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw
    INFO:     172.20.0.1:52384 - "GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw HTTP/1.1" 200 OK
    2026-04-01 06:32:53,512 - GatewaySwap - WARNING - swap BUY 0.035855 on SOL-USDC transaction pending (retry 1/10). Signature: 3n8gUwPaqgt3EpG7WhNVeWRT3gZaHdeTz3Brdfyi7VTKQk4kcjk9r5wkQKyZuHoRH9Cn82jBt2CUdNE56YNqAEVS. Retrying...
    2026-04-01 06:33:10,192 - GatewaySwap - WARNING - swap BUY 0.035855 on SOL-USDC transaction pending (retry 2/10). Signature: 2m5AEfGaKEuFuLtkgPWk8DynyZpxZsDjtktiGKgtvGDrNQFhitQyom7MffcnqsgKLKMmBWtvnPki9DdfcyX7485D. Retrying...
    2026-04-01 06:33:13,783 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Order completed: buy-SOL-USDC-1775025156519266
    06:33:19.249 GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw
    INFO:     172.20.0.1:60300 - "GET /executors/3TipJyiWvyrWvYhvsixPnutDxiov7uRoEzyC4g7amSNw HTTP/1.1" 200 OK
    
    • I tried to retest this time i found a two instances but the buy order got completed while having the retry and the sell did not make it and stuck on open status
      image
      • ❗ Steps to reproduce:
        • Change nodeURL of solana-mainnet-beta to default and run multiple swaps then check order table on DB

Verify order is created in orders table ✅

  • All orders that are completed on testing are listed (11 orders)
  • Observed that the two orders previously noted as OPEN in orders table are also present ❗

fengtality and others added 4 commits April 1, 2026 13:41
- Add autoswap feature for automatic token swapping when balance insufficient
- Fix _initial_position_created flag to only set when position is active
- Add negative offset support for in-range positions
- Add swap_provider and swap_buffer_pct config options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add INFO level logging to _handle_order_completed to trace:
- When the handler is called
- Whether the order was found in DB
- The status transition (old -> FILLED)

This helps debug why some orders stay in OPEN status after retries.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- connector_name is now network identifier (e.g., "solana-mainnet-beta")
- Added dex_name for DEX protocol (e.g., "meteora", "orca")
- Added trading_type for pool type (default "clmm")
- Updated SwapExecutorConfig creation to use new fields
- Updated LPExecutorConfig creation to include dex_name and trading_type
- Updated unified_connector_service to detect Gateway by checking AllConnectorSettings
- Updated executor examples in models/executors.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The GatewayHttpClient.get_price() method signature uses dex and trading_type
parameters, not connector. Parse pricing_connector into separate params.

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

rapcmia commented Apr 7, 2026

Commit 1921079

Verify swap_executor appears in /executors/types/available ✅

  • swap_executor is present in GET /executors/types/available

Verify swap_executor can be created via POST /executors/

  • Create swap executor while balance is not enough
    curl -sS -u admin:admin -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
    {
      "account_name": "master_account",
      "executor_config": {
        "type": "swap_executor",
        "connector_name": "solana-mainnet-beta",
        "swap_provider": "jupiter/router",
        "trading_pair": "SOL-USDC",
        "side": 1,
        "amount": "3",
        "slippage_pct": "0.5"
      }
    }' | jq
    {
      "executor_id": "H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K",
      "executor_type": "swap_executor",
      "connector_name": "solana-mainnet-beta",
      "trading_pair": "SOL-USDC",
      "status": "RUNNING",
      "created_at": "2026-04-07T06:57:36.832827+00:00"
    }
    logs: route created swap_executor H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K via Hummingbot API
    
    • I created this executor to BUY 3 SOL while i dont have that enough on my wallet
    • Observed the response shows executor created H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K
      image
      • Executor was stuck on running state ❌
        curl -sS -u admin:admin http://localhost:8000/executors/H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K | jq
        {
          "executor_id": "H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K",
          "status": "RUNNING",
          "custom_info": {
            "state": "EXECUTING",
            "tx_hash": null,
            "filled_amount_quote": 0.0
          }
        }
        logs: route showed swap executor still running and unfilled before stop
        
      • I use POST /executors/<executor_id>/stop, successfully stopped and verified ✅
        curl -sS -u admin:admin http://localhost:8000/executors/H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K | jq
        {
          "executor_id": "H7PXKKng3xoRmh9HF1pXJeMw44S1gCsm8rh7A9NTNr5K",
          "status": "TERMINATED",
          "close_type": "EARLY_STOP",
          "filled_amount_quote": 0.0,
          "custom_info": {
            "state": "FAILED",
            "tx_hash": null,
            "executed_amount": 0.0
          }
        }
        logs: route confirmed the swap executor terminated with no fill after stop
        
      • Review the executor table and found final state shows FAILED
        image
        {
          "state": "FAILED",
          "network": "solana-mainnet-beta",
          "connector_name": "solana-mainnet-beta",
          "swap_provider": "jupiter/router",
          "selected_provider": "jupiter/router",
          "side": "BUY",
          "amount": 3.0,
          "executed_amount": 0.0,
          "executed_price": 0.0,
          "tx_fee": 0.0,
          "tx_hash": null,
          "order_id": "buy-SOL-USDC-1775545056833882",
          "exchange_order_id": null,
          "filled_amount_base": 0.0,
          "filled_amount_quote": 0.0,
          "held_position_orders": []
        }
        
      • At the same time, i did not found any error on gateway logs indicating any swap attempt ❗
  • Create a swap executorwithin the available balance
curl -sS -u admin:admin -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
{
  "account_name": "master_account",
  "executor_config": {
    "type": "swap_executor",
    "connector_name": "solana-mainnet-beta",
    "swap_provider": "jupiter/router",
    "trading_pair": "SOL-USDC",
    "side": 1,
    "amount": "0.037594",
    "slippage_pct": "0.5"
  }
}' | jq
{
  "executor_id": "2sG5bSxvh8hV9GQpQJDoDP66NcCjw4KHKfmD4YNw7JjC",
  "executor_type": "swap_executor",
  "connector_name": "solana-mainnet-beta",
  "trading_pair": "SOL-USDC",
  "status": "RUNNING",
  "created_at": "2026-04-07T07:16:36.631578+00:00"
}
logs: route created 3 usd equivalent swap executor 2sG5bSxvh8hV9GQpQJDoDP66NcCjw4KHKfmD4YNw7JjC
  • No txhash found like earlier tests
  • No swap attempt found on gateway logs
  • Like earlier test, executor is stuck on running state
  • Stop executor and found final state failed
    {
      "state": "FAILED",
      "network": "solana-mainnet-beta",
      "connector_name": "solana-mainnet-beta",
      "swap_provider": "jupiter/router",
      "selected_provider": "jupiter/router",
      "side": "BUY",
      "amount": 0.037594,
      "executed_amount": 0.0,
      "executed_price": 0.0,
      "tx_fee": 0.0,
      "tx_hash": null,
      "order_id": "buy-SOL-USDC-1775546196632108",
      "exchange_order_id": null,
      "filled_amount_base": 0.0,
      "filled_amount_quote": 0.0,
      "held_position_orders": []
    }
    

I reviewed all swap attempt and found this block on hummingbot-api logs where ValueError: dex_name is required for swap operations on unified Gateway connector


INFO:     172.19.0.1:45158 - "GET /gateway/logs HTTP/1.1" 200 OK
07:16:27.003 POST /gateway/swap/quote
07:16:27.088 GET /gateway/status
INFO:     172.19.0.1:46268 - "GET /gateway/status HTTP/1.1" 200 OK
INFO:     172.19.0.1:46262 - "POST /gateway/swap/quote HTTP/1.1" 200 OK
2026-04-07 07:16:36,631 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Using connector network: solana-mainnet-beta
2026-04-07 07:16:36,632 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Executing swap: BUY 0.037594 SOL on jupiter/router (network: solana-mainnet-beta)
2026-04-07 07:16:36,632 - hummingbot.strategy_v2.executors.swap_executor.swap_executor - INFO - Swap order placed: buy-SOL-USDC-1775546196632108
2026-04-07 07:16:36,632 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: dex_name is required for swap operations on unified Gateway connector
Traceback (most recent call last):
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
           ^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/connector/gateway/gateway.py", line 282, in _create_order
    raise ValueError("dex_name is required for swap operations on unified Gateway connector")
ValueError: dex_name is required for swap operations on unified Gateway connector
07:16:36.630 POST /executors/
INFO:     172.19.0.1:54382 - "POST /executors/ HTTP/1.1" 201 Created
  • Under the same payloads, the POST /gateway/swap/execute succeeds, while swap_executor POST /executor fails
  • The swap_executor is currently not working correctly on the unified Gateway connector. It can be created and started, but it fails during execution because a required parameter (dex_name) is missing when placing the swap order.

Attached is a a summary of the bug we found:
07042026_swap_executor_bug_summary.log

fengtality and others added 3 commits April 7, 2026 14:10
- Update lp_rebalancer to use lp_provider field (format: "dex/trading_type")
- Add lp_provider validation in executor_service for lp_executor
- Update API example to use new lp_provider format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Initialize market data provider rate sources when creating swap/lp executors
to ensure price lookups work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AccountTradingInterface doesn't have market_data_provider attribute.
Rate sources are initialized elsewhere when needed.

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

rapcmia commented Apr 8, 2026

Commit 13bd7d5

  • Build .whl using the latest commit from hummingbot PR8150 commit f8e050ad1b...
  • Used locally built docker image for gateway PR620
  • Verify swap_executor can be created via POST /executors/
    • Create swap_executor on jupiter/router sell sol-usdc, executor status RUNNING ok
    • Get swap_executor detail using route /executor/8aVcMAGBDNeeMuisCU8zrk6fwEV99ZX7WWWzmP4xWCxL, status is RUNNING and EXECUTING ok
    • Run /executors/8aVcMAGBDNeeMuisCU8zrk6fwEV99ZX7WWWzmP4xWCxL/logs
      {
        "executor_id": "8aVcMAGBDNeeMuisCU8zrk6fwEV99ZX7WWWzmP4xWCxL",
        "logs": [
          "Quote from jupiter/router",
          "Quote from orca/clmm",
          "Quote from meteora/clmm",
          "Selected jupiter/router",
          "Executing swap SELL 0.035378 SOL",
          "Swap order placed"
        ]
      }
      
  • Verify swap completes with retry on pending transactions ✅
    • Test using /gateway/swaps, successfully executed multiple BUY and SELL swaps and tracked using `/gateway/swaps//status
    • Observed pending states SUBMITTED that later transitioned to CONFIRMED, polling behavior is working as expected
    • However, i havent’t seen the retry logic compared to previous commits and tested on different nodeURL default and helius ❗
    • The closest behavior of retry pending txn are from these transactions that that are confirmed after 2 attempts
      2026-04-07 18:39:44 | info |    ✅ Transaction xjfvyTMpHtV4xN4C7V3hKwK9tGzYMGzSCjWs81vbz25phovmm1FJihwWpVtngsowJKQzjcRMDJ6erifL3PPE1XR confirmed after 2 attempts
      2026-04-07 18:39:44 | info |    ✅ Transaction 5pEYTctsoaQoSZHPPUTCr5Fa3JGyS8877JM28YkNPJ8RWYdzsShryf8ZyL3scjEZ8BY3Yd5HYpenY7GMtvP9ik3S confirmed after 2 attempts
      
  • Verify order is created in orders table ✅
    • swap_executor orders are recorded and visible in POST /trading/orders/search with matching exchange_order_id transaction hashes on DB
  • Verify if order is creade in trade table ✅
    • Completed swap_executor are stored in the DB and can be verified thru /trading/orders/search, with fills confirmed via /trading/trades
  • Tested lp_executor changes ✅
    • LP executor payload now requires connector-name as the network e.g solana_mainnet-beta and lp_provider e.g meteora/clmm, raydium/clmm. Successfully open position using /executors/
      {
        "executor_id": "8oNxAggZJzZaGwBqPTAxL5y862FwKJ3jbfkR9ybbpKMq",
        "status": "RUNNING",
        "state": "IN_RANGE",
        "position_address": "AcWPNdcmpgMjeTtrifXjdsnHDbFqymDun2BjBNyQ1v5P"
      }
      

I observed a behavior for /gateway/swaps/<tx hash>/status route where the tx hash from swap_executor returns swap not found

curl -sS -u admin:admin http://localhost:8000/gateway/swaps/5AL8yTrpmiCDZcWTXnyAacyqyPswCT2122hsbPGMcdcvS58rLqLwhL4bRJ9fJjp5df3HppxAXW9GkMCgYnitsBKe/status | jq
{
  "detail": "Swap not found: 5AL8yTrpmiCDZcWTXnyAacyqyPswCT2122hsbPGMcdcvS58rLqLwhL4bRJ9fJjp5df3HppxAXW9GkMCgYnitsBKe"
}

logs: 
INFO:     172.19.0.1:33756 - "POST /executors/search HTTP/1.1" 200 OK
03:30:43.705 GET /gateway/swaps/5AL8yTrpmiCDZcWTXnyAacyqyPswCT2122hsbPGMcdcvS58rLqLwhL4bRJ9fJjp5df3HppxAXW9GkMCgYnitsBKe/status
INFO:     172.19.0.1:43754 - "GET /gateway/swaps/5AL8yTrpmiCDZcWTXnyAacyqyPswCT2122hsbPGMcdcvS58rLqLwhL4bRJ9fJjp5df3HppxAXW9GkMCgYnitsBKe/status HTTP/1.1" 404 Not Found
  • swap_executor runs thru the /executor route and records tx/order/trade
  • running normal /gateway/swap route works with `/gateway/swap//status
  • but using the txhash from swap_executor on /gateway/swap/<tx hash/status not work

fengtality and others added 4 commits April 8, 2026 06:35
- Remove swap_executor from EXECUTOR_REGISTRY and validation
- Remove swap_executor from EXECUTOR_TYPES literal
- Remove swap_executor examples from API docs
- Update lp_rebalancer to use OrderExecutor for autoswap
- Sync with hummingbot changes that removed SwapExecutor

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
LPExecutorConfig already requires connector_name, pool_address, lp_provider
via Pydantic field definitions. No need to duplicate validation in API layer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
API-managed LP executors already track performance in PostgreSQL database
via ExecutorRecord table with net_pnl_quote, net_pnl_pct, etc.
The lphistory endpoint was redundant as this data is stored locally.

- Remove /bot-orchestration/{bot_name}/lphistory endpoint
- Remove get_bot_lp_history method from BotsOrchestrator
- Remove lphistory from MQTT command channel handling
- Fix lint issues (trailing whitespace, unused variables)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fengtality and others added 4 commits April 8, 2026 09:33
- Revert orders_recorder.py and mqtt_manager.py (lint-only changes)
- Simplify executor creation: use add_market if trading_pair exists,
  otherwise ensure_connector

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplify fee calculation - if primary method fails, just log error
and set fee to 0 instead of complex fallback logic.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep orders_recorder.py unchanged from main - no fixes needed for this PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep bots_orchestrator.py unchanged from main - no fixes needed for this PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fengtality fengtality changed the title Add SwapExecutor with connector-level retry Use network as connector_name for Gateway executors Apr 8, 2026
DEX providers (jupiter/router, uniswap/amm, etc.) are accessed via
Gateway networks, not as direct connectors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fengtality fengtality force-pushed the feature/connector-level-retry branch from d7d656b to 87ab393 Compare April 8, 2026 17:43
@rapcmia rapcmia changed the title Use network as connector_name for Gateway executors feat / Use network as connector_name for Gateway executors Apr 9, 2026
@rapcmia
Copy link
Copy Markdown
Contributor

rapcmia commented Apr 9, 2026

Commit 87ab393

  • Build local .whl using hummingbot PR8150 latest ocmmits
  • Use same docker gateway PR620
  • Successfully build docker image using local .whl
  • All tests using meteora, orca, uniswap and pancakeswap CLMM

Verify lp_executor can be created with connector_name: "solana-mainnet-beta" and lp_provider: "meteora/clmm"or “orcal/clmm”

  • Changes works as expected, connector_name, and lp_provider
  • Prices and amount matches the response payload and exchange position data
  • There are instances of getting error persisting executor creation: (sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.NotNullViolationError'>: null value in column "trading_pair" of relation "executors" violates not-null constraint ❌
    INFO:     172.19.0.1:58914 - "GET /openapi.json HTTP/1.1" 200 OK
    06:11:28.421 GET /gateway/clmm/pool-info ? connector='meteora' & network='solana-mainnet-beta' & pool_address='BGm1tav58…fj4xJKD5Y'
    INFO:     172.19.0.1:58714 - "GET /gateway/clmm/pool-info?connector=meteora&network=solana-mainnet-beta&pool_address=BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y HTTP/1.1" 200 OK
    2026-04-09 06:12:53,683 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Using LP provider: meteora/clmm (dex=meteora, type=clmm)
    2026-04-09 06:12:53,687 - services.executor_service - ERROR - Error persisting executor creation: (sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.NotNullViolationError'>: null value in column "trading_pair" of relation "executors" violates not-null constraint
    DETAIL:  Failing row contains (1, BRDkpw77fb2shuDvSyLPU2vU4zSoC7A5BPnSvQyjiQwd, lp_executor, master_account, solana-mainnet-beta, null, 2026-04-09 06:12:53.685534+00, null, RUNNING, null, 0.000000000000000000, 0.000000, 0.000000000000000000, 0.000000000000000000, {"type": "lp_executor", "connector_name": "solana-mainnet-beta",..., null).
    [SQL: INSERT INTO executors (executor_id, executor_type, account_name, connector_name, trading_pair, closed_at, status, close_type, net_pnl_quote, net_pnl_pct, cum_fees_quote, filled_amount_quote, config, final_state) VALUES ($1::VARCHAR, $2::VARCHAR, $3::VARCHAR, $4::VARCHAR, $5::VARCHAR, $6::TIMESTAMP WITH TIME ZONE, $7::VARCHAR, $8::VARCHAR, $9::NUMERIC(30, 18), $10::NUMERIC(10, 6), $11::NUMERIC(30, 18), $12::NUMERIC(30, 18), $13::VARCHAR, $14::VARCHAR) RETURNING executors.id, executors.created_at]
    [parameters: ('BRDkpw77fb2shuDvSyLPU2vU4zSoC7A5BPnSvQyjiQwd', 'lp_executor', 'master_account', 'solana-mainnet-beta', None, None, 'RUNNING', None, 0, 0, 0, 0, '{"type": "lp_executor", "connector_name": "solana-mainnet-beta", "lp_provider": "meteora/clmm", "pool_address": "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj ... (93 characters truncated) ... : "0.036465391074915476", "quote_amount": "3", "side": 0, "extra_params": {"strategyType": 0}, "keep_position": true, "timestamp": 1775715173.475501}', None)]
    (Background on this error at: https://sqlalche.me/e/20/gkpj)
    2026-04-09 06:12:53,687 - routers.executors - ERROR - Error creating executor: 1 validation error for CreateExecutorResponse
    trading_pair
      Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.12/v/string_type
    Traceback (most recent call last):
      File "/hummingbot-api/routers/executors.py", line 66, in create_executor
        return CreateExecutorResponse(**result)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/pydantic/main.py", line 250, in __init__
        validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    pydantic_core._pydantic_core.ValidationError: 1 validation error for CreateExecutorResponse
    trading_pair
      Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
        For further information visit https://errors.pydantic.dev/2.12/v/string_type
    06:12:52.843 POST /executors/
    INFO:     172.19.0.1:54012 - "POST /executors/ HTTP/1.1" 500 Internal Server Error
    2026-04-09 06:12:54,646 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Resolved trading pair from pool: SOL-USDC
    2026-04-09 06:12:55,513 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Creating position with bounds: [81.858439 - 82.681137]
    2026-04-09 06:12:55,514 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Calling gateway to open position with order_id=range-SOL-USDC-1775715175514049
    2026-04-09 06:13:01,413 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Gateway returned signature=2apckqViWJ7Qavv71ecmSn6zGF68gnh9BzvH4fx2VZQrBwgDEv2z8CbpLFjuxQB2EWk99FauuDNhmPsiBntaPt6N
    2026-04-09 06:13:02,167 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Position created: cAgaJ7urNZZ7wPvu92Tbq6dXf48XVGsYeE6PAp3Jy7A, rent: 0.05740608 SOL, base: 0.036467175, quote: 2.999843, bounds: [81.77789252968151 - 82.68196065197394]
    2026-04-09 06:13:02,167 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - ERROR - Position creation failed: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
    06:13:07.220 GET /gateway/logs
    INFO:     172.19.0.1:56564 - "GET /gateway/logs HTTP/1.1" 200 OK
    
    • The payload omitted trading_pair, which is what triggered the response validation error
      curl -sS -u admin:admin -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
      {
          "account_name": "master_account",
          "executor_config": {
              "type": "lp_executor",
              "connector_name": "solana-mainnet-beta",
              "lp_provider": "meteora/clmm",
              "pool_address": "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y",
              "lower_price": "81.8584392490824",
              "upper_price": "82.6811371309827",
              "base_amount": "0.036465391074915476",
              "quote_amount": "3",
              "side": 0,
              "extra_params": {
        	      "strategyType": 0
        	      },
              "keep_position": true
          }
      }' | jq
      
      • The /executor started processing the request and triggered the open position successfully
      • API then failed while building the response because it requires trading_pair as non-null string
      • Because of that validation error, the executor process was not finalized, no executor_id was generated ❌
      • Position was closed using /gateway/clmm/close
  • There are instances that trading_pair is added (autoresolved) yet still error Position creation failed: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings ❌
    2026-04-09 06:47:23,171 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Using LP provider: meteora/clmm (dex=meteora, type=clmm)
    06:47:23.169 POST /executors/
    INFO:     172.19.0.1:54612 - "POST /executors/ HTTP/1.1" 201 Created
    2026-04-09 06:47:24,475 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Creating position with bounds: [81.858439 - 82.681137]
    2026-04-09 06:47:24,475 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Calling gateway to open position with order_id=range-SOL-USDC-1775717244475726
    06:47:32.012 POST /executors/search
    INFO:     172.19.0.1:42138 - "POST /executors/search HTTP/1.1" 200 OK
    06:47:32.125 POST /gateway/clmm/positions/search
    06:47:32.126 POST /portfolio/state
    INFO:     172.19.0.1:42152 - "POST /gateway/clmm/positions/search HTTP/1.1" 200 OK
    2026-04-09 06:47:32,339 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Gateway returned signature=3yyYtqxaToyMJvPDQkenzT3xdQWfA2E9faFPzztkjmnaRGUmFwgp1PVH2BRneq4uGD2NuyUrtjQoayVjdkfnKW8x
    INFO:     172.19.0.1:42154 - "POST /portfolio/state HTTP/1.1" 200 OK
    2026-04-09 06:47:33,144 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Position created: CskHWo5RhSGAGVvv86Cg8jmtZ8hEFNDbCzDTwNiJBqqj, rent: 0.05740608 SOL, base: 0.043750356, quote: 2.40126, bounds: [81.77789252968151 - 82.68196065197394]
    2026-04-09 06:47:33,145 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - ERROR - Position creation failed: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
    
    • Deploy lp_executor (default)
      curl -sS -u admin:admin -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
        {
          "account_name": "master_account",
          "executor_config": {
            "type": "lp_executor",
            "connector_name": "solana-mainnet-beta",
            "lp_provider": "meteora/clmm",
            "pool_address": "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y",
            "lower_price": "81.8584392490824",
            "upper_price": "82.6811371309827",
            "base_amount": "0.036465391074915476",
            "quote_amount": "3",
            "side": 0,
            "extra_params": {
              "strategyType": 0
            },
            "keep_position": true
          }
        }' | jq
      
      • Same pattern as earlier tests, executor reportedly failed but gateway opened position successfully
      • The default payload also missing the trading_pair but it was auto-resolved internally (from pool metadata) ✅
        • This fallback made the executor successfully created but immediately failed, therefore executor_id is present and can be searched
          image
          {
            "side": 0,
            "state": "FAILED",
            "position_address": "CskHWo5RhSGAGVvv86Cg8jmtZ8hEFNDbCzDTwNiJBqqj",
            "current_price": 82.10549509434877,
            "lower_price": 81.77789252968151,
            "upper_price": 82.68196065197394,
            "base_amount": 0.043750356,
            "quote_amount": 2.40126,
            "base_fee": 0.0,
            "quote_fee": 0.0,
            "fees_earned_quote": 0.0,
            "total_value_quote": 5.9934046399340115,
            "unrealized_pnl_quote": -0.0022449970150000003,
            "position_rent": 0.05740608,
            "position_rent_refunded": 0.0,
            "tx_fee": 2.7343000000000002e-05,
            "out_of_range_seconds": null,
            "initial_base_amount": 0.043750356,
            "initial_quote_amount": 2.40126,
            "filled_amount_base": 0.043750356,
            "filled_amount_quote": 2.40126,
            "held_position_orders": []
          }
          
        • Both payload failed with same error logs:
          2026-04-09 06:47:33,145 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - ERROR - Position creation failed: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
          

Steps to reproduce:

  • Deploy a lp_executor using `/executor/ routes
  • Observed that that there are instances of trading_pair is omitted causing error that it requires
  • Observed that most of the executor if trading_pair is autoresolved, created but immediately failed due to Position creation failed: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
  • Despite lp_executor issues on /executor routes, these positions are successfully created on exchange e.g meteora

Attached log file compressed from hummingbot-api container 09042026_hummingbot-api_container.log


Verify order_executor works with Gateway connector (solana-mainnet-beta)


INFO:     172.19.0.1:38096 - "POST /portfolio/state HTTP/1.1" 200 OK
2026-04-09 07:59:04,307 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
Traceback (most recent call last):
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
           ^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/strategy_v2/runnable_base.py", line 66, in control_loop
    await self.on_start()
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/strategy_v2/executors/executor_base.py", line 177, in on_start
    await self.validate_sufficient_balance()
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/strategy_v2/executors/order_executor/order_executor.py", line 372, in validate_sufficient_balance
    adjusted_order_candidates = self.adjust_order_candidates(self.config.connector_name, [order_candidate])
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/strategy_v2/executors/executor_base.py", line 266, in adjust_order_candidates
    return self.connectors[exchange].budget_checker.adjust_candidates(order_candidates)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/connector/budget_checker.py", line 54, in adjust_candidates
    self.adjust_candidate_and_lock_available_collateral(order_candidate, all_or_none)
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/connector/budget_checker.py", line 78, in adjust_candidate_and_lock_available_collateral
    adjusted_candidate = self.adjust_candidate(order_candidate, all_or_none)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/connector/budget_checker.py", line 97, in adjust_candidate
    order_candidate = self.populate_collateral_entries(order_candidate)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/connector/budget_checker.py", line 119, in populate_collateral_entries
    order_candidate.populate_collateral_entries(self._exchange)
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/core/data_type/order_candidate.py", line 75, in populate_collateral_entries
    fee = self._get_fee(exchange)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/core/data_type/order_candidate.py", line 238, in _get_fee
    fee = build_trade_fee(
          ^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/core/utils/estimate_fee.py", line 26, in build_trade_fee
    trade_fee_schema: TradeFeeSchema = TradeFeeSchemaLoader.configured_schema_for_exchange(exchange_name=exchange)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/hummingbot-api/lib/python3.12/site-packages/hummingbot/client/config/trade_fee_schema_loader.py", line 17, in configured_schema_for_exchange
    raise Exception(f"Invalid connector. {exchange_name} does not exist in AllConnectorSettings")
Exception: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
07:59:04.305 POST /executors/
INFO:     172.19.0.1:33754 - "POST /executors/ HTTP/1.1" 201 Created
07:59:11.296 GET /executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f
INFO:     172.19.0.1:40228 - "GET /executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f HTTP/1.1" 200 OK
07:59:11.395 GET /executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f/logs
INFO:     172.19.0.1:40238 - "GET /executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f/logs HTTP/1.1" 200 OK
07:59:11.397 POST /executors/search
INFO:     172.19.0.1:40252 - "POST /executors/search HTTP/1.1" 200 OK
08:03:26.471 POST /executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f/stop
INFO:     172.19.0.1:54526 - "POST /executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f/stop HTTP/1.1" 200 OK
  • Got same error Unhandled error in background task: Invalid connector. solana-mainnet-beta does not exist in AllConnectorSettings
  • Deploy order_executor limit on solana-mainnet-beta
    curl -sS -u XXX:XXX -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
    {
      "account_name": "master_account",
      "executor_config": {
        "type": "order_executor",
        "connector_name": "solana-mainnet-beta",
        "trading_pair": "SOL-USDC",
        "side": 1,
        "amount": "0.0365",
        "price": "82.0",
        "execution_strategy": "LIMIT",
        "position_action": "OPEN"
      }
    }' | jq
    {
      "executor_id": "8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f",
      "executor_type": "order_executor",
      "connector_name": "solana-mainnet-beta",
      "trading_pair": "SOL-USDC",
      "status": "RUNNING",
      "created_at": "2026-04-09T07:59:04.306723+00:00"
    }
    logs: route /executors/ create accepted and executor_id returned
    
    ##### verify order_executor status
    curl -sS -u XXX:XXX http://localhost:8000/executors/8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f | jq
    {
      "executor_id": "8CAVKwA3a9VerEhqoFdP8LvKywy5hzbaZv97PKavx9f",
      "status": "RUNNING",
      "execution_strategy": "LIMIT",
      "order_id": null,
      "executed_amount_base": 0
    }
    logs: route /executors/{executor_id} checked via Hummingbot API
    
    • Executor in RUNNING state
    • No found executor logs nor gateway activity tied to LIMIT order type
    • I tried to close the executor but its stuck on SHUTTING DOWN status ❌
      • Forced close executor by relaunch hummingbot-api, status SYSTEM_CLEANUP
        image
    • I tried using MARKET order type, same results ❌
      • I had to relaunch hummingbot-api to exit the executor with same status SYSTEM_CLEANUP
        image

Unfortunately, i was not able to backup the logs of hummingbot-api since we relaunched it and lost it on docker logs history

fengtality and others added 9 commits April 9, 2026 14:01
Remove verbose debug logging that was added during investigation of
order persistence issues. The root cause (event ordering) was fixed
in the hummingbot connector.

Changes:
- Remove verbose listener registration logs from start()
- Remove DEBUG prefixed warnings from event handlers
- Use appropriate log levels (debug for routine ops, error for failures)
- Add session.flush() in _handle_order_completed for immediate persistence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- lp_rebalancer.py: Make trading_pair and pool_address required fields
- models/executors.py: Add trading_pair to LP executor example
- executor_service.py: Add side field to executor response
- trading_service.py: Update balances after adding new trading pair

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- lp_rebalancer now uses TradeType enum (BUY, SELL, RANGE)
- RANGE (value=3) replaces BOTH (was 0) for 50/50 split positions
- side=0 now throws error instead of silently mapping to RANGE
- Validator accepts: TradeType enum, string ("BUY", "SELL", "RANGE"), or int (1, 2, 3)
- Updated API example to use "BUY" string format

This aligns LP executor side handling with Order executor pattern.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove verbose clamping detection/logging
- Add _validate_and_clamp_bounds function:
  - If both bounds within limits: proceed
  - If one bound exceeds: clamp it
  - If both bounds exceed: try opposite side
- Remove clamping from _calculate_price_bounds (now handled centrally)
- Keep anchoring logic (BUY anchors at buy_price_max, SELL at sell_price_min)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
RANGE (side=3) positions now bypass _validate_and_clamp_bounds entirely.
Only BUY and SELL positions are validated against their respective price limits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolve formatting conflicts in orders_recorder.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Skip price limit checks for RANGE positions
- Use TradeType enum for side parameter

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sync from hummingbot: compare against TradeType.BUY/SELL/RANGE
instead of integer values. Add range_count to display.

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

rapcmia commented Apr 10, 2026

Commit ec2be3d

  • Build local .whl using hummingbot PR8150 latest ocmmits
  • Use same docker gateway PR620
  • Successfully build docker image using local .whl

Verify lp_executor can be created with connector_name: "solana-mainnet-beta" and lp_provider: "meteora/clmm" ✅

  • Deploy lp_executor on meteora/clmm
    INFO:     172.19.0.1:36422 - "POST /executors/ HTTP/1.1" 201 Created
    2026-04-10 04:24:11,564 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Creating position with bounds: [82.680717 - 83.511679]
    2026-04-10 04:24:11,564 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Calling gateway to open position with order_id=range-SOL-USDC-1775795051564600
    04:24:17.113 GET /executors/AtpHjcCAfj2rmPCkXCofpzmLf5zeuwpYvyuanADSWMdh
    INFO:     172.19.0.1:36432 - "GET /executors/AtpHjcCAfj2rmPCkXCofpzmLf5zeuwpYvyuanADSWMdh HTTP/1.1" 200 OK
    04:24:17.220 GET /executors/AtpHjcCAfj2rmPCkXCofpzmLf5zeuwpYvyuanADSWMdh/logs ? limit='20'
    INFO:     172.19.0.1:36438 - "GET /executors/AtpHjcCAfj2rmPCkXCofpzmLf5zeuwpYvyuanADSWMdh/logs?limit=20 HTTP/1.1" 200 OK
    04:24:17.222 GET /gateway/logs
    INFO:     172.19.0.1:36446 - "GET /gateway/logs HTTP/1.1" 200 OK
    2026-04-10 04:24:18,885 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Gateway returned signature=2iPCnzWxyngMCGfeowP7jD9ommafZ9PGAbdqZB41wqKEG497KCdVFJh5vt5Kjs2y3jYUKEFiQue3aVKDhp43x42E
    2026-04-10 04:24:19,544 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Position created: FnCSTzhT74FZE5jSGBRo3PUzsR9argoTz7myjSCBCsXk, rent: 0.05740608 SOL, base: 0.041152153, quote: 2.571438, bounds: [82.59936129068325 - 83.51251088594235]
    
  • Deploy lp_executor on orca/clmm
    • Same pattern for opening LP executor is observed
    • Observed that when gateway on-chain process failed due to transaction timeout, automatically retries until successful ✅
    • This time i set side BUY (1) and state is IN RANGE
    • Open position and Close position

Verify lp_executor can be created with connector_name: "ethereum-base" and lp_provider: "uniswap/clmm" ✅

INFO:     172.19.0.1:59266 - "POST /executors/ HTTP/1.1" 201 Created
2026-04-10 05:27:22,939 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Creating position with bounds: [2184.324673 - 2206.277684]
2026-04-10 05:27:22,939 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Calling gateway to open position with order_id=range-WETH-USDC-1775798842939749
2026-04-10 05:27:25,858 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Gateway returned signature=0xea5ea56f3d5e5fa4a89d13dbb9694022caf53ace3a8a3e36e219ac7dbbe8cf42
2026-04-10 05:27:26,104 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to http://host.docker.internal:15888/connectors/uniswap/clmm/position-info failed. See logs for more details.
2026-04-10 05:27:26,104 - Gateway - WARNING - Gateway error: Failed to get position info (InternalServerError)
2026-04-10 05:27:26,104 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - WARNING - Position info fetch failed, using config values as fallback
2026-04-10 05:27:26,105 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Position created: 4942364, rent: 0 SOL, base: 0.0009110367267658946, quote: 2, bounds: [2184.3246726883735 - 2206.277684474186]
  • Final status
      {
        "executor_id": "Hp4N6pNWD8JJHgoMY2Lww6WB7pjMjNEoYaY3BG2zASiQ",
        "status": "TERMINATED",
        "is_active": false,
        "is_trading": false,
        "close_type": "EARLY_STOP",
        "close_timestamp": 1775799057.890538,
        "error_count": 0,
        "last_error": null
      }
    
  • Open and close position

Verify order_executor works with Gateway connector (solana-mainnet-beta) ✅

  curl -s -u admin:admin -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
  {
    "account_name": "master_account",
    "executor_config": {
      "type": "order_executor",
      "controller_id": "main",
      "trading_pair": "SOL-USDC",
      "connector_name": "solana-mainnet-beta",
      "side": 2,
      "amount": "0.036",
      "execution_strategy": "MARKET"
    }
  }' | jq

  {
    "executor_id": "4fbGJGTm4Rn6v72KUNFbiyKye36MHP4RUWatXWupiheL",
    "executor_type": "order_executor",
    "connector_name": "solana-mainnet-beta",
    "status": "RUNNING"
  }
  • Observed same behavior on earlier tests for trasnaction timeouts and gateway tries to submit the same until it completed ✅
  • Confirm txn completed
  • Executor details shows TERMINATED and closed as POSITION_HOLD
  • Tested LIMIT order
    • If price is omitted from the payload, returns unhandled error in background task: unsupported operand type(s) for *: 'decimal.Decimal' and 'NoneType’
      • executor created but does not place order on gateway
      • this make executor stuck on SHUTTING_DOWN state
    • Use gateway/swap/quote to get the price and use it on order_excutor LIMIT works as expected ✅
      curl -s -u admin:XXX -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
      {
        "account_name": "master_account",
        "executor_config": {
          "type": "order_executor",
          "controller_id": "main",
          "trading_pair": "SOL-USDC",
          "connector_name": "solana-mainnet-beta",
          "side": 1,
          "amount": "0.036",
          "execution_strategy": "LIMIT",
          "price": "83.40673566666666"
        }
      }' | jq
      {
        "executor_id": "M44WjJ6i8ZKQtWhJTwwsiBi8zNzNuQmEee9Pvj3e3QV",
        "executor_type": "order_executor",
        "status": "RUNNING"
      }
      
      • Verify LIMIT buy executor_id
        curl -s -u admin:XXX http://localhost:8000/executors/M44WjJ6i8ZKQtWhJTwwsiBi8zNzNuQmEee9Pvj3e3QV | jq
        {
          "executor_id": "M44WjJ6i8ZKQtWhJTwwsiBi8zNzNuQmEee9Pvj3e3QV",
          "status": "TERMINATED",
          "close_type": "POSITION_HOLD",
          "config": {
            "execution_strategy": "LIMIT",
            "price": "83.40673566666666",
            "side": 1,
            "amount": "0.036"
          },
          "fills": {
            "executed_amount_base": 0.036,
            "filled_amount_quote": 3.003861349608852,
            "average_executed_price": 83.44059304469033,
            "cum_fees_quote": 0.001633349608849813
          },
          "order_id": "buy-SOL-USDC-1775797510521085"
        }
        

Verify lp_executor can be created with connector_name: "ethereum-base" and lp_provider: "uniswap/clmm"

INFO:     172.19.0.1:59266 - "POST /executors/ HTTP/1.1" 201 Created
2026-04-10 05:27:22,939 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Creating position with bounds: [2184.324673 - 2206.277684]
2026-04-10 05:27:22,939 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Calling gateway to open position with order_id=range-WETH-USDC-1775798842939749
2026-04-10 05:27:25,858 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Gateway returned signature=0xea5ea56f3d5e5fa4a89d13dbb9694022caf53ace3a8a3e36e219ac7dbbe8cf42
2026-04-10 05:27:26,104 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to http://host.docker.internal:15888/connectors/uniswap/clmm/position-info failed. See logs for more details.
2026-04-10 05:27:26,104 - Gateway - WARNING - Gateway error: Failed to get position info (InternalServerError)
2026-04-10 05:27:26,104 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - WARNING - Position info fetch failed, using config values as fallback
2026-04-10 05:27:26,105 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Position created: 4942364, rent: 0 SOL, base: 0.0009110367267658946, quote: 2, bounds: [2184.3246726883735 - 2206.277684474186]
  • Final status
      {
        "executor_id": "Hp4N6pNWD8JJHgoMY2Lww6WB7pjMjNEoYaY3BG2zASiQ",
        "status": "TERMINATED",
        "is_active": false,
        "is_trading": false,
        "close_type": "EARLY_STOP",
        "close_timestamp": 1775799057.890538,
        "error_count": 0,
        "last_error": null
      }
    
    

Verify lp_executor can be created with connector_name: "ethereum-bsc" and lp_provider: "pancakeswap/clmm" ✅

INFO:     172.19.0.1:34964 - "POST /executors/ HTTP/1.1" 201 Created
2026-04-10 12:45:42,764 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Creating position with bounds: [2214.200394 - 2236.453664]
2026-04-10 12:45:42,764 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Calling gateway to open position with order_id=range-ETH-USDT-1775825142764840
2026-04-10 12:45:46,394 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Gateway returned signature=0xac3cc4f27cd2d531f5c2b4a5599bfe6f5018b45e03b49d185e901c94d87acfbb
2026-04-10 12:45:47,902 - hummingbot.strategy_v2.executors.lp_executor.lp_executor - INFO - Position created: 6727223, rent: 0 SOL, base: 0.001324359290079596, quote: 2.999957533266684, bounds: [2214.13 - 2236.38]
12:45:51.571 GET /executors/EycstPGKcATodMZzygPFXonsiczG4A9tNT9bDfkpumFr/logs
INFO:     172.19.0.1:44854 - "GET /executors/EycstPGKcATodMZzygPFXonsiczG4A9tNT9bDfkpumFr/logs HTTP/1.1" 200 OK
  • Successfully closed executor and lp position removed
    {
      "executor_id": "EycstPGKcATodMZzygPFXonsiczG4A9tNT9bDfkpumFr",
      "status": "TERMINATED",
      "is_active": false,
      "is_trading": false,
      "close_type": "EARLY_STOP",
      "close_timestamp": 1775825540.469247,
      "error_count": 0,
      "last_error": null
    }
    

Verify order_executor works with Gateway connector on Ethereum (ethereum-base) ✅

INFO:     172.19.0.1:40752 - "GET /gateway/status HTTP/1.1" 200 OK
12:00:53.248 POST /executors/
INFO:     172.19.0.1:57160 - "POST /executors/ HTTP/1.1" 201 Created
12:01:04.308 GET /executors/8QpjEz8gX1UVpuayRkZxvxhANGETnqUsXy6JPDTCo76x
INFO:     172.19.0.1:55670 - "GET /executors/8QpjEz8gX1UVpuayRkZxvxhANGETnqUsXy6JPDTCo76x HTTP/1.1" 200 OK
  • deploy order executor payload
    curl -s -u admin:admin -X POST http://localhost:8000/executors/ -H "Content-Type: application/json" -d '
    {
      "account_name": "master_account",
      "executor_config": {
        "type": "order_executor",
        "controller_id": "main",
        "trading_pair": "WETH-USDC",
        "connector_name": "ethereum-base",
        "side": 1,
        "amount": "0.0009023660906069529",
        "execution_strategy": "MARKET"
      }
    }' | jq
    {
      "executor_id": "8QpjEz8gX1UVpuayRkZxvxhANGETnqUsXy6JPDTCo76x",
      "executor_type": "order_executor",
      "connector_name": "ethereum-base",
      "trading_pair": "WETH-USDC",
      "controller_id": "main",
      "status": "RUNNING",
      "created_at": "2026-04-10T12:00:55.915203+00:00"
    }
    
    • Succesfully swapped MARKET BUY order https://basescan.org/tx/0xc267b9a9a97a97bf0d4ee2409f885f87e3a3020ae1b0d444a12b1a8fb4febaf5
    • Change to LIMIT and look for the swap/qoute for the price
      • Order executor created and completed swap https://basescan.org/tx/0xd54024dc38e0b9ea501b4369acaa25d1740360e934b1a28e3b9a4cae2890627d
      • Check executor_id details
        curl -s -u admin:admin http://localhost:8000/executors/4n2RcDtAtD8UTRm2ze1yRWzzKtgKQF5R63MEzsPHSt9a | jq '{executor_id,status,is_active,is_trading,error_count,last_error,close_type,close_timestamp,filled_amount_quote,cum_fees_quote,custom_info:{order_id,current_retries,max_retries,executed_amount_base,average_executed_price}}'
        {
          "executor_id": "4n2RcDtAtD8UTRm2ze1yRWzzKtgKQF5R63MEzsPHSt9a",
          "status": "TERMINATED",
          "is_active": false,
          "is_trading": false,
          "error_count": 0,
          "last_error": null,
          "close_type": "POSITION_HOLD",
          "close_timestamp": 1775822965.631609,
          "filled_amount_quote": 2.000475,
          "cum_fees_quote": 0.001598840831873614
        }
        

Verify order_executor works with Gateway connector on Ethereum (ethereum-bsc) ✅

  • LIMIT and MARKET order ok

Copy link
Copy Markdown
Contributor

@rapcmia rapcmia left a comment

Choose a reason for hiding this comment

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

  • Build local .whl from hummingbot/8150
  • Build local docker image for gateway/620
  • Build local docker image for thsi PR using .whl
  • Start hummingbot-api using make deploy
  • Start gateway using gateway/620 image
  • Test lp_exexecutor
    • Requires connector_name e.g solana-mainnet-beta, ethereum-base etc..
    • Set lp_provider e.g meteora/clmm, orca/clmm etc..
    • Side updated 1 (buy), 2(sell) and 3(range)
    • Executor details shows which side, lp_provider
    • Executor closed
      • LP position closed with TERMINATED state and closed as EARLY_STOP
  • Test order_executor
    • Same required connector_name e.g ethereum-{bsc,base}, solana-mainnet-beta, etc.
    • Test LIMIT, price got from /gateway/swap/qoute route ok
    • Test MARKET, ok
    • Executor closed as POSITION_HOLD status TERMINATED
  • There are instances of tests that executor failed due to reported issues fixed by dev
    • Forced close executor that are stuck on RUNNING state by relaunc hummingbot-api
    • Executor stopped with status TERMINATED closed as SYSTEM_CLEANUP
  • Retry transaction is observed on scenarios of transaction timeout on gateway
  • All position were successfully created and closed. Transaction hashses and fees matched logs and returned data from gateway

Remove hardcoded gateway_default_pricing_connector mapping and use
get_price with full network name which auto-resolves dex/trading_type
from the network's configured swap provider.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rapcmia rapcmia merged commit 40b2de0 into main Apr 20, 2026
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