Conversation
## Price Calculation Fix - Fix inconsistent price calculation between BUY and SELL operations - Ensure both sides return price in same units (quote per base token) - BUY operations now return comparable prices to SELL operations ## Decimal Handling Fix - Replace flawed toFixed() approach with ethers parseUnits() - Prevent "fractional component exceeds decimals" errors - Handle all token decimals correctly (6 for USDC, 18 for ETH, etc.) ## EIP-1559 Gas Pricing - Implement proper EIP-1559 gas pricing for supported networks - Calculate maxFeePerGas as 2 * baseFee + maxPriorityFeePerGas - Graceful fallback to legacy pricing when needed - Fix "max fee per gas less than block base fee" errors ## Approval System Improvements - Add @fastify/sensible plugin for proper error handling - Implement intelligent allowance checking for Permit2 flow - Skip unnecessary approval transactions when allowances exist - Increase timeout from 12s to 60s for approval transactions - Add null checks for transaction receipts ## Performance & UX Enhancements - Skip ERC20 approval if sufficient allowance exists - Skip Permit2 approval if sufficient unexpired allowance exists - Instant response when no approvals needed - Significant gas savings for repeat users 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
fix: comprehensive Uniswap router and approval improvements
rapcmia
approved these changes
Sep 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting this PR, please make sure:
A description of the changes proposed in the pull request:
#514
Tests performed by the developer:
Tips for QA testing: