Query editor
select a.day, interest*(case when a.day>date('2025-01-03') then 1-0.680007532 else 1 end) - coalesce(deducation,0) as interest, date_diff('day', lag(a.day,1) over (order by a.day), a.day) as days_interest from (select rank() over (order by day asc) as index,* from (selectdate_trunc('day', evt_block_time) as day,sum(cast(a.value as double)/1e6) as interestfrom evms.erc20_transfers aleft join evms.transactions bon a.evt_tx_hash = b.hashand a.blockchain = b.blockchainwhere 1=1and a."to" in (0x9E49ceFAB0e640dd767bef40cd3F8722229b968e,0x54fe3425f09854e15081fa5b3276afcb4c46fca2)and substr(cast(data as varchar),1,10) ='0xb28d07c3'and a.contract_address in (select address from query_4356226 where token = 'BUIDL')and a.blockchain in ('ethereum','arbitrum')and evt_block_time>=date('2024-09-26')and a.blockchain in ('ethereum','arbitrum')group by 1)a)aleft join (select rank() over (order by day asc) as index, * from (selectdate_trunc('day', evt_block_time) as day,sum(cast(value as double)/1e6) as deducationfrom erc20_ethereum.evt_transferwhere "from" = 0x54FE3425f09854E15081fa5B3276afCB4C46FCa2and to = 0xC8abbd5bC34C943C908D99581e77D0A91b104515and contract_address = 0x7712c34205737192402172409a8F7ccef8aA2AEcand evt_block_time>=date('2024-09-26')and evt_block_time<=date('2025-01-10')group by 1)a)bon a.index=b.index