Skip to content

Commit

Permalink
A month is considered as 30 days for staking
Browse files Browse the repository at this point in the history
  • Loading branch information
snoopy1412 committed Nov 1, 2024
1 parent d0bb3bc commit b15150b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/hooks/useUserDepositDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@ export function useUserDepositDetails({ enabled = true }: UseUserDepositDetailsP
const startAt = Number(depositInfo?.[1] ?? 0);
const value = depositInfo?.[2] ?? 0;

// const endAt = dayjs
// .unix(startAt)
// .add(dayjs.duration({ months: Number(months) }))
// .unix();
const endAt = dayjs
.unix(startAt)
.add(dayjs.duration({ months: Number(months) }))
.unix(Number(startAt))
.add(Number(months) * 30, 'day')
.unix();

return {
Expand Down
7 changes: 6 additions & 1 deletion src/view/stake/_hooks/staked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ export const useStakedDepositsOf = ({ account, enabled = true }: StakedDepositsO

const months = depositOf?.[0] ?? 0n;
const startAt = Number(depositOf?.[1] ?? 0);
// const endAt = dayjs
// .unix(Number(startAt))
// .add(dayjs.duration({ months: Number(months) }))
// .unix();

const endAt = dayjs
.unix(Number(startAt))
.add(dayjs.duration({ months: Number(months) }))
.add(Number(months) * 30, 'day')
.unix();

return {
Expand Down

0 comments on commit b15150b

Please sign in to comment.