Kurdistan Tech Ministry
b187105c18
fix: DEX swap calculation and wallet refresh issues
- 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
2025-11-01 08:18:24 +03:00
..
2025-10-22 18:21:46 -07:00
2025-10-28 23:12:51 +03:00
2025-10-28 23:12:51 +03:00
2025-10-22 18:21:46 -07:00
2025-10-22 18:21:46 -07:00
2025-10-22 18:21:46 -07:00
2025-10-28 23:12:51 +03:00
2025-10-22 18:21:46 -07:00
2025-10-28 21:48:48 +03:00
2025-10-28 23:12:51 +03:00
2025-10-22 18:21:46 -07:00
2025-10-29 02:02:11 +03:00
2025-10-28 08:04:14 +03:00
2025-10-29 04:04:50 +03:00
2025-10-22 18:21:46 -07:00
2025-10-22 18:21:46 -07:00
2025-10-27 23:52:36 +03:00
2025-10-22 18:21:46 -07:00
2025-10-27 23:52:36 +03:00
2025-10-22 18:21:46 -07:00
2025-10-27 23:52:36 +03:00
2025-10-22 18:21:46 -07:00
2025-10-28 08:04:14 +03:00
2025-10-22 18:21:46 -07:00
2025-10-22 18:21:46 -07:00
2025-10-22 18:21:46 -07:00
2025-10-22 18:21:46 -07:00
2025-11-01 08:18:24 +03:00
2025-10-28 08:04:14 +03:00
2025-10-28 08:04:14 +03:00
2025-10-22 18:21:46 -07:00