|
23 | 23 | from hummingbot.connector.connector_metrics_collector import TradeVolumeMetricCollector |
24 | 24 | from hummingbot.connector.exchange_py_base import ExchangePyBase |
25 | 25 | from hummingbot.connector.gateway.gateway_lp import GatewayLp |
| 26 | +from hummingbot.connector.gateway.gateway_swap import GatewaySwap |
26 | 27 | from hummingbot.connector.perpetual_derivative_py_base import PerpetualDerivativePyBase |
27 | 28 | from hummingbot.core.data_type.common import OrderType, PositionAction, PositionMode, TradeType |
28 | 29 | from hummingbot.core.data_type.in_flight_order import InFlightOrder, OrderState |
@@ -643,17 +644,25 @@ def _create_trading_connector( |
643 | 644 | secrets_manager=self.secrets_manager |
644 | 645 | ) |
645 | 646 |
|
646 | | - # Gateway connectors (e.g., 'meteora/clmm', 'raydium/clmm') are not in AllConnectorSettings |
647 | | - # They use GatewayLp which auto-detects chain/network from gateway config |
| 647 | + # Gateway connectors (e.g., 'meteora/clmm', 'jupiter/router') are not in AllConnectorSettings |
| 648 | + # Router connectors use GatewaySwap, LP connectors use GatewayLp |
| 649 | + # Both auto-detect chain/network from gateway config |
648 | 650 | if '/' in connector_name: |
649 | | - logger.info(f"Creating gateway connector: {connector_name}") |
650 | | - # GatewayLp handles chain/network auto-detection and default wallet lookup |
651 | | - # via start_network() call |
652 | | - return GatewayLp( |
653 | | - connector_name=connector_name, |
654 | | - trading_pairs=[], |
655 | | - trading_required=True, |
656 | | - ) |
| 651 | + _, connector_type = connector_name.split('/', 1) |
| 652 | + if connector_type == 'router': |
| 653 | + logger.info(f"Creating gateway swap connector: {connector_name}") |
| 654 | + return GatewaySwap( |
| 655 | + connector_name=connector_name, |
| 656 | + trading_pairs=[], |
| 657 | + trading_required=True, |
| 658 | + ) |
| 659 | + else: |
| 660 | + logger.info(f"Creating gateway LP connector: {connector_name}") |
| 661 | + return GatewayLp( |
| 662 | + connector_name=connector_name, |
| 663 | + trading_pairs=[], |
| 664 | + trading_required=True, |
| 665 | + ) |
657 | 666 |
|
658 | 667 | conn_setting = self._conn_settings[connector_name] |
659 | 668 | keys = BackendAPISecurity.api_keys(connector_name) |
|
0 commit comments