-
-
Notifications
You must be signed in to change notification settings - Fork 246
Gateway v2.6 updates #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gateway v2.6 updates #444
Conversation
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.
- 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>
|
[heart] Susruth Nadimpalli reacted to your message:
…________________________________
From: Michael Feng ***@***.***>
Sent: Saturday, May 17, 2025 1:17:52 PM
To: hummingbot/gateway ***@***.***>
Cc: Susruth Nadimpalli ***@***.***>; Comment ***@***.***>
Subject: Re: [hummingbot/gateway] Gateway v2.6 updates (PR #444)
[https://avatars.githubusercontent.com/u/1795030?s=20&v=4]fengtality left a comment (hummingbot/gateway#444)<#444 (comment)>
there's a lot going on in this PR with the add-back of Ethereum + Uniswap <br> connectors and refactored tests. I'll try to add Unichain in the next <br> release. <br> <br> On Sat, May 17, 2025, 12:46 AM Nadimpalli Susruth ***@***.***> <br> wrote: <br> <br> > *susruth* left a comment (hummingbot/gateway#444) <br> > <#444 (comment)> <br> > <br> > Is it possible to add unichain to this PR as well? the liquidity has <br> > gotten very deep for Uniswap on Unichain in the last few weeks <br> > https://app.uniswap.org/explore/tokens/unichain <br> > <br> > — <br> > Reply to this email directly, view it on GitHub <br> > <#444 (comment)>, <br> > or unsubscribe <br> > <https://github.com/notifications/unsubscribe-auth/AANWHVXDSKKMBDQNBJ5HPOD263SL3AVCNFSM6AAAAAB4NWCK2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBYGE4TKMZUHA> <br> > . <br> > You are receiving this because you authored the thread.Message ID: <br> > ***@***.***> <br> > <br>
—
Reply to this email directly, view it on GitHub<#444 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADSLWO7PTKT36OSGUS57LLT264ZIBAVCNFSM6AAAAAB4NWCK2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBYGM4DONZYGQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
first one total_amount_quote: '10' second - total_amount_quote: '0.002' |
|
@nikspz I fixed the update_allowances issue. I will check how uniswap/amm performs balance checks later. |
|
@nikspz please upload your arbitrage controller config file. I ran using the config below and it seemed to work without the balance issue: |
Restarted with this config using binance: Restarted using infura node still not going 2605.zip failed to approve using client ❌ Also noticed minor issue when you restart gateway and Client Manually using http://localhost:15888/docs: |
…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>
Before submitting this PR, please make sure:
A description of the changes proposed in the pull request: