@openocean.finance/widget
Version:
Openocean Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
16 lines • 465 B
JavaScript
import { getPriceImpact } from '../utils/getPriceImpact.js';
export const usePriceImpact = (route) => {
let priceImpact = 0;
if (route) {
priceImpact = getPriceImpact({
fromAmount: BigInt(route?.fromAmount),
toAmount: BigInt(route?.toAmount),
fromToken: route?.fromToken,
toToken: route?.toToken,
});
}
return {
priceImpact,
};
};
//# sourceMappingURL=usePriceImpact.js.map