# Estimated prize draws in TieredLiquidityDistributor are off due to rounding down when calculating the sum, leading to incorrect prizes

Rounding down in TieredLiquidityDistributor's expected prize count calculation causes off-by-one errors, leading to incorrect tier advancement and reward distribution.

- Payout: Contest reward
- Severity: medium
- Program: PoolTogether
- Credited: 0x73696d616f
- Disclosed: 2024-05-10
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-05-pooltogether-judging/issues/95
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-05-pooltogether%3AM-10
- Tags: domain:web3 impact:integrity kind:contest platform:sherlock sev:medium technique:source-review vuln:precision-loss

**Target:** TieredLiquidityDistributor contract
**Root cause:** The expected prize count per tier is computed by multiplying prize count by odds and rounding down, causing the sum to be less than the true expected value.
**Steps:**
1. Set grandPrizePeriodDraws=8, numTiers=5.
2. Compute tier prize counts: tier0=0.125→0, tier1=0.92→0, tier2=16, tier3=64, sum=80.
3. True expected sum is 81 (if multiplied by constant before division).
4. When actual claimed prizes=81, condition `actual >= expected` (81>=80) triggers tier increase to 5, but with correct expected=81 it would not.
5. This shifts tier advancement threshold, altering reward distribution for next draw.
**How found:** Manual review of the prize count calculation in TierCalculationLib.tierPrizeCountPerDraw, noticing rounding down and comparing with a scaled calculation.
**Exploitation:** No direct exploitation; the rounding error causes the protocol to incorrectly advance tiers, reducing expected rewards for users.
**Insight:** In protocols with tiered reward distributions, rounding errors in expected value calculations can shift thresholds for state transitions, affecting reward distribution; check for precision loss in sum-of-products computations.
