8000 Wrong fee in period · Issue #20 · MeteoraAg/ts-sdk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Wrong fee in period #20

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 G 8000 itHub”, 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

Closed
Rabbitcoccus opened this issue May 14, 2025 · 1 comment
Closed

Wrong fee in period #20

Rabbitcoccus opened this issue May 14, 2025 · 1 comment

Comments

@Rabbitcoccus
Copy link

I think here

return SafeMath.div(SafeMath.mul(cliffFeeNumerator, result), ONE_Q64)

should

    return SafeMath.shr(SafeMath.mul(cliffFeeNumerator, result), 64*period)
@dannweeeee
Copy link
Collaborator

hi! thanks for raising this issue. I have just checked the Rust implementation and it shows that we only need to shift right by 64 bits (ONE_Q64) after the multiplication, not by 64period. This is because the pow function is already handling the scaling internally to maintain the Q64.64 format throughout the calculation.

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

No branches or pull requests

2 participants
0