Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ module aptos_framework::staking_config {
new_voting_power_increase_limit: u64,
) acquires StakingConfig {
system_addresses::assert_aptos_framework(aptos_framework);
//TODO(bowu): revert the limit back to 50
assert!(
new_voting_power_increase_limit > 0 && new_voting_power_increase_limit <= 50,
new_voting_power_increase_limit > 0 && new_voting_power_increase_limit <= 50*1_000_000_000,
error::invalid_argument(EINVALID_VOTING_POWER_INCREASE_LIMIT),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ script {
core_resources,
@0000000000000000000000000000000000000000000000000000000000000001
);
//let core_address: address = signer::address_of(core_resources);

let enabled_blob: vector<u64> = vector[
17, //PartialGovernanceVoting,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ script {
let core_signer = aptos_governance::get_signer_testnet_only(core_resources, @0000000000000000000000000000000000000000000000000000000000000001);
governed_gas_pool::initialize_governed_gas_pool_extension(&core_signer);
let core_signer = aptos_governance::get_signer_testnet_only(core_resources, @0000000000000000000000000000000000000000000000000000000000000001);
//TODO: we should relax the max to 1000M move, for minimal, we should update to 10M Move before official migration
staking_config::update_required_stake(&core_signer, 1000, 100_000_000_000_000_000);

staking_config::update_rewards_rate(&core_signer, 1_000_000, 100_000_000);
let enabled_blob: vector<u64> = vector[
224, // STAKE_REWARD_USING_TREASURY
Expand All @@ -22,14 +25,15 @@ script {
// Formula: rewards_amount = stake * (rewards_rate / rewards_rate_denominator) * (successful_proposals / total_proposals)
//
// For 10% APY with 2-hour epochs (4,380 epochs per year):
// Per-epoch rate = (1.10)^(1/4380) - 1 ≈ 0.0000217 or 0.00217%
// Per-epoch rate = (1.10)^(1/4380) - 1 ≈ 0,000021761
//
// Using high precision: 22 / 1,000,000 = 0.0022% per epoch
// Using high precision: Reward_rate = 0,000021761 / 100_000_000 = 2176 per epoch

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@apenzk can we update the MIP to reflect this. Or have discussion on this formula.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0.2176 bps is equivalent to APY = 10%. The value for 10% APR would be 0.2283.

Since APY is more familiar to the public the above code looks good and i agree its better to state 10% APY

I will update the MIP

cc @musitdev

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

i misunderstood the discussion in the call - i thought you wanted to frequently or continuously update this configured number.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

movement-network/MIP#124 is updated. And i added some section about the APR to APY conversion.

// This compounds to approximately 10% APY over 4,380 epochs
// For 2-hour epochs (4,380 per year) targeting 10% APY:
// Check if the new periodical_reward_rate_decrease feature is enabled
assert!(!features::periodical_reward_rate_decrease_enabled());
staking_config::update_rewards_rate(&core_signer, 22, 1_000_000);
staking_config::update_rewards_rate(&core_signer, 2176, 100_000_000);
staking_config::update_voting_power_increase_limit(&core_signer, 50*1_000_000_000);

aptos_governance::force_end_epoch(&core_signer);
}
Expand Down
Loading