Query editor
with create_lock as (selectt2.block_time,date_trunc('day', t2.block_time) as day,t2."from" as address,cast(t1._value as double)/1e18 as val,from_unixtime(cast(t1._unlock_time as double)) as unlocktime-- ,date_diff('day', now(), from_unixtime(cast(t1._unlock_time as double))) as days_to_unlockfrom timeless_ethereum.Vyper_contract_call_create_lock t1left join ethereum.transactions t2 on t1.call_tx_hash = t2.hashwhere call_success = true),aggregate as (select day, sum(val) as tokensfrom create_lockgroup by 1),total_bpt as (select sum(val) as total_bptfrom (select cast(value as double)/1e18 as valfrom erc20_ethereum.evt_Transferwhere contract_address = 0x9232a548DD9E81BaC65500b5e0d918F8Ba93675Cand "from" = 0x0000000000000000000000000000000000000000union allselect -cast(value as double)/1e18 as valfrom erc20_ethereum.evt_Transferwhere contract_address = 0x9232a548DD9E81BaC65500b5e0d918F8Ba93675Cand to = 0x0000000000000000000000000000000000000000)),total_lit as (select sum(val) as total_litfrom (select evt_tx_hash, cast(value as double)/1e18 as valfrom erc20_ethereum.evt_Transferwhere contract_address = 0xfd0205066521550D7d7AB19DA8F72bb004b4C341 --lit tokenand to = 0xBA12222222228d8Ba445958a75a0704d566BF2C8 --balancer vaultunion allselect evt_tx_hash, -cast(value as double)/1e18 as valfrom erc20_ethereum.evt_Transferwhere contract_address = 0xfd0205066521550D7d7AB19DA8F72bb004b4C341 --lit tokenand "from" = 0xBA12222222228d8Ba445958a75a0704d566BF2C8 --balancer vault))select day, total_lit*(tokens/total_bpt) as lit_lockedfrom aggregatejoin total_bpt on 1=1join total_lit on 1=1