Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement the calculation of tokens amounts #331

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

nbetsaif
Copy link
Collaborator

Implemented dynamic token amount updates based on the toggle switch to calculate the token amount per period or for one cycle, ensuring proper handling of cases where no tokens are available. When tokens are absent, the toggle switch and token-related UI elements are hidden to enhance the user experience by only displaying relevant information.

Screenshots

PerPeriod For1Cycle
PerPeriod For1Cycle

@nbetsaif nbetsaif requested a review from n13 September 26, 2024 23:11
@nbetsaif nbetsaif self-assigned this Sep 26, 2024
@nbetsaif nbetsaif linked an issue Sep 26, 2024 that may be closed by this pull request
Copy link
Collaborator

@n13 n13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to refactor the calculation completely

Also cycle is the "larger" value

1 cycle == 4 periods, as in the web interface

1 cycle = 4 weeks for example

1 cycle = 30 days = 1 moon cycle, 1 period = 1/4 cycle

@n13
Copy link
Collaborator

n13 commented Sep 27, 2024

Please use these accessors to conver the asset values into doubles - I added computed values to ProposalModelDetails

#332

@nbetsaif nbetsaif requested a review from n13 September 28, 2024 16:15
Copy link
Collaborator

@n13 n13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good now

I wonder if cycle duration also comes with settings?

I saw you're getting period seconds from settings now... maybe cycle seconds are there too? Would be more accurate.

Once we start testing we need to compare the amounts with the web to make sure it's the same.

@nbetsaif
Copy link
Collaborator Author

@n13 cycle duration doesn't exist in the settings. I followed the web implementation, and they set its value statically as i did on the mobile

@nbetsaif nbetsaif merged commit 3377dc1 into main Sep 30, 2024
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate Token Value (Proposal Details)
2 participants