Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
program: Always distribute full amount (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque authored Jul 22, 2024
1 parent 4f32315 commit 53a89fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ struct RewardDistribution {
// * 40% to all token stakers.

This comment has been minimized.

Copy link
@OliverNChalk

OliverNChalk Jul 26, 2024

Comment outdated

This comment has been minimized.

Copy link
@buffalojoec

buffalojoec Jul 26, 2024

Collaborator

Where can we find the new distribution percentages?

This comment has been minimized.

Copy link
@OliverNChalk

OliverNChalk Jul 26, 2024

pretty sure the code below just does 50:50 and 10% is no longer implemented

This comment has been minimized.

Copy link
@buffalojoec

buffalojoec Jul 27, 2024

Collaborator

How so?

stakers = x * 2 / 5
holders = x / 2
treasury = total - stakers - holders

This comment has been minimized.

Copy link
@OliverNChalk

OliverNChalk Jul 27, 2024

Oops, I was told the distro was simplified to 50:50 and that piggy bank (treasury) would lock PAL to get its share. So when I skimmed this I assumed that was this change.

You're right, comment is still 100% accurate to the code

// * 50% to all token holders.
fn calculate_distribution(amount: u64) -> Result<RewardDistribution, ProgramError> {
let treasury_reward = amount
.checked_div(10)
.ok_or(ProgramError::InvalidInstructionData)?;
let stakers_reward = amount
.checked_mul(2)
.and_then(|v| v.checked_div(5))
.ok_or(ProgramError::InvalidInstructionData)?;
let holders_reward = amount
.checked_div(2)
.ok_or(ProgramError::InvalidInstructionData)?;
let treasury_reward = amount
.checked_sub(holders_reward)
.unwrap()
.checked_sub(stakers_reward)
.unwrap();

Ok(RewardDistribution {
treasury_reward,
Expand Down

0 comments on commit 53a89fc

Please sign in to comment.