这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@fengtality
Copy link
Contributor

Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:

  • additional routes for Raydium connector
  • updated Ethereum and Uniswap connectors
  • unit tests
  • refactored code architecture

fengtality and others added 16 commits April 17, 2025 15:58
Removed the following unused dependencies:
- abi-decoder
- body-parser
- express-winston
- graphql-request
- http-status-codes
- immutable
- lodash
- morgan
- node-cache
- promise-retry
- swagger-ui-express
- web3

Also removed related type definitions:
- @types/lodash
- @types/morgan
- @types/promise-retry
- @types/swagger-ui-express

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Update getSpender to resolve 'uniswap' spender to the correct contract address
- Add import for UniswapConfig
- This ensures ethereum spender works properly with connector strings

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Reordered examples to list 'uniswap' as the first option for spender parameter in allowances and approve routes
- This makes it clearer to users that 'uniswap' is the recommended spender value

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed nonce, maxFeePerGas, and maxPriorityFeePerGas parameters from the approve endpoint
- Updated approve route handler to rely on ethereum.ts for gas fee and nonce management
- Simplified API schema to make it more user-friendly
- Added clear comments explaining reliance on ethereum.ts for parameter management

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced documentation for the amount parameter in the approve endpoint
- Clarified that amount defaults to unlimited approval (MaxUint256) if not provided
- Added more helpful description in Swagger UI for better user understanding
- No functional changes as the code already correctly handled optional amount

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed '10.5' example value from amount parameter in approve endpoint
- This better reflects typical usage where amount is omitted for unlimited approval
- Leaving the examples array empty encourages users to omit the parameter

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Updated all Ethereum route examples to list 'base' as the first network option
- Changed the instance creation in route handlers from 'sepolia' to 'base'
- Updated examples across all Ethereum routes: allowances, approve, balances, status, tokens, poll, and estimate-gas
- This makes Base the default network in the API UI and examples

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Added special gas price handling for Base network:
  - Reduced gas price to 20% of the estimated price to prevent insufficient funds errors
  - Added balance check before sending transactions to provide better error messages
  - Improved error handling in approve route to provide more informative error messages
- Enhanced error handling in approve endpoint to properly relay specific errors
- Added detailed logging for gas prices and adjustments

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed manual gas price management to always use network-provided gas prices
- Simplified error handling to use Fastify errors directly
- Improved error message for insufficient funds errors
- Added detailed logging for network gas prices
- Removed complex balance checks and gas price adjustments

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Added maxPriorityFeePerGas, maxFeePerGas, gasLimit, and value to transaction response
- Set default values to null or '0' when fields are not present
- Fixed serialization error in approve route when required fields were missing
- Improved transaction response structure to match schema definition

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed unnecessary legacy parameters from approveERC20 method: nonce, maxFeePerGas, maxPriorityFeePerGas, gasPrice
- Simplified gas handling to always use network-provided gas prices
- Updated approve route to match the simplified approveERC20 signature
- Enhanced logging with gas price information
- Made code more maintainable with consistent parameter handling

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Moved JSON schemas from services/schema to schemas/json folder
- Removed unused legacy interfaces from common-interfaces.ts
- Reorganized the codebase with a system folder housing config and connector routes
- Updated endpoints to use Fastify's native error handling instead of custom error handler
- Improved code modularity with individual route files in dedicated route folders
- Fixed config manager schema paths to maintain compatibility with the new structure
- Updated CLAUDE.md with improved best practices for code organization and error handling
- Removed unused Uniswap trade interfaces that were no longer needed

