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

Conversation

@nikspz
Copy link
Contributor

@nikspz nikspz commented Sep 22, 2025

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:
#514

Tests performed by the developer:

Tips for QA testing:

fengtality and others added 4 commits September 17, 2025 21:10
## 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 rapcmia merged commit e77c3ef into staging Sep 22, 2025
7 checks passed
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.

4 participants