Query editor
withenrich_base_assets as (selectunderlying_asset_symbol,blockchain,base_asset_address,base_asset_symbolfrom (values('wstETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 'WETH'),('USDC', 'ethereum', 0xdac17f958d2ee523a2206206994597c13d831ec7, 'USDT'),('USDT', 'ethereum', 0xdac17f958d2ee523a2206206994597c13d831ec7, 'USDT'),('WETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 'WETH'),('WETH', 'base', 0x4200000000000000000000000000000000000006, 'WETH'),('wstETH', 'base', 0x4200000000000000000000000000000000000006, 'WETH'),('wstETH', 'arbitrum', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 'WETH'),('WETH', 'arbitrum', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 'WETH'),('GHO', 'ethereum', 0xdac17f958d2ee523a2206206994597c13d831ec7, 'USDT')) as temp_table (underlying_asset_symbol, blockchain, base_asset_address, base_asset_symbol)),teth_rate as (selectdate_trunc('hour', evt_block_time) as hour,date_trunc('minute', evt_block_time) as minute,date_trunc('day', evt_block_time) as day,0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8 as token_address,'tETH' as token_symbol,'ethereum' as token_blockchain,0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 as underlying_asset_address,'wstETH' as underlying_asset_symbol,(assets/1e18)/(shares/1e18) as underlying_asset_rate,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 as base_asset_address,'WETH' as base_asset_symbolfromtreehouse_asset_ethereum.tETH_evt_Depositwhere evt_block_date >= date '{{start_date}}'and evt_block_date < date '{{end_date}}'and assets/1e18 >= 0.1and shares/1e18 >= 0.1),eth_plus_dex as (select*fromdex.priceswhere hour >= date '{{start_date}}'and hour <= date '{{end_date}}'and contract_address = 0xe72b141df173b999ae7c1adcbf60cc9833ce56a8and blockchain = 'ethereum'),eth_plus_price as (select*fromprices.usdwhere minute >= date '{{start_date}}'