Query editor
with increase_amt as (selectt2.block_time,date_trunc('day', t2.block_time) as day,t2."from" as address,cast(t._value as double)/1e18 as val,from_unixtime(cast(bytearray_to_uint256(topic2) as double)) as unlocktimefrom timeless_ethereum.Vyper_contract_call_increase_amount tleft join ethereum.logs l on l.tx_hash = t.call_tx_hashleft join ethereum.transactions t2 on t.call_tx_hash = t2.hashwhere l.topic0 = 0x4566dfc29f6f11d13a418c26a02bef7c28bae749d4de47e4e6a7cddea6730d59 --deposit funcsigand date_diff('day', now(), from_unixtime(cast(bytearray_to_uint256(topic2) as double))) > 0),aggregate as (select day, sum(val) as tokensfrom increase_amtgroup 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