Skip to content
Dune Analytics

@kroeger0x / New Query

SQL query

1DROP VIEW IF EXISTS dune_user_generated.zrx_operator_share_changes CASCADE;
2CREATE VIEW dune_user_generated.zrx_operator_share_changes AS (
3    SELECT
4        spc.evt_block_number AS block_number
5        , b.time AS block_timestamp
6        , tx.index AS transaction_index
7        , HEX_TO_INT(RIGHT(spc."poolId"::VARCHAR,5)) AS pool_id
8        , "operatorShare"::NUMERIC / 1000000::NUMERIC AS operator_share
9    FROM zeroex_v3."StakingProxy_evt_StakingPoolCreated" spc
10    LEFT JOIN ethereum.blocks b ON b.number = spc.evt_block_number
11    LEFT JOIN ethereum.transactions tx ON tx.hash = spc.evt_tx_hash
12
13    UNION ALL
14
15    SELECT
16        osd.evt_block_number AS block_number
17        , b.time AS block_timestamp
18        , tx.index AS transaction_index
19        , HEX_TO_INT(RIGHT(osd."poolId"::VARCHAR,5)) AS pool_id
20        , osd."newOperatorShare"::NUMERIC / 1000000::NUMERIC AS operator_share
21    FROM zeroex_v3."StakingProxy_evt_OperatorShareDecreased" osd
22    LEFT JOIN ethereum.blocks b ON b.number = osd.evt_block_number
23    LEFT JOIN ethereum.transactions tx ON tx.hash = osd.evt_tx_hash
24);
25SELECT * FROM dune_user_generated.zrx_operator_share_changes;

SQL query results

Loading