mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-25 23:27:59 +00:00
b187105c18
- Fix AMM formula to use correct 3% LP fee (was 0.3%) - Runtime uses LPFee=30 (3% = 30/1000) - Changed to Uniswap V2 formula: amountOut = (amountIn * 970 * reserveOut) / (reserveIn * 1000 + amountIn * 970) - Fixes ProvidedMinimumNotSufficientForSwap error - Fix wallet disconnection after successful swap - Added refreshBalances() to WalletContext - Replaced window.location.reload() with refreshBalances() - Wallet connection now persists after swap Changes: - src/components/TokenSwap.tsx: Correct AMM formula, async callback for refresh - src/contexts/WalletContext.tsx: Add refreshBalances() export