"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.aprToLoss = exports.aprToApy = void 0;
var utils_1 = require("../utils");
function aprToApy(apr, dec) {
    if (!apr || dec == null)
        return utils_1.N_A;
    return (0, utils_1.formatPercentage)(Math.pow(1 + parseFloat((0, utils_1.formatUnits)(apr, dec)) / 365, 365) - 1);
}
exports.aprToApy = aprToApy;
function aprToLoss(apr, dec) {
    if (!apr || dec == null)
        return utils_1.N_A;
    return (0, utils_1.formatPercentage)(parseFloat((0, utils_1.formatUnits)(apr, dec)) / 365);
}
exports.aprToLoss = aprToLoss;
//# sourceMappingURL=apr.js.map