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(kmd): reduce KMD AUR from 5% to 0.01% starting at nS7HardforkHeight #1841

Merged
merged 2 commits into from
May 29, 2023

Conversation

shamardy
Copy link
Collaborator

@shamardy shamardy commented May 26, 2023

KMD interest calculation is adjusted to reduce AUR (Active User Rewards) from 5% to 0.01% starting from KMD block height 3484958 (Fri Jun 30 2023) according to KIP-0001

fixes #1840

@shamardy shamardy changed the title feat(kmd): reduce KMD AUR from 5% to 0.01% starting from nS7HardforkHeight feat(kmd): reduce KMD AUR from 5% to 0.01% starting at nS7HardforkHeight May 26, 2023
@shamardy shamardy added the P0 label May 26, 2023
onur-ozkan
onur-ozkan previously approved these changes May 27, 2023
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

LGTM. Do we need to ship this now or wait until the hardfork?

@shamardy
Copy link
Collaborator Author

shamardy commented May 29, 2023

Do we need to ship this now or wait until the hardfork?

This can be shipped now. The new AUR of 0,01% is applied to new utxos/transactions starting from nS7HardforkHeight and not old ones according to this comment KomodoPlatform/komodo#584 (review)

Related code excerpt in mm2
https://github.com/KomodoPlatform/atomicDEX-API/blob/6a0820a425d64590ab2d49ee345628ae0272b37a/mm2src/coins/utxo.rs#L1635-L1637

caglaryucekaya
caglaryucekaya previously approved these changes May 29, 2023
Copy link

@caglaryucekaya caglaryucekaya left a comment

Choose a reason for hiding this comment

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

LGTM, I have just a minor comment

mm2src/coins/utxo.rs Outdated Show resolved Hide resolved
@shamardy shamardy dismissed stale reviews from caglaryucekaya and onur-ozkan via ea0d835 May 29, 2023 21:02
@shamardy shamardy merged commit 730aad8 into dev May 29, 2023
@shamardy shamardy deleted the kmd-s7-aur branch May 29, 2023 22:27
minutes -= 59;
let accrued = (value / 10_512_000) * minutes;
let mut accrued = (value as f64 * AUR_PER_MINUTE) as u64 * minutes;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious to know, what's the purpose of introducing floating point arithmetic here, making a conversion from integer to float and vice versa, using drop_mutability! macros instead of simple:

    let accrued = if height >= N_S7_HARDFORK_HEIGHT {
        (value / 10_512_000) * minutes / 500
    } else {
        (value / 10_512_000) * minutes
    };

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

Successfully merging this pull request may close these issues.

4 participants