Skip to content

Added functions to help calculate tier fractions#7

Open
asselstine wants to merge 5 commits into
masterfrom
pool-1918-make-it-easy-to-calculate-more-human
Open

Added functions to help calculate tier fractions#7
asselstine wants to merge 5 commits into
masterfrom
pool-1918-make-it-easy-to-calculate-more-human

Conversation

@asselstine
Copy link
Copy Markdown

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Nov 30, 2021

POOL-1918 Make it easy to calculate more human prize tiers

People express prize tiers as:

2500,

800,

400

etc.

We need a lib to help with that

Comment on lines +19 to +23
(tot: BigNumber, tierPrize: BigNumber, index: number): BigNumber => {
return tot.add(
tierPrize.mul(calculateNumberOfPrizesForIndex(bitRangeSize, index))
);
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tot is the total right? Would be more explicit in full.

Suggested change
(tot: BigNumber, tierPrize: BigNumber, index: number): BigNumber => {
return tot.add(
tierPrize.mul(calculateNumberOfPrizesForIndex(bitRangeSize, index))
);
},
(total: BigNumber, tierPrize: BigNumber, index: number): BigNumber => {
return total.add(
tierPrize.mul(calculateNumberOfPrizesForIndex(bitRangeSize, index))
);
},

tierPrize.mul(calculateNumberOfPrizesForIndex(bitRangeSize, index))
);
},
ethers.BigNumber.from("0")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not needed and this way we can also remove the ethers import.

Suggested change
ethers.BigNumber.from("0")

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.

2 participants