-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* elaborated assessment criteria * ALBA computations based on real-life stake distribution.
- Loading branch information
Showing
4 changed files
with
1,251 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
drop table if exists stake_distribution; | ||
|
||
create temporary table stake_distribution as | ||
select | ||
epoch_no as "Epoch" | ||
, encode(hash_raw, 'hex') as "Pool" | ||
, sum(amount) as "Stake [Lovelace]" | ||
, sum(amount) / total_stake as "Stake [Fraction]" | ||
from epoch_stake | ||
inner join pool_hash | ||
on epoch_stake.pool_id = pool_hash.id | ||
inner join ( | ||
select epoch_no, sum(amount) as total_stake | ||
from epoch_stake | ||
group by epoch_no | ||
) stake_total | ||
using (epoch_no) | ||
group by epoch_no, hash_raw, total_stake | ||
; | ||
|
||
\copy stake_distribution to 'stake_distribution.csv' csv header |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.