Skip to content

Commit

Permalink
include spendable rewards only
Browse files Browse the repository at this point in the history
  • Loading branch information
dostrelith678 committed Jul 28, 2021
1 parent 16ae78b commit 549a360
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions files/grest/rpc/stake_address/stake_distribution.sql
Expand Up @@ -65,8 +65,13 @@ FROM (
REWARD
WHERE
REWARD.ADDR_ID = T1.ID
GROUP BY
T1.ID) REWARDS_T ON TRUE
AND REWARD.EPOCH_NO < (
SELECT
MAX(EPOCH_NO)
FROM
REWARD)
GROUP BY
T1.ID) REWARDS_T ON TRUE
LEFT JOIN LATERAL (
SELECT
COALESCE(SUM(WITHDRAWAL.AMOUNT), 0) AS WITHDRAWALS
Expand Down

0 comments on commit 549a360

Please sign in to comment.