This refactoring improves code organization, reduces technical debt, and aligns with modern
Fastify best practices for modular API development.
@fengtality fengtality changed the base branch from main to development May 5, 2025 05:06
@rapcmia rapcmia requested review from nikspz and rapcmia May 5, 2025 06:25
@rapcmia rapcmia moved this to Backlog in Pull Request Board May 5, 2025
@fengtality fengtality marked this pull request as ready for review May 7, 2025 01:17
@rapcmia rapcmia moved this from Backlog to Under Review in Pull Request Board May 7, 2025
fengtality and others added 13 commits May 22, 2025 10:05
- Extract getUniswapClmmQuote function from formatSwapQuote for reuse
- Refactor executeSwap to use getUniswapClmmQuote instead of duplicating trade logic
- Eliminate code duplication between quote-swap and execute-swap routes
- Maintain same functionality while reducing complexity and ensuring consistency
- Follow Raydium pattern for better maintainability

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

Co-Authored-By: Claude <noreply@anthropic.com>
…MM swaps

Replace SDK-based swap routing with direct SwapRouter02 contract interaction using exactInputSingle/exactOutputSingle methods. Add SwapRouter02 and QuoterV2 ABI definitions. Simplify token address handling and improve error logging for better debugging.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Refactor AMM quoteSwap to follow CLMM structure with shared getUniswapAmmQuote function
- Add execution-ready raw values (rawAmountIn, rawAmountOut, pathAddresses) to quote response
- Simplify AMM executeSwap to use direct Router02 contract calls with quote reuse
- Add proper allowance checking to prevent transaction failures
- Remove complex SDK routing logic and helper functions (558 → 300 lines)
- Register @fastify/sensible plugin for consistent error handling
- Improve logging and error messages for better debugging

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

Co-Authored-By: Claude <noreply@anthropic.com>
…event replacement transaction errors

- Replace automatic approval calls with allowance validation like executeSwap route
- Add shared getUniswapAmmLiquidityQuote function for quote reuse pattern
- Check allowances for all token combinations (ETH+Token, Token+ETH, Token+Token)
- Throw descriptive errors when allowances are insufficient instead of auto-approving
- Register @fastify/sensible plugin for proper error handling
- Prevent "replacement fee too low" errors caused by duplicate approval transactions

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

Co-Authored-By: Claude <noreply@anthropic.com>
…ontract improvements

- Add @fastify/sensible plugin registration to all remaining Uniswap routes
- Update contract interfaces and ABI imports for consistency
- Improve error handling across CLMM and AMM routes
- Update test files for compatibility with refactored routes
- Clean up import statements and unused code
- Ensure consistent patterns across all Uniswap connectors

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add @fastify/sensible plugin registration to Ethereum and Solana chain routes
- Improve error handling and logging consistency across chain routes
- Format code for better readability and consistency
- Update balance retrieval with better timeout handling
- Enhance route validation and response formatting

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

Co-Authored-By: Claude <noreply@anthropic.com>
…chemas

- Remove chain parameter from quote-liquidity and add-liquidity route schemas
- Chain is not needed since Uniswap operates on Ethereum-compatible networks
- Keep only network parameter which is sufficient for chain identification
- Clean up API interface by removing redundant schema fields

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

Co-Authored-By: Claude <noreply@anthropic.com>
…able errors

- Handle insufficient funds errors with clear 400 Bad Request response
- Return descriptive message about needing more ETH for gas fees
- Maintain existing allowance error handling
- Convert generic 500 errors to actionable 400 errors where appropriate
- Improve user experience with specific error guidance

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add logging for raw LP balance and total supply values
- Add logging for formatted amounts to verify calculations
- Temporary debugging to investigate LP token amount precision

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

Co-Authored-By: Claude <noreply@anthropic.com>
…riods in DEX schemas

This resolves server startup failures when config files contain tokens like 'USDC.e' by updating the regex pattern from ^[A-Z]+-[A-Z]+$ to ^[A-Za-z0-9.-]+-[A-Za-z0-9.-]+$ in uniswap, raydium, and meteora schemas.

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

Co-Authored-By: Claude <noreply@anthropic.com>
…king in Uniswap AMM routes

