Skip to content

Commit

Permalink
fix: add instant rewards to the calculation of delegators' total amount
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Oct 25, 2024
1 parent c6d26af commit 7e02a79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Added instant rewards, reserves, treasury and proposal_refund to the calculation of delegators' total amount in `/governance/dreps/:drep/delegators`

## [2.2.3] - 2024-10-14

### Changed
Expand Down
8 changes: 8 additions & 0 deletions src/sql/governance/dreps_drep_id_delegators.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ SELECT "address" AS "address",
SELECT *
FROM current_epoch
)
) + (
SELECT COALESCE(SUM(amount), 0)
FROM reward_rest rr
WHERE (rr.addr_id = address_id)
AND rr.spendable_epoch <= (
SELECT *
FROM current_epoch
)
) - (
SELECT COALESCE(SUM(amount), 0)
FROM withdrawal w
Expand Down

0 comments on commit 7e02a79

Please sign in to comment.