Skip to content

Commit

Permalink
fix: weighted average fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Jul 29, 2024
1 parent aaed8c5 commit e05ce24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ pub trait ViewsModule:
let bond: Bond<<Self as ContractBase>::Api> = self.get_bond(bond_id);
let difference = bond.unbond_timestamp - timestamp;

bond_count += &bond.remaining_amount;
if timestamp >= bond.unbond_timestamp {
continue;
}
Expand All @@ -167,7 +168,6 @@ pub trait ViewsModule:
/ BigUint::from(1_000_000_000u64);

total_score += bond_score * &bond.remaining_amount;
bond_count += &bond.remaining_amount;
}

// Calculate the weighted average bond score
Expand Down

0 comments on commit e05ce24

Please sign in to comment.