Skip to content

Commit

Permalink
fix: allocate borrow reward index to borrow points (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
gidonkatten authored Nov 20, 2024
1 parent dfe5e5a commit f7b6adb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/six-crews-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-finance/xchain-sdk": patch
---

fix pending rewards from miscalculation of user points
2 changes: 1 addition & 1 deletion src/chains/evm/hub/modules/folks-hub-rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export async function getUserPoints(

const accrued = calcAccruedRewards(amount, borrowRewardIndex, [rewardIndex, 18]);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
userRewards.poolsPoints[folksTokenId]!.collateral += accrued;
userRewards.poolsPoints[folksTokenId]!.borrow += accrued;
}
}

Expand Down

0 comments on commit f7b6adb

Please sign in to comment.