- Remove automatic approval transaction from remove liquidity route that was causing unwanted on-chain transactions
- Add proper allowance checking that throws clear error messages instead of auto-approving
- Extract checkLPAllowance function to positionInfo.ts for reuse across routes
- Consolidate contract ABIs in uniswap.contracts.ts to reduce code duplication
- Fix TypeScript compilation errors with proper contract type usage
- Improve error handling with specific insufficient funds messaging
- Update schema examples and remove deprecated chain parameter

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix tick calculation to account for token decimal differences
- Update pool-info to show correct price calculations
- Fix position-info to use computePoolAddress from SDK
- Improve quote-position to handle decimal-adjusted ticks correctly
- Fix open-position and add-liquidity multicall implementations
- Add comprehensive debug logging for troubleshooting

The main issue was that Uniswap V3 ticks represent prices in raw token units,
not human-readable prices. For WETH/USDC pairs, this results in negative ticks
due to the 12 decimal difference between the tokens.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace automatic token approval with allowance checks
- Add decimal-adjusted tick calculation to open-position route
- Improve error messages for common failure cases
- Add comprehensive logging for debugging
- Check ETH balance for WETH positions
- Follow same error handling pattern as AMM routes

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

Co-Authored-By: Claude <noreply@anthropic.com>
@susruth
Copy link

susruth commented May 23, 2025 via email

@nikspz
Copy link
Contributor

