-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove null address from delegator count (#563)
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...essor/src/db/postgres/migrations/2024-10-23-232703_num_active_delegator_per_pool/down.sql
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 @@ | ||
DROP VIEW IF EXISTS num_active_delegator_per_pool; |
9 changes: 9 additions & 0 deletions
9
...ocessor/src/db/postgres/migrations/2024-10-23-232703_num_active_delegator_per_pool/up.sql
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,9 @@ | ||
-- need this for delegation staking | ||
CREATE OR REPLACE VIEW num_active_delegator_per_pool AS | ||
SELECT pool_address, | ||
COUNT(DISTINCT delegator_address) AS num_active_delegator | ||
FROM current_delegator_balances | ||
WHERE shares > 0 | ||
AND delegator_address != '0x0000000000000000000000000000000000000000000000000000000000000000' | ||
AND pool_type = 'active_shares' | ||
GROUP BY 1; |