Skip to content

Commit

Permalink
fix: fixed eror with claimable reward, add mul 100 for bounded tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
yevhen-burkovskyi committed Jun 19, 2024
1 parent 656d0f0 commit 032ea90
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/modules/staking/services/staking.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export class StakingService implements OnModuleInit {
validatorAddress?: string
) {
return rewards
.filter((val) => val.validator_address === validatorAddress)
.filter((val) =>
validatorAddress ? val.validator_address === validatorAddress : true
)
.reduce(
(acc, val) =>
acc +
Expand Down Expand Up @@ -164,7 +166,10 @@ export class StakingService implements OnModuleInit {
totalValidators: rez[0].pagination.total,
apr: rez[1],
totalStaked,
bondedTokens: Big(rez[3].pool.bonded_tokens).div(rez[2]!.amount).toString(),
bondedTokens: Big(rez[3].pool.bonded_tokens)
.div(rez[2]!.amount)
.mul(100)
.toString(),
};

await this.cache.setGlobalStakedOverview(dto);
Expand Down

0 comments on commit 032ea90

Please sign in to comment.