mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 15:57:59 +00:00
fix: resolve DEX pool issues with XCM Location format and slippage calculation
- Fix PoolDashboard reserve fetching (was hardcoded to 0) - Fix slippage calculation bug in AddLiquidityModal - Add XCM Location format support for native token (-1) in all liquidity modals - Update KNOWN_TOKENS with correct wUSDT asset ID (1000) and add NATIVE_TOKEN_ID constant - Implement dynamic pool discovery in fetchPools() using XCM Location parsing - Update fetchUserLPPositions() to use correct LP token ID from chain - Add formatAssetLocation() helper to shared/utils/dex.ts
This commit is contained in:
@@ -104,7 +104,8 @@ export const AddLiquidityModal: React.FC<AddLiquidityModalProps> = ({
|
||||
if (assetDetails0.isSome) {
|
||||
const details0 = assetDetails0.unwrap().toJSON() as AssetDetails;
|
||||
const minBalance0Raw = details0.minBalance || '0';
|
||||
minBalance0 = Number(minBalance0Raw) / Math.pow(10, asset0Decimals);
|
||||
const fetchedMin0 = Number(minBalance0Raw) / Math.pow(10, asset0Decimals);
|
||||
minBalance0 = Math.max(fetchedMin0, 0.01); // Ensure at least 0.01
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +114,8 @@ export const AddLiquidityModal: React.FC<AddLiquidityModalProps> = ({
|
||||
if (assetDetails1.isSome) {
|
||||
const details1 = assetDetails1.unwrap().toJSON() as AssetDetails;
|
||||
const minBalance1Raw = details1.minBalance || '0';
|
||||
minBalance1 = Number(minBalance1Raw) / Math.pow(10, asset1Decimals);
|
||||
const fetchedMin1 = Number(minBalance1Raw) / Math.pow(10, asset1Decimals);
|
||||
minBalance1 = Math.max(fetchedMin1, 0.01); // Ensure at least 0.01
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user