Skip to content

Commit f120272

Browse files
authored
📄 Small comment about Y variable (#356)
## What? - Add comment to Y variable calculation to avoid confusion. ## Why? - There was confusion that the Y variable could become higher than 1 when the funding amount reached was higher than the target funding (USD). This is not possible because `Perquintill` saturates to 1, but if we don't add a comment it might appear unintented. ## How? - 2 identical comments on the Y calculations in `generate_evaluator_rewards_info` and `generate_liquidity_pools_and_long_term_holder_rewards`
1 parent 7f0b7e5 commit f120272

File tree

1 file changed

+4
-1
lines changed
  • pallets/funding/src/functions

1 file changed

+4
-1
lines changed

pallets/funding/src/functions/misc.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ impl<T: Config> Pallet<T> {
459459
let total_fee_allocation = total_issuer_fees * token_sold;
460460

461461
// Calculate the percentage of target funding based on available documentation.
462+
// A.K.A variable "Y" in the documentation. We mean it to saturate to 1 even if the ratio is above 1 when funding raised
463+
// is above the target.
462464
let percentage_of_target_funding = Perquintill::from_rational(funding_amount_reached, fundraising_target);
463465

464466
// Calculate rewards.
@@ -515,7 +517,8 @@ impl<T: Config> Pallet<T> {
515517
let total_fee_allocation = total_issuer_fees * token_sold;
516518

517519
// Calculate the percentage of target funding based on available documentation.
518-
// A.K.A variable "Y" in the documentation.
520+
// A.K.A variable "Y" in the documentation. We mean it to saturate to 1 even if the ratio is above 1 when funding raised
521+
// is above the target.
519522
let percentage_of_target_funding = Perquintill::from_rational(funding_amount_reached, fundraising_target);
520523
let inverse_percentage_of_target_funding = Perquintill::from_percent(100) - percentage_of_target_funding;
521524

0 commit comments

Comments
 (0)