Query editor
with-- get all change liquidity transaction hashesjoin_pool_txs as (SELECT evt_tx_hash FROM curvefi_ethereum.FRAXBP_VCHF_evt_AddLiquidityUNION ALLSELECT evt_tx_hash FROM curvefi_ethereum.EURA_VEUR_evt_AddLiquidity), exit_pool_txs as (SELECT evt_tx_hash FROM curvefi_ethereum.EURA_VEUR_evt_RemoveLiquidityOneUNION ALLSELECT evt_tx_hash FROM curvefi_ethereum.EURA_VEUR_evt_RemoveLiquidityImbalance-- TODO add VCHF-FRAXBP after first liqduidity removals and repeating of decoding of the contract)-- all veur liquidity changes, veur_inc_liq as (SELECTdate_trunc('day',t.evt_block_time) as day, sum(t.value) as amount, t."from" as address, t.contract_addressFROM vnx_ethereum.veur_ethereum_evt_Transfer t, join_pool_txs lpWHERE t.evt_tx_hash=lp.evt_tx_hashGROUP BY 1,3,4), veur_dec_liq as (SELECTdate_trunc('day',t.evt_block_time) as day, sum(t.value) as amount, t.to as address, t.contract_addressFROM vnx_ethereum.veur_ethereum_evt_Transfer t, exit_pool_txs lpWHERE t.evt_tx_hash=lp.evt_tx_hashGROUP BY 1,3,4), veur_total_liq as (SELECTcoalesce(i.day, d.day) as day, coalesce(i.address,d.address) as address, cast(coalesce(i.amount,0) as double) / pow(10,coalesce(tk.decimals,18)) as inc_amount -- 18 decimals precision, cast(coalesce(d.amount,0) as double) / pow(10,coalesce(tk.decimals,18)) as dec_amountFROM veur_inc_liq iFULL OUTER JOIN veur_dec_liq d ON i.day = d.day AND i.address=d.addressLEFT JOIN tokens.erc20 tk ON tk.contract_address = coalesce(i.contract_address, d.contract_address))-- all vchf liquidity changes, vchf_inc_liq as (SELECTdate_trunc('day',t.evt_block_time) as day, sum(t.value) as amount, t."from" as address, t.contract_addressFROM vnx_ethereum.vchf_ethereum_evt_Transfer t, join_pool_txs lpWHERE t.evt_tx_hash=lp.evt_tx_hashGROUP BY 1,3,4), vchf_dec_liq as (SELECT