Skip to content

Commit

Permalink
fix: increment user rank by 1 to account for zero based index
Browse files Browse the repository at this point in the history
  • Loading branch information
chambaz committed Oct 13, 2023
1 parent 7a1eb84 commit 2ddd617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/marginfi-v2-ui-state/src/lib/points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function fetchUserRank(userPoints: number): Promise<number> {
const nullGreaterDocsCount = querySnapshot1.data().count;
const allGreaterDocsCount = querySnapshot2.data().count;

return allGreaterDocsCount - nullGreaterDocsCount;
return allGreaterDocsCount - nullGreaterDocsCount + 1;
}

async function fetchTotalUserCount() {
Expand Down

0 comments on commit 2ddd617

Please sign in to comment.