feat / Use network as connector_name for Gateway executors#142
feat / Use network as connector_name for Gateway executors#142
Conversation
- 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>
c1953f0 to
51f48de
Compare
- 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>
|
Commit 6aafc3b
Pending:
|
- 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>
|
PR update:
Verify swap_executor can be created via POST /executors/ ✅
Verify swap completes with retry on pending transactions ✅
Verify swap completes with retry on pending transactions ✅
Verify order is created in
|
- 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>
|
Commit 1921079
Verify swap_executor appears in /executors/types/available ✅
Verify swap_executor can be created via POST /executors/
I reviewed all swap attempt and found this block on hummingbot-api logs where
Attached is a a summary of the bug we found: |
- 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>
|
Commit 13bd7d5
I observed a behavior for
|
- 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>
- 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>
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>
d7d656b to
87ab393
Compare
|
Commit 87ab393
Verify lp_executor can be created with
|
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>
|
Commit ec2be3d
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 order_executor works with Gateway connector (solana-mainnet-beta) ✅
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 on Ethereum (ethereum-base) ✅
Verify order_executor works with Gateway connector on Ethereum (ethereum-bsc) ✅
|
rapcmia
left a comment
There was a problem hiding this comment.
- 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/qouteroute 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>







Summary
connector_namenow uses the network identifier (e.g.,solana-mainnet-beta) instead of connector typelp_providerfield for DEX/trading_type (e.g.,meteora/clmm)Key Changes
models/executors.py: Update lp_executor example to useconnector_name: "solana-mainnet-beta"andlp_provider: "meteora/clmm"services/executor_service.py: Handle optional trading_pair - useadd_market()when provided,ensure_connector()otherwiseservices/unified_connector_service.py: Detect Gateway connectors via AllConnectorSettingsbots/controllers/generic/lp_rebalancer/lp_rebalancer.py: Update to use new provider architecture with autoswap via OrderExecutorAPI 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
Dependencies
Test plan
connector_name: "solana-mainnet-beta"andlp_provider: "meteora/clmm"connector_name: "ethereum-base"andlp_provider: "uniswap/clmm"connector_name: "ethereum-bsc"andlp_provider: "pancakeswap/clmm"solana-mainnet-beta)ethereum-base)ethereum-bsc)