@@ -83,6 +83,16 @@ total_stake_controlled_by_dreps AS (
8383 SUM (dd .amount )::bigint AS total
8484 FROM
8585 drep_distr dd
86+ WHERE
87+ dd .epoch_no = (SELECT no FROM current_epoch)
88+ ),
89+ total_stake_controlled_by_spos AS (
90+ SELECT
91+ SUM (ps .stake )::bigint AS total
92+ FROM
93+ pool_stat ps
94+ WHERE
95+ ps .epoch_no = (SELECT no FROM current_epoch)
8696),
8797total_registered_direct_voters AS (
8898 SELECT
@@ -176,6 +186,7 @@ SELECT
176186 total_drep_votes .count as total_drep_votes,
177187 total_registered_dreps .unique_registrations as total_registered_dreps,
178188 COALESCE(total_stake_controlled_by_dreps .total , 0 ) as total_stake_controlled_by_dreps,
189+ COALESCE(total_stake_controlled_by_spos .total , 0 ) as total_stake_controlled_by_spos,
179190 total_active_dreps .unique_active_drep_registrations as total_active_dreps,
180191 total_inactive_dreps .total_inactive_dreps as total_inactive_dreps,
181192 total_active_cip119_compliant_dreps .unique_active_cip119_compliant_drep_registrations as total_active_cip119_compliant_dreps,
192203 CROSS JOIN total_drep_votes
193204 CROSS JOIN total_registered_dreps
194205 CROSS JOIN total_stake_controlled_by_dreps
206+ CROSS JOIN total_stake_controlled_by_spos
195207 CROSS JOIN total_active_dreps
196208 CROSS JOIN total_inactive_dreps
197209 CROSS JOIN total_active_cip119_compliant_dreps
@@ -208,6 +220,7 @@ GROUP BY
208220 total_drep_votes .count ,
209221 total_registered_dreps .unique_registrations ,
210222 total_stake_controlled_by_dreps .total ,
223+ total_stake_controlled_by_spos .total ,
211224 total_active_dreps .unique_active_drep_registrations ,
212225 total_inactive_dreps .total_inactive_dreps ,
213226 total_active_cip119_compliant_dreps .unique_active_cip119_compliant_drep_registrations ,
0 commit comments