Skip to content

Commit

Permalink
Add active_stake to pool_list
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlrt committed Nov 22, 2024
1 parent 06d6816 commit c75f494
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
8 changes: 6 additions & 2 deletions files/grest/rpc/pool/pool_list.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RETURNS TABLE (
meta_url varchar,
meta_hash text,
pool_status text,
active_stake text,
retiring_epoch word31type
)
LANGUAGE sql STABLE
Expand Down Expand Up @@ -48,15 +49,18 @@ AS $$
pmr.url AS meta_url,
pmr.hash AS meta_hash,
pic.pool_status,
pasc.amount::text AS active_stake,
pic.retiring_epoch
FROM grest.pool_info_cache AS pic
LEFT JOIN public.pool_hash AS ph ON ph.id = pic.pool_hash_id
INNER JOIN public.pool_hash AS ph ON ph.id = pic.pool_hash_id
LEFT JOIN grest.pool_active_stake_cache AS pasc ON pasc.pool_id = pic.pool_hash_id
LEFT JOIN public.pool_update AS pu ON pu.id = pic.update_id
LEFT JOIN public.stake_address AS sa ON pu.reward_addr_id = sa.id
LEFT JOIN public.pool_metadata_ref AS pmr ON pmr.id = pic.meta_id
LEFT JOIN public.off_chain_pool_data AS ocpd ON ocpd.pmr_id = pic.meta_id
ORDER BY
pic.pool_hash_id,
pic.tx_id DESC
pic.tx_id DESC,
pasc.epoch_no DESC
;
$$;
8 changes: 4 additions & 4 deletions specs/results/koiosapi-guild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,8 @@ components:
$ref: "#/components/schemas/pool_info/items/properties/meta_hash"
pool_status:
$ref: "#/components/schemas/pool_info/items/properties/pool_status"
active_stake:
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
retiring_epoch:
$ref: "#/components/schemas/pool_info/items/properties/retiring_epoch"
pool_history_info:
Expand All @@ -3056,9 +3058,7 @@ components:
description: Epoch for which the pool history data is shown
example: 312
active_stake:
type: string
description: Amount of delegated stake to this pool at the time of epoch snapshot (in numbers)
example: "31235800000"
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
active_stake_pct:
type:
- number
Expand Down Expand Up @@ -3266,7 +3266,7 @@ components:
type:
- string
- 'null'
description: Pool active stake (will be null post epoch transition until dbsync calculation is complete)
description: Amount of delegated stake to this pool at the time of epoch snapshot
example: "64328627680963"
sigma:
type:
Expand Down
8 changes: 4 additions & 4 deletions specs/results/koiosapi-mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,8 @@ components:
$ref: "#/components/schemas/pool_info/items/properties/meta_hash"
pool_status:
$ref: "#/components/schemas/pool_info/items/properties/pool_status"
active_stake:
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
retiring_epoch:
$ref: "#/components/schemas/pool_info/items/properties/retiring_epoch"
pool_history_info:
Expand All @@ -3056,9 +3058,7 @@ components:
description: Epoch for which the pool history data is shown
example: 312
active_stake:
type: string
description: Amount of delegated stake to this pool at the time of epoch snapshot (in numbers)
example: "31235800000"
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
active_stake_pct:
type:
- number
Expand Down Expand Up @@ -3266,7 +3266,7 @@ components:
type:
- string
- 'null'
description: Pool active stake (will be null post epoch transition until dbsync calculation is complete)
description: Amount of delegated stake to this pool at the time of epoch snapshot
example: "64328627680963"
sigma:
type:
Expand Down
8 changes: 4 additions & 4 deletions specs/results/koiosapi-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,8 @@ components:
$ref: "#/components/schemas/pool_info/items/properties/meta_hash"
pool_status:
$ref: "#/components/schemas/pool_info/items/properties/pool_status"
active_stake:
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
retiring_epoch:
$ref: "#/components/schemas/pool_info/items/properties/retiring_epoch"
pool_history_info:
Expand All @@ -3056,9 +3058,7 @@ components:
description: Epoch for which the pool history data is shown
example: 312
active_stake:
type: string
description: Amount of delegated stake to this pool at the time of epoch snapshot (in numbers)
example: "31235800000"
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
active_stake_pct:
type:
- number
Expand Down Expand Up @@ -3266,7 +3266,7 @@ components:
type:
- string
- 'null'
description: Pool active stake (will be null post epoch transition until dbsync calculation is complete)
description: Amount of delegated stake to this pool at the time of epoch snapshot
example: "64328627680963"
sigma:
type:
Expand Down
8 changes: 4 additions & 4 deletions specs/results/koiosapi-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3043,6 +3043,8 @@ components:
$ref: "#/components/schemas/pool_info/items/properties/meta_hash"
pool_status:
$ref: "#/components/schemas/pool_info/items/properties/pool_status"
active_stake:
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
retiring_epoch:
$ref: "#/components/schemas/pool_info/items/properties/retiring_epoch"
pool_history_info:
Expand All @@ -3056,9 +3058,7 @@ components:
description: Epoch for which the pool history data is shown
example: 312
active_stake:
type: string
description: Amount of delegated stake to this pool at the time of epoch snapshot (in numbers)
example: "31235800000"
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
active_stake_pct:
type:
- number
Expand Down Expand Up @@ -3266,7 +3266,7 @@ components:
type:
- string
- 'null'
description: Pool active stake (will be null post epoch transition until dbsync calculation is complete)
description: Amount of delegated stake to this pool at the time of epoch snapshot
example: "64328627680963"
sigma:
type:
Expand Down
8 changes: 4 additions & 4 deletions specs/templates/4-api-schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ schemas:
$ref: "#/components/schemas/pool_info/items/properties/meta_hash"
pool_status:
$ref: "#/components/schemas/pool_info/items/properties/pool_status"
active_stake:
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
retiring_epoch:
$ref: "#/components/schemas/pool_info/items/properties/retiring_epoch"
pool_history_info:
Expand All @@ -221,9 +223,7 @@ schemas:
description: Epoch for which the pool history data is shown
example: 312
active_stake:
type: string
description: Amount of delegated stake to this pool at the time of epoch snapshot (in numbers)
example: "31235800000"
$ref: "#/components/schemas/pool_info/items/properties/active_stake"
active_stake_pct:
type:
- number
Expand Down Expand Up @@ -431,7 +431,7 @@ schemas:
type:
- string
- 'null'
description: Pool active stake (will be null post epoch transition until dbsync calculation is complete)
description: Amount of delegated stake to this pool at the time of epoch snapshot
example: "64328627680963"
sigma:
type:
Expand Down

0 comments on commit c75f494

Please sign in to comment.