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

Degenerate Shielded Rewards Precision for IBC Tokens #4422

Open
murisi opened this issue Feb 27, 2025 · 0 comments
Open

Degenerate Shielded Rewards Precision for IBC Tokens #4422

murisi opened this issue Feb 27, 2025 · 0 comments

Comments

@murisi
Copy link
Collaborator

murisi commented Feb 27, 2025

Inflation is often a small fraction of the total amount of an asset that is locked. So if inflation were 5 and the locked amount were 100, then the reward would 5/100=0.05 NAM for every unit of an asset. Unfortunately decimals are not supported by the rewards circuit and the 0.05 would get truncated/floored to 0, so a workaround is applied where 0.05*precision NAM are rewarded for every precision T units of an asset. How is precision chosen for a given asset T? The shielded rewards algorithm currently uses a precision of 10^(max(denom,3)-3) under the assumption that 1 T is equivalent to a raw amount of 10^denom. Unfortunately, denom always equals 0 for IBC tokens (see

Address::Internal(InternalAddress::IbcToken(_)) => {
) meaning that precision = 1 meaning that the reward fraction is floored to 0 just like the 0.05 example above. So probably no reward will be distributed for IBC tokens even if its parameters were set to be non-zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant