Skip to content

Commit

Permalink
Update calculationUserIncentives
Browse files Browse the repository at this point in the history
  • Loading branch information
leej1012 committed Jun 19, 2024
1 parent 9615c6b commit e5975a7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,10 @@ public InspireResultDto calculationUserIncentives(UserInspireCalculationDto dto)
Long totalPos = one.getTotalPos();
Long maxAuthorize = one.getMaxAuthorize();
Long allowMaxStake = maxAuthorize - totalPos;
Long newTotalPos = (totalPos + stakeAmount) > maxAuthorize ? maxAuthorize : (totalPos + stakeAmount);
long originAddNewUserStake = totalPos + stakeAmount;
Long newTotalPos = originAddNewUserStake > maxAuthorize ? Math.max(totalPos, maxAuthorize) : originAddNewUserStake;
if (stakeAmount > allowMaxStake) {
stakeAmount = allowMaxStake;
stakeAmount = Math.max(0, allowMaxStake);
}

newCurrentStake = newInitPos + newTotalPos;
Expand Down

0 comments on commit e5975a7

Please sign in to comment.