diff --git a/files/grest/rpc/pool/pool_info.sql b/files/grest/rpc/pool/pool_info.sql index 50a12023..203f7d40 100644 --- a/files/grest/rpc/pool/pool_info.sql +++ b/files/grest/rpc/pool/pool_info.sql @@ -77,22 +77,13 @@ BEGIN ROUND((live.stake / _saturation_limit) * 100, 2) FROM _all_pool_info AS api LEFT JOIN LATERAL ( - ( - SELECT pod.json - FROM public.pool_offline_data AS pod - WHERE pod.pool_id = api.pool_hash_id - AND pod.pmr_id = api.meta_id - ) - UNION ALL - ( - SELECT pod.json - FROM public.pool_offline_data AS pod - WHERE pod.pool_id = api.pool_hash_id - AND pod.json IS NOT NULL - ORDER BY pod.pmr_id DESC - ) + SELECT pod.json + FROM public.pool_offline_data AS pod + WHERE pod.pool_id = api.pool_hash_id + AND pod.pmr_id = api.meta_id + ORDER BY pod.pmr_id DESC LIMIT 1 - ) offline_data ON TRUE + ) AS offline_data ON TRUE LEFT JOIN LATERAL ( SELECT SUM(COUNT(b.id)) OVER () AS cnt, @@ -106,18 +97,18 @@ BEGIN b.op_cert_counter ORDER BY b.op_cert_counter DESC LIMIT 1 - ) block_data ON TRUE + ) AS block_data ON TRUE LEFT JOIN LATERAL( SELECT amount::lovelace AS as_sum FROM grest.pool_active_stake_cache AS pasc WHERE pasc.pool_id = api.pool_id_bech32 AND pasc.epoch_no = _epoch_no - ) active_stake ON TRUE + ) AS active_stake ON TRUE LEFT JOIN LATERAL( SELECT amount::lovelace AS es_sum FROM grest.epoch_active_stake_cache AS easc WHERE easc.epoch_no = _epoch_no - ) epoch_stake ON TRUE + ) AS epoch_stake ON TRUE LEFT JOIN LATERAL( SELECT CASE WHEN api.pool_status = 'retired' @@ -138,7 +129,7 @@ BEGIN END AS pledge FROM grest.stake_distribution_cache AS sdc WHERE sdc.pool_id = api.pool_id_bech32 - ) live ON TRUE; + ) AS live ON TRUE; END; $$; diff --git a/specs/results/koiosapi-guild.yaml b/specs/results/koiosapi-guild.yaml index 5f08be0c..6b9736ce 100644 --- a/specs/results/koiosapi-guild.yaml +++ b/specs/results/koiosapi-guild.yaml @@ -1,7 +1,7 @@ openapi: 3.0.2 info: title: Koios API - version: 1.0.10 + version: 1.0.11rc description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. diff --git a/specs/results/koiosapi-mainnet.yaml b/specs/results/koiosapi-mainnet.yaml index 189df453..1495a9bd 100644 --- a/specs/results/koiosapi-mainnet.yaml +++ b/specs/results/koiosapi-mainnet.yaml @@ -1,7 +1,7 @@ openapi: 3.0.2 info: title: Koios API - version: 1.0.10 + version: 1.0.11rc description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. diff --git a/specs/results/koiosapi-preprod.yaml b/specs/results/koiosapi-preprod.yaml index c353851f..35a6ef3e 100644 --- a/specs/results/koiosapi-preprod.yaml +++ b/specs/results/koiosapi-preprod.yaml @@ -1,7 +1,7 @@ openapi: 3.0.2 info: title: Koios API - version: 1.0.10 + version: 1.0.11rc description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. diff --git a/specs/results/koiosapi-preview.yaml b/specs/results/koiosapi-preview.yaml index 6f56b8a3..90010439 100644 --- a/specs/results/koiosapi-preview.yaml +++ b/specs/results/koiosapi-preview.yaml @@ -1,7 +1,7 @@ openapi: 3.0.2 info: title: Koios API - version: 1.0.10 + version: 1.0.11rc description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. diff --git a/specs/templates/1-api-info.yaml b/specs/templates/1-api-info.yaml index 656eaf17..d95261aa 100644 --- a/specs/templates/1-api-info.yaml +++ b/specs/templates/1-api-info.yaml @@ -1,6 +1,6 @@ info: title: Koios API - version: 1.0.10 + version: 1.0.11rc description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples.