UNPKG

@yoroi/swap

Version:
12 lines (11 loc) 449 B
"use strict"; 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