nikspz commented May 23, 2025

  • Cloned and installed commit [59de20b](59de20b) + Client Feat/gateway 2.6 hummingbot#7612

  • amm_arb v1

    • after start of the strategy Unexpected error while checking for network status: 'GatewayLp' object has no attribute 'update_allowances'
      Traceback (most recent call last):
      logs_conf_amm_arb_1.log
    2025-05-23 15:13:23,207 - 1046 - hummingbot.client.hummingbot_application - INFO - start command initiated.
    2025-05-23 15:13:23,209 - 1046 - hummingbot.core.network_iterator - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
    2025-05-23 15:13:23,212 - 1046 - GatewayLp - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
    2025-05-23 15:13:23,212 - 1046 - GatewayLp - ERROR - Unexpected error while checking for network status: 'GatewayLp' object has no attribute 'update_allowances'
    Traceback (most recent call last):
      File "hummingbot/core/network_iterator.pyx", line 99, in hummingbot.core.network_iterator.NetworkIterator._check_network_loop
        await self.start_network()
      File "/home/etozhe/clientgw2.6/hummingbot/connector/gateway/gateway_base.py", line 201, in start_network
        self._get_allowances_task = safe_ensure_future(self.update_allowances())
                                                       ^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'GatewayLp' object has no attribute 'update_allowances'. Did you mean: 'update_balances'?
    2025-05-23 15:13:24,319 - 1046 - hummingbot.connector.exchange.binance.binance_api_order_book_data_source.BinanceAPIOrderBookDataSource - INFO - Subscribed to public order book and trade channels...
    2025-05-23 15:13:24,330 - 1046 - hummingbot.core.data_type.order_book_tracker - INFO - Initialized order book for ETH-USDC. 1/1 completed.
    2025-05-23 15:13:28,000 - 1046 - hummingbot.strategy.amm_arb.amm_arb - INFO - Markets are ready. Trading started.
    2025-05-23 15:13:28,501 - 1046 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
    2025-05-23 15:13:30,376 - 1046 - hummingbot.strategy.amm_arb.amm_arb - INFO - Found arbitrage opportunity!: First Side - Connector: uniswap/amm_ethereum_arbitrum  Side: buy  Quote Price: 0.0003739620682794903  Order Price: 0.000377701688962  Amount: 0.002000  Extra Fees: [TokenAmount(token='ETH', amount=Decimal('0.00003000000000000000076002572291233860823922441340982913970947265625'))]
    Second Side - Connector: binance_PaperTrade  Side: sell  Quote Price: 2658.3  Order Price: 2658.3000000000  Amount: 0.0020000  Extra Fees: []
    2025-05-23 15:13:30,377 - 1046 - hummingbot.strategy.amm_arb.amm_arb - INFO - Placing BUY order for 0.002000 WETH at uniswap/amm_ethereum_arbitrum at 0.000377701688962 price [clock=2025-05-23 08:13:30+00:00]
    2025-05-23 15:13:32,774 - 1046 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/connectors/uniswap/amm/execute-swap failed. See logs for more details.
    2025-05-23 15:13:32,774 - 1046 - GatewayLp - ERROR - Error submitting BUY swap order for WETH-USDC on uniswap/amm: Error on POST https://localhost:15888/connectors/uniswap/amm/execute-swap Error: InternalServerError
    Traceback (most recent call last):
      File "/home/etozhe/clientgw2.6/hummingbot/connector/gateway/gateway_swap.py", line 189, in _create_order
        order_result: Dict[str, Any] = await self._get_gateway_instance().execute_swap(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/etozhe/clientgw2.6/hummingbot/core/gateway/gateway_http_client.py", line 540, in execute_swap
        return await self.api_request(
               ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/etozhe/clientgw2.6/hummingbot/core/gateway/gateway_http_client.py", line 235, in api_request
        raise e
      File "/home/etozhe/clientgw2.6/hummingbot/core/gateway/gateway_http_client.py", line 221, in api_request
        raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response['error']}")
    ValueError: Error on POST https://localhost:15888/connectors/uniswap/amm/execute-swap Error: InternalServerError
  • arb script v2

    • got same error on GatewayLp - ERROR - Unexpected error while checking for network status: 'GatewayLp' object has no attribute 'update_allowances'
    • for some reason Client also think I need 5.68 of WETH

logs_arb-binance2.log

2025-05-23 16:06:46,327 - 1162 - hummingbot.client.hummingbot_application - INFO - start command initiated.
2025-05-23 16:06:46,382 - 1162 - GatewayLp - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2025-05-23 16:06:46,383 - 1162 - GatewayLp - ERROR - Unexpected error while checking for network status: 'GatewayLp' object has no attribute 'update_allowances'
Traceback (most recent call last):
  File "hummingbot/core/network_iterator.pyx", line 99, in hummingbot.core.network_iterator.NetworkIterator._check_network_loop
    await self.start_network()
  File "/home/etozhe/clientgw2.6/hummingbot/connector/gateway/gateway_base.py", line 201, in start_network
    self._get_allowances_task = safe_ensure_future(self.update_allowances())
                                                   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GatewayLp' object has no attribute 'update_allowances'. Did you mean: 'update_balances'?
2025-05-23 16:06:46,766 - 1162 - hummingbot.connector.exchange.binance.binance_exchange.BinanceExchange - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2025-05-23 16:06:46,770 - 1162 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Starting listen key management task...
2025-05-23 16:06:47,006 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:06:47,006 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - binance is not ready. Please wait...
2025-05-23 16:06:47,061 - 1162 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Successfully obtained listen key J2Y6nmSjmKr9FSyTNxxeM1Dgzmo5dGKncyWcTp6CxfqaBmSBuLt5M2F2nt70
2025-05-23 16:06:47,061 - 1162 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Connecting to user stream with listen key J2Y6nmSjmKr9FSyTNxxeM1Dgzmo5dGKncyWcTp6CxfqaBmSBuLt5M2F2nt70
2025-05-23 16:06:47,585 - 1162 - hummingbot.connector.exchange.binance.binance_api_order_book_data_source.BinanceAPIOrderBookDataSource - INFO - Subscribed to public order book and trade channels...
2025-05-23 16:06:47,589 - 1162 - hummingbot.core.data_type.order_book_tracker - INFO - Initialized order book for ETH-USDC. 1/1 completed.
2025-05-23 16:06:47,822 - 1162 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Successfully connected to user stream
2025-05-23 16:06:48,001 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:06:48,001 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - binance is not ready. Please wait...
2025-05-23 16:06:49,000 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:06:50,000 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:06:51,000 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:06:52,001 - 1162 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:06:52,368 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - INFO - Insufficient balance in exchange binance to sell ETH Actual: 0.01859293 --> Needed: 28438.038430
2025-05-23 16:06:52,368 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - ERROR - Not enough budget to open position.
2025-05-23 16:06:52,368 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - INFO - Insufficient balance in exchange uniswap/amm_ethereum_arbitrum to sell WETH Actual: 0.009629826463986035 --> Needed: 28438.03840000
2025-05-23 16:06:52,369 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - ERROR - Not enough budget to open position.
2025-05-23 16:06:53,206 - 1162 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2025-05-23 16:07:02,380 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - INFO - Insufficient balance in exchange binance to sell ETH Actual: 0.01859293 --> Needed: 28438.038430
2025-05-23 16:07:02,381 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - ERROR - Not enough budget to open position.
2025-05-23 16:07:02,381 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - INFO - Insufficient balance in exchange uniswap/amm_ethereum_arbitrum to sell WETH Actual: 0.009629826463986035 --> Needed: 28438.03840000
2025-05-23 16:07:02,381 - 1162 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - ERROR - Not enough budget to open position.
2025-05-23 16:07:04,791 - 1162 - hummingbot.client.hummingbot_application - INFO - stop command initiated.
2025-05-23 16:07:07,050 - 1162 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - User stream interrupted. Cleaning up...
2025-05-23 16:07:07,206 - 1162 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Successfully obtained listen key J2Y6nmSjmKr9FSyTNxxeM1Dgzmo5dGKncyWcTp6CxfqaBmSBuLt5M2F2nt70
2025-05-23 16:08:07,846 - 1162 - hummingbot.client.hummingbot_application - ERROR - MQTT is already stopped!
2025-05-23 16:12:45,007 - 1201 - hummingbot.client.hummingbot_application - INFO - Creating the clock with tick size: 1.0
2025-05-23 16:12:45,012 - 1201 - hummingbot.client.hummingbot_application - INFO - start command initiated.
2025-05-23 16:12:45,085 - 1201 - GatewayLp - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2025-05-23 16:12:45,085 - 1201 - GatewayLp - ERROR - Unexpected error while checking for network status: 'GatewayLp' object has no attribute 'update_allowances'
Traceback (most recent call last):
  File "hummingbot/core/network_iterator.pyx", line 99, in hummingbot.core.network_iterator.NetworkIterator._check_network_loop
    await self.start_network()
  File "/home/etozhe/clientgw2.6/hummingbot/connector/gateway/gateway_base.py", line 201, in start_network
    self._get_allowances_task = safe_ensure_future(self.update_allowances())
                                                   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GatewayLp' object has no attribute 'update_allowances'. Did you mean: 'update_balances'?
2025-05-23 16:12:45,306 - 1201 - hummingbot.connector.exchange.binance.binance_exchange.BinanceExchange - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2025-05-23 16:12:45,315 - 1201 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Starting listen key management task...
2025-05-23 16:12:45,569 - 1201 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Successfully obtained listen key J2Y6nmSjmKr9FSyTNxxeM1Dgzmo5dGKncyWcTp6CxfqaBmSBuLt5M2F2nt70
2025-05-23 16:12:45,570 - 1201 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Connecting to user stream with listen key J2Y6nmSjmKr9FSyTNxxeM1Dgzmo5dGKncyWcTp6CxfqaBmSBuLt5M2F2nt70
2025-05-23 16:12:46,145 - 1201 - hummingbot.core.data_type.order_book_tracker - INFO - Initialized order book for ETH-USDC. 1/1 completed.
2025-05-23 16:12:46,145 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:12:46,145 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - binance is not ready. Please wait...
2025-05-23 16:12:46,262 - 1201 - hummingbot.connector.exchange.binance.binance_api_order_book_data_source.BinanceAPIOrderBookDataSource - INFO - Subscribed to public order book and trade channels...
2025-05-23 16:12:46,492 - 1201 - hummingbot.connector.exchange.binance.binance_api_user_stream_data_source.BinanceAPIUserStreamDataSource - INFO - Successfully connected to user stream
2025-05-23 16:12:47,001 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:12:47,001 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - binance is not ready. Please wait...
2025-05-23 16:12:48,001 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:12:49,001 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:12:50,001 - 1201 - hummingbot.strategy.script_strategy_base - WARNING - uniswap/amm_ethereum_arbitrum is not ready. Please wait...
2025-05-23 16:12:51,027 - 1201 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2025-05-23 16:12:51,152 - 1201 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - INFO - Insufficient balance in exchange binance to sell ETH Actual: 0.01859293 --> Needed: 5.688878
2025-05-23 16:12:51,152 - 1201 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - ERROR - Not enough budget to open position.
2025-05-23 16:12:51,152 - 1201 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - INFO - Insufficient balance in exchange uniswap/amm_ethereum_arbitrum to sell WETH Actual: 0.009629826463986035 --> Needed: 5.68880000
2025-05-23 16:12:51,152 - 1201 - hummingbot.strategy_v2.executors.arbitrage_executor.arbitrage_executor - ERROR - Not enough budget to open position.
2025-05-23 16:13:45,096 - 1201 - GatewayLp - ERROR - Unexpected error while checking for network status: 'GatewayLp' object has no attribute 'update_allowances'
Traceback (most recent call last):
  File "hummingbot/core/network_iterator.pyx", line 99, in hummingbot.core.network_iterator.NetworkIterator._check_network_loop
    await self.start_network()
  File "/home/etozhe/clientgw2.6/hummingbot/connector/gateway/gateway_base.py", line 201, in start_network
    self._get_allowances_task = safe_ensure_future(self.update_allowances())
                                                   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GatewayLp' object has no attribute 'update_allowances'. Did you mean: 'update_balances'?

first one total_amount_quote: '10'
image

second - total_amount_quote: '0.002'

image

@fengtality
Copy link
Contributor Author

@nikspz I fixed the update_allowances issue. I will check how uniswap/amm performs balance checks later.

@fengtality
Copy link
Contributor Author

@nikspz please upload your arbitrage controller config file. I ran using the config below and it seemed to work without the balance issue:

id: 5u2qYCu48UC4WG3QZSqfqAXrm16XMTRCcwPNPj7ePzYU
controller_name: arbitrage_controller
controller_type: generic
total_amount_quote: '3'
manual_kill_switch: false
candles_config: []
exchange_pair_1:
  connector_name: okx
  trading_pair: ETH-USDT
exchange_pair_2:
  connector_name: uniswap/amm_ethereum_base
  trading_pair: WETH-USDC
min_profitability: '0.01'
delay_between_executors: 10
max_executors_imbalance: 1
rate_connector: okx
quote_conversion_asset: USDT

@nikspz
Copy link
Contributor

nikspz commented May 26, 2025

id: 5u2qYCu48UC4WG3QZSqfqAXrm16XMTRCcwPNPj7ePzYU
controller_name: arbitrage_controller
controller_type: generic
total_amount_quote: '3'
manual_kill_switch: false
candles_config: []
exchange_pair_1:
  connector_name: okx
  trading_pair: ETH-USDT
exchange_pair_2:
  connector_name: uniswap/amm_ethereum_base
  trading_pair: WETH-USDC
min_profitability: '0.01'
delay_between_executors: 10
max_executors_imbalance: 1
rate_connector: okx
quote_conversion_asset: USDT

Restarted with this config using binance:
I have issue when successful uniswap/amm_ethereum_base not recorded as filled
arb2base.zip
logs_arb2base.log

Restarted using infura node still not going

2605.zip
logs_gateway_app.log.2025-05-26.zip

failed to approve using client ❌

image
image

Also noticed minor issue when you restart gateway and Client
image

Manually using http://localhost:15888/docs:
POST /connectors/uniswap/amm/execute-swap Sell✅

fengtality and others added 7 commits May 29, 2025 16:33
…d SDK

- Migrate from @jup-ag/api SDK to direct REST API calls using axios
- Update base URL from quote-api.jup.ag/v6 to lite-api.jup.ag
- Update endpoints to /swap/v1/quote and /swap/v1/swap
- Add API key support in configuration for paid tiers
- Fix BUY order implementation using proper ExactOut mode
- Simplify error handling for ExactOut not supported cases
- Remove complex fallback logic, return clear error messages
- Update tests to cover new implementation with schema compliance
- Remove unnecessary test files, focus on main swap.test.js
- Fix Uniswap AMM InsufficientReservesError handling

BREAKING CHANGE: Jupiter connector now requires REST API instead of SDK

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

Co-Authored-By: Claude <noreply@anthropic.com>
…e mocks

- Fixed Jupiter connector BUY mode by removing maxAccounts parameter for ExactOut
- Updated all connector tests (Jupiter, Meteora, Raydium, Uniswap) with real API responses
- Reorganized test structure: moved mocks from test/mocks to test/[connector]/mocks
- Moved chain tests to appropriate subdirectories (ethereum/solana)
- Added comprehensive mock variations for each endpoint:
  - Valid responses for SELL and BUY orders
  - Invalid token/amount error responses
  - Insufficient liquidity errors
  - Position not found errors
  - Empty positions lists
- Fixed Meteora CLMM tests to use correct pool address and parameters
- Updated validation functions to match actual API response structures
- Fixed test expectations to match real response data (fees, balance changes)
- Removed redundant test files and templates

All tests now use real data from actual endpoints, making them more reliable
and accurate representations of the Gateway's behavior.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove wallet.controllers.test.ts, wallet.routes.test.ts, and wallet-security.test.ts
- Add chain-specific wallet tests for Ethereum and Solana
- Prevent test pollution by properly mocking fs-extra operations
- Remove creation of fake wallet 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf
- Force future chain implementations to include wallet operation tests
- Tests cover full wallet lifecycle: add, fetch, and remove operations
- Include chain-specific validation (e.g., base58 for Solana)

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Update all schema definitions to use 'signature' instead of 'txHash'
- Update Ethereum and Solana poll routes to accept 'signature' parameter
- Update approve and wrap routes to return 'signature' in responses
- Fix Uniswap connector references to use wrapResult.signature
- Update all related tests and mock data to match new naming convention
- Ensures consistency with Hummingbot's polling function expectations

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Delete legacy src/schemas/common-interfaces.ts file with unused exports
- Remove unused imports from chain-schema.ts (NetworkSelectionRequest, CustomTransactionReceipt, CustomTransactionResponse, TokenInfo)
- All tests and build pass successfully after cleanup

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove LegacySchemasBaseDir from config-manager-v2.ts
- Move all JSON schema files from src/schemas/json/ to src/templates/json/
- Update config-manager to always use dist/src/templates/json/ for schemas
- Update package.json copy-files script to remove old schema path
- Apply linter formatting fixes across multiple files

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Update price formula to account for BUY vs SELL orders
- BUY: price = estimatedAmountIn / estimatedAmountOut (quote needed per base)
- SELL: price = estimatedAmountOut / estimatedAmountIn (quote received per base)
- Fix applied to AMM, CLMM, and general swap routes
- Update tests to use correct price calculations for BUY order mocks

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

Co-Authored-By: Claude <noreply@anthropic.com>
@fengtality fengtality merged commit d7e9274 into development Jun 7, 2025
4 checks passed
@fengtality fengtality deleted the core-2.6 branch June 7, 2025 13:59
@rapcmia rapcmia moved this from Under Review to Development 2.6.0 in Pull Request Board Jun 9, 2025
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.

6 participants