@merkl/api 0.10.204 → 0.10.206

Sign up to get free protection for your applications and to get access to all the features.
package/dist/src/index.js CHANGED
@@ -41,7 +41,7 @@ const app = new Elysia({
41
41
  exclude: [/v4\/.*/, "/"],
42
42
  }))
43
43
  .use(swagger({
44
- path: "/v4/docs",
44
+ path: "/",
45
45
  scalarConfig: {
46
46
  theme: "kepler",
47
47
  darkMode: true,
@@ -311,7 +311,7 @@ export class RewardService {
311
311
  for (const { amount, rewardToken: address, chainId, startTimestamp: start, endTimestamp: end, campaignId, } of dynamicData) {
312
312
  const timespan = Math.abs(end - start);
313
313
  const dayspan = Math.max(1, Math.floor(timespan / (60 * 60 * 24)));
314
- const dailyAmount = moment.now() < start ? BigInt(amount) / BigInt(dayspan) : BigInt(0);
314
+ const dailyAmount = moment().unix() <= end && moment().unix() >= start ? BigInt(amount) / BigInt(dayspan) : BigInt(0);
315
315
  const campaignDailyValue = await TokenService.getValue([{ amount: dailyAmount, address, chainId }]);
316
316
  breakdowns.push({
317
317
  campaignId: CampaignService.hashId({ campaignId, distributionChain: chainId }),