@yoroi/swap
Version:
The Swap package of Yoroi SDK
12 lines (11 loc) • 449 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getBestSwap = void 0;
const getBestSwap = tokenOutPrice => (best, candidate) => {
if (candidate.totalOutput - (tokenOutPrice > 0 ? candidate.totalFee / tokenOutPrice : 0) > best.totalOutput - (tokenOutPrice > 0 ? best.totalFee / tokenOutPrice : 0)) return candidate;
return best;
};
exports.getBestSwap = getBestSwap;
//# sourceMappingURL=getBestSwap.js.map