Skip to content

feat(kmd): reduce KMD AUR from 5% to 0.01% starting at nS7HardforkHeight#1841

Merged
shamardy merged 2 commits intodevfrom
kmd-s7-aur
May 29, 2023
Merged

feat(kmd): reduce KMD AUR from 5% to 0.01% starting at nS7HardforkHeight#1841
shamardy merged 2 commits intodevfrom
kmd-s7-aur

Conversation

@shamardy
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
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 GLEECBTC/komodo-daemon#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
Copy Markdown

@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

@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
// Some of these lines are ported as is from Komodo codebase
minutes -= 59;
let accrued = (value / 10_512_000) * minutes;
let mut accrued = (value as f64 * AUR_PER_MINUTE) as u64 * minutes;
Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants