Skip to content

Commit

Permalink
Merge pull request #38 from axone-protocol/fix/claimable-reward
Browse files Browse the repository at this point in the history
fix: fixed eror with claimable reward, add mul 100 for bounded tokens
  • Loading branch information
yevhen-burkovskyi authored Jun 20, 2024
2 parents 98f3627 + 032ea90 commit e458959
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 e458959

Please sign in to comment.