Query editor
with lock as (select sum(amount_lock) as total_lock, dt,SUM(sum(amount_lock)) OVER(ORDER BY dt ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_lockfrom (select "value"/1e18 as amount_lock, evt_tx_hash, date_trunc('day', evt_block_time) as dtfrom bep20."BEP20_evt_Transfer"where "to" = '\xfbbf371c9b0b994eebfcc977cef603f7f31c070d'and contract_address = '\xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11') thenajoin (select case when topic3 = '\x000000000000000000000000000000000000000000000000000000006775d700' then '2 years'else '6 months'end as lock_period, tx_hashfrom bsc.logswhere topic1 = '\xff04ccafc360e16b67d682d17bd9503c4c6b9a131f6be6325762dc9ffc7de624'and contract_address = '\xfbbf371c9b0b994eebfcc977cef603f7f31c070d') lock onthena.evt_tx_hash = tx_hashgroup by 2order by dt desc),period as (select sum(amount_lock) as total_lock, lock_periodfrom (select "value"/1e18 as amount_lock, evt_tx_hash, date_trunc('day', evt_block_time) as dtfrom bep20."BEP20_evt_Transfer"where "to" = '\xfbbf371c9b0b994eebfcc977cef603f7f31c070d'and contract_address = '\xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11') thenajoin (select case when topic3 = '\x000000000000000000000000000000000000000000000000000000006775d700' then '2 years'else '6 months'end as lock_period, tx_hashfrom bsc.logswhere topic1 = '\xff04ccafc360e16b67d682d17bd9503c4c6b9a131f6be6325762dc9ffc7de624'and contract_address = '\xfbbf371c9b0b994eebfcc977cef603f7f31c070d') lock onthena.evt_tx_hash = tx_hashgroup by 2)select * from period