Query editor
/*-- @title: ENS - Accounting - Main-- @description: Aggregates all the accounting records from the rest of materialized views-- @author: Steakhouse Financial-- @notes:- Refer to documentation https://docs.google.com/document/d/1xS4nXx1G0QCjFS-VdG5yVmVoMa5t1q9_dFZ9N4wGSJ8/edit- See also accounts dimension table => https://dune.com/queries/2181835- Example of query on top of this one => https://dune.com/queries/2181956-- @version:- 8.0 - 2024-03-10 - Adding header- 7.0 - 2023-12-05 - Adding Aave v3 ETH and Spark ETH- 6.0 - 2023-08-10 - Removing param so can be resued in other queries- 5.0 - 2023-08-07 - Fixing small error in curve strategy + dunesql version with mat views- 4.0 - 2023-07-26 - Fixing curve steth withdrawals- 3.0 - 2023-07-18 - Fixing aura weth withdrawals- 2.0 - 2023-06-02 - Removing reference to ens.view_* and adding the code of those at the begining (adding registrar v4)- 1.0 - 2023-04-18 - Initial release*/WITH entries AS (SELECT * FROM dune.steakhouse.result_ens_endaoment_curve_steth_strategyUNION ALL --putting disboi first to use ts(timestamp) instead of period(date). should fix queries to always use one or the other realistically.SELECT * FROM dune.steakhouse.result_ens_accounting_revenuesUNION ALLSELECT * FROM dune.steakhouse.result_ens_accounting_expensesUNION ALLSELECT * FROM dune.steakhouse.result_ens_accounting_assets_m2m --includes seth2_accountingUNION ALLSELECT * FROM dune.steakhouse.result_ens_accounting_transfersUNION ALLSELECT * FROM dune.steakhouse.result_ens_accounting_swapsUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_comp_strategiesUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_aura_wsteth_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_univ3_seth2_weth_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_steth_strategyUNION ALLSELECT * FROM query_2304626 --plugs_accounting, does not need to materialize as it's mostly just manual entryUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_aura_reth_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_dsr_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_reth_strategyUNION ALLselect * from dune.steakhouse.result_ens_endaoment_comp_v3_usdc_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_ankreth_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_ethx_strategyUNION ALLSELECT * FROM dune.steakhouse.result_ens_endaoment_comp_v3_weth_strategyunion allselect * from dune.steakhouse.result_ens_aethweth_strategy -- Aave v3 ETHunion allselect * from dune.steakhouse.result_ens_spweth_strategy -- Spark ETH)