Skip to content
Dune Analytics

@devinwalsh / .ZRX Total Available Rewards, by epoch

.ZRX Total Available Rewards, by epoch


About queries and results

Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.

We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.

Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.

SQL query results


SQL query

1WITH epoch_prices AS
2  (SELECT e.epoch_id,
3          eth.price AS ending_eth_price
4   FROM dune_user_generated.zrx_epochs e
5   LEFT JOIN prices.layer1_usd_eth eth ON eth.minute = DATE_TRUNC('minute',e.ending_block_timestamp)),
6     rewards AS
7  (SELECT e.epoch_id,
8          e.rewards_available_in_eth,
9          (e.rewards_available_in_eth * ending_eth_price) AS rewards_usd_epoch
10   FROM dune_user_generated.zrx_epochs e
11   LEFT JOIN dune_user_generated.zrx_current_epoch ce ON ce.epoch_id = e.epoch_id
12   LEFT JOIN epoch_prices ep ON ep.epoch_id = e.epoch_id
13   WHERE ce.epoch_id IS NULL)
14SELECT epoch_id,
15       rewards_available_in_eth AS rewards_eth_epoch,
16       rewards_usd_epoch,
17       CASE
18           WHEN epoch_id>18 THEN rewards_usd_epoch *52
19           ELSE rewards_usd_epoch *36.5
20       END AS rewards_usd_ann
21FROM rewards