Query editor
-- LidoGAAP Protocol Economics-- =============================-- Built with Steakhouse Accounting and Finance Undertaking (SAFU) CryptoGAAP standards-- in close collaboration with Lido DAO's Analytics Group-- @SteakFi https://steakhouse.financial 🤝 https://lido.fi @LidoFinance-- Please share your comments and feedback on research.lido.fi-- We cannot prevent any commercial use of this data but if you do resell it or reuse the insights and ideas,-- You are kindly asked to publicly and visibly attribute the work to Steakhouse Financial & Lido DAO Analytics with the corresponding hyperlinks above-- You are further encouraged to donate to fund the maintenance of open source protocols, software and data-- by sending ERC-20 tokens to the Lido DAO Aragon Treasury address: 0x3e40D73EB977Dc6a537aF587D48316feE66E9C8cWITH calendar(period) AS (SELECT*FROM UNNEST(SEQUENCE(DATE_TRUNC('day', CAST('2020-12-01' AS TIMESTAMP)),DATE_TRUNC('day', CAST(NOW() AS TIMESTAMP)),INTERVAL '1' DAY))), tokens AS (select * from (values(0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO(0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC(0xdAC17F958D2ee523a2206206994597C13D831ec7), -- USDT(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2), --WETH(0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0), --MATIC(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) --stETH) as tokens(address)), eth_prices as (SELECT DATE_TRUNC('day', minute) AS period,contract_address AS token,symbol,decimals,priceFROM prices.usdWHERE blockchain = 'ethereum'AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2AND DATE_TRUNC('day', minute) >= CAST('2020-12-01' AS TIMESTAMP)AND EXTRACT(hour FROM minute) = 23AND EXTRACT(minute FROM minute) = 59), tokens_prices AS (SELECT --DATE_TRUNC('day', prices.usd.minute) AS period,p.minute AS period,p.contract_address AS token,p.symbol,p.decimals,p.price,eth_prices.price as eth_usd_price,