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

Incorrect Fee Calculation for hydration to Astar ASTR Transfer via xcmPaymentApi #1398

Closed
snoopy1412 opened this issue Dec 20, 2024 · 1 comment · Fixed by #1399
Closed
Labels
bug Something isn't working

Comments

@snoopy1412
Copy link

Description:

Hello ,

I would like to report a potential bug related to the fee calculation when transferring ASTR from ydration to Astar using xcmPaymentApi.

Issue Details:

When I perform a transfer of ASTR from hydration to Astar, the fee returned is:

{ "ok": "0x0000000000000000055946e6fec8a799" }

Converting this hexadecimal value to decimal:

  • Hexadecimal: 0x0000000000000000055946e6fec8a799
  • Decimal: 385,417,201,047,873,433

Given that ASTR has 18 decimal places, I calculated the fee as:

  • Calculated Fee: 385,417,201,047,873,433 / (10^18) = 0.385417201047873433 ASTR

However, the actual fee charged is 0.0385417201 ASTR, which is exactly one decimal place less than the calculated amount.

Transaction Details:

Questions:

  • Am I missing any steps or considering incorrect decimal places in my calculation?
  • Is there an inconsistency in how the fee is reported versus how it's applied?
@snoopy1412 snoopy1412 added the bug Something isn't working label Dec 20, 2024
@Dinonard
Copy link
Member

Dinonard commented Dec 20, 2024

Hey @snoopy1412 ,

you're right, it's a bug in the report.
The actual value calculated is correct, but we scaled the value down for XCM fees at the beginning of the year due to some tokenomics changes.

We'll revisit this and make sure it's 0.385....

EDIT: for now we'll keep the lower price, so 0.0385, but will modify the report so it's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants