WIP: slipage for swapAmounts
This commit is contained in:
@@ -29,7 +29,7 @@ export function calculateSlippage(
|
||||
const swapPrice = Number(swapOutputAmount) / (Number(swapInputAmount) - Number(swapFee));
|
||||
|
||||
// Calculate slippage percentage: ((swapPrice - marketPrice) / marketPrice) * 100
|
||||
const slippage = ((swapPrice - marketPrice) / marketPrice) * 100;
|
||||
const slippage = ((marketPrice - swapPrice) / marketPrice) * 100;
|
||||
|
||||
return slippage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user