Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
629 B
2
Indexable
export const getTotalRewardLaunchPool = ({
  paidType,
  endTime,
  startTime,
  cycleReward,
}) => {
  if (paidType === FARMING_PAID_TYPE.DAILY) {
    console.log('remain ', Math.abs(endTime - startTime) / (24 * 3600));
    return (
      Math.floor(Math.abs(endTime - startTime) / (24 * 3600)) * cycleReward
    );
  }

  if (paidType === FARMING_PAID_TYPE.WEEKLY) {
    return (
      Math.floor(Math.abs(endTime - startTime) / (7 * 24 * 3600)) * cycleReward
    );
  }

  if (paidType === FARMING_PAID_TYPE.MONTHLY) {
    return (
      Math.floor(Math.abs(endTime - startTime) / (30 * 24 * 3600)) * cycleReward
    );
  }
};
Leave a Comment