@lifi/widget
Version:
LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
11 lines (10 loc) • 353 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calcValueLoss = void 0;
const calcValueLoss = (route) => {
return `${((Number(route.toAmountUSD || 0) /
(Number(route.fromAmountUSD || 0) + Number(route.gasCostUSD || 0)) -
1) *
100).toFixed(2)}%`;
};
exports.calcValueLoss = calcValueLoss;