import BigNumber from "bignumber.js";
const makeSCurve = (params) => {
    const minMaxDiff = params.max.minus(params.min);
    const declineDayDiff = params.declineDay.minus(params.sCurveDecday);
    const rewardDiff = params.maxReward.minus(params.minReward);
    // day - is an offset from lockdrop start
    return (day) => {
        const powerCoeff = (new BigNumber(Math.pow(100, declineDayDiff.div(2).plus(params.sCurveDecday)
            .minus(day)
            .div(declineDayDiff)
            .toNumber()), 10)).plus(1);
        return minMaxDiff.div(powerCoeff)
            .negated()
            .plus(1)
            .times(rewardDiff)
            .plus(params.minReward)
            .div(100);
    };
};
const defaultSCurveParams = {
    min: new BigNumber("0", 10),
    max: new BigNumber("1", 10),
    sCurveDecday: new BigNumber("30", 10),
    declineDay: new BigNumber("60", 10),
    minReward: new BigNumber("0", 10),
    maxReward: new BigNumber("30", 10)
};
export const defaultSCurve = makeSCurve(defaultSCurveParams);
//# sourceMappingURL=math.js.map