-- ============================================================================ -- 03_min_pool_cost_share_by_pool_size.sql -- Q: What does the 170 ADA minPoolCost represent as a share of gross reward -- for a pool minting 1, 2, 5 or 20 blocks in an epoch? -- -- METHOD: gross reward per block is recomputed inline from the same definition -- as 02_ (leader+member rewards / pool-minted blocks, epochs 641-650) so this -- file is runnable standalone and cannot drift from 02_. The mean of the ten -- per-epoch values is used as the per-block figure. -- -- ASSUMPTION (stated because the source does not define it): a pool minting N -- blocks is assumed to earn N x (mean gross reward per block). That is the -- expectation, not a guarantee -- per-block reward varies slightly with the -- pool's own stake and pledge. This is a linear approximation. -- -- CAVEAT (arithmetic, not advocacy): the ledger caps the operator's fixed cost -- at the pool's actual reward pot for the epoch. A pool whose gross reward is -- below 170 ADA does not pay a 170 ADA fee -- it takes the whole (smaller) -- pot and members get nothing. So a share above 100% means "members receive -- zero", not "the operator is owed more than the pool earned". -- ============================================================================ WITH blocks AS ( SELECT b.epoch_no, count(*) AS blocks_minted FROM block b JOIN slot_leader sl ON sl.id = b.slot_leader_id WHERE b.epoch_no BETWEEN 641 AND 650 AND sl.pool_hash_id IS NOT NULL GROUP BY 1 ), rew AS ( SELECT earned_epoch AS epoch_no, sum(amount) AS gross_lovelace FROM reward WHERE earned_epoch BETWEEN 641 AND 650 AND type IN ('leader','member') GROUP BY 1 ), per_block AS ( SELECT avg((r.gross_lovelace/1000000.0)/b.blocks_minted) AS ada_per_block FROM rew r JOIN blocks b ON b.epoch_no = r.epoch_no ), params AS ( SELECT (SELECT min_pool_cost/1000000.0 FROM epoch_param WHERE epoch_no = (SELECT max(no) FROM epoch)) AS current_floor_ada, 75.0::numeric AS proposed_floor_ada, (SELECT ada_per_block FROM per_block) AS ada_per_block ), sizes(blocks_per_epoch) AS (VALUES (1),(2),(5),(20)) SELECT s.blocks_per_epoch, p.ada_per_block::numeric(20,2) AS gross_ada_per_block, (s.blocks_per_epoch * p.ada_per_block)::numeric(20,2) AS gross_reward_ada, p.current_floor_ada::numeric(20,2) AS min_pool_cost_ada, round(100 * p.current_floor_ada / (s.blocks_per_epoch * p.ada_per_block), 1) AS pct_of_gross_at_170, round(100 * p.proposed_floor_ada / (s.blocks_per_epoch * p.ada_per_block), 1) AS pct_of_gross_at_75_proposed FROM sizes s CROSS JOIN params p ORDER BY s.blocks_per_epoch; \echo '' \echo '--- inputs used (for the record) ---' WITH blocks AS ( SELECT b.epoch_no, count(*) AS blocks_minted FROM block b JOIN slot_leader sl ON sl.id = b.slot_leader_id WHERE b.epoch_no BETWEEN 641 AND 650 AND sl.pool_hash_id IS NOT NULL GROUP BY 1 ), rew AS ( SELECT earned_epoch AS epoch_no, sum(amount) AS gross_lovelace FROM reward WHERE earned_epoch BETWEEN 641 AND 650 AND type IN ('leader','member') GROUP BY 1 ) SELECT '641-650' AS epochs_used, avg((r.gross_lovelace/1000000.0)/b.blocks_minted)::numeric(20,2) AS mean_ada_per_block, (SELECT min_pool_cost/1000000.0 FROM epoch_param WHERE epoch_no=(SELECT max(no) FROM epoch))::numeric(20,2) AS current_min_pool_cost_ada FROM rew r JOIN blocks b ON b.epoch_no = r.epoch_no;