ranking-starRanked curve model

Code4rena's ranked curve is used to calculate rank-based award distributions, including:

If there are tied ranks

If two or more wardens (or teams) have tied ranks, they split the total awards for the ranks they would otherwise occupy — i.e. if two wardens tie for 2nd place, they split the total awards for 2nd and 3rd place. Or if three wardens tie for 3rd, they split the total awards for 3rd place.

QA reports: ranked curve awarding

QA reports are ranked and graded as described here:

  • 1st place (score: 5)

  • 2nd place (score: 4)

  • 3rd place (score: 3)

  • grade-a and grade-b (score: 0, except in rare cases -- see below)

  • grade-c (score: 0)

In most cases, only 1st, 2nd, and 3rd place reports are eligible for awards. See "If there are no valid HM findings" below for an exception.

  • Reports (referred to as findings in the code) are sorted in descending order based on their scores. Findings without a score are treated as having a score of 0.

  • For each report, a point value is calculated using the formula qaAndGasConstant^(2 - idx), where qaAndGasConstant is defined in the qaAndGasRanking code (see example below), and idx is the index of the report in the sorted array. This means the highest-scored report gets the highest point value, decreasing exponentially for subsequent reports.

  • Pie - The total value of the pie is the sum of all point values.

  • Mapping score to points - unique score is mapped to an array of point values associated with findings that have that score.

  • Slice for each score - sum the points for each score to determine the slice size for each score.

  • Split - number of reports sharing the same score

Sample output

issueID
reportID
risk
score
award

13

Q-01

Q

"1st place"

3552.6315789473683

207

Q-02

Q

"2nd place"

2368.4210526315787

42

Q-03

Q

"3rd place"

1578.9473684210525

Sample input with ties for 1st place

Sample output with ties for 1st place

issueID
reportID
risk
pie
split
slice
score
award

4

Q-08

Q

4.75

1

1

3

1578.9473684210525

28

Q-16

Q

4.75

2

3.75

5

2960.5263157894738

113

Q-19

Q

4.75

2

3.75

5

2960.5263157894738

Last updated

Was this helpful?