Query editor
-- trading volumewith closeSuccess as (select * from query_2957629)-- ,closeReceive as (-- select * FROM query_2958161-- ),passiveclose as (select * FROM query_2958196),open as (SELECT * FROM query_2958101),token_price AS (SELECT * FROM query_2958182),OpenVol as(select open.block_time,open.address,open.trace,open.symbol,open.islong,(open.qty*open.entryPrice) as openVol,((open.qty*open.entryPrice)/open.margin) as leverage,margin,margin*COALESCE(price,lag_price) as margin_usd,entryPrice,qty,open.tx_hash as open_tx_hash,openFee as openfee, open.openFee*COALESCE(price,lag_price) as openfee_usd,broker,open.tokenIn,executionFee as executionfee,executionFee*COALESCE(price,lag_price) as executionfee_usdfrom openLEFT JOIN token_price ON open.tokenIn = token_price.symbol AND open.date_min = token_price.minute),CloseVol as(select open.block_time as open_block_time,closeSuccess.block_time,closeSuccess.day,closeSuccess.address,closeSuccess.trace,open.symbol,open.islong,open.qty,(open.qty*closeSuccess.closePrice) as closeVol,open.tx_hash as open_tx_hash, closeSuccess.tx_hash,closefee,closefee*COALESCE(price,lag_price) as closefee_usd,broker,pnl,pnl*COALESCE(price,lag_price) as pnl_usd,open.openFee, open.openFee*COALESCE(price,lag_price) as openfee_usd,(open.qty*open.entryPrice) as openVol,margin,margin*COALESCE(price,lag_price) as margin_usd,open.tokenIn, fundingFee as fundingfee,fundingFee*COALESCE(price,lag_price) as fundingfee_usd,closePrice,executionFee as executionfee,executionFee*COALESCE(price,lag_price) as executionfee_usdfrom openinner join closeSuccess on open.trace=closeSuccess.traceLEFT JOIN token_price ON open.tokenIn = token_price.symbol AND closeSuccess.date_min = token_price.minute),CloseVol_p as (select open.block_time as open_block_time,passiveclose.block_time, passiveclose.day,passiveclose.address,passiveclose.trace,open.symbol,open.islong,open.qty,(open.qty*passiveclose.closePrice) as closeVol_p ,open.tx_hash as open_tx_hash,passiveclose.tx_hash,closefee,closefee*COALESCE(price,lag_price) as closefee_usd,broker,pnl,pnl*COALESCE(price,lag_price) as pnl_usd,open.openFee, open.openFee*COALESCE(price,lag_price) as openfee_usd,(open.qty*open.entryPrice) as openVol,margin,margin*COALESCE(price,lag_price) as margin_usd,open.tokenIn, "type",fundingfee,fundingFee*COALESCE(price,lag_price) as fundingfee_usd,closePrice,executionFee as executionfee,executionFee*COALESCE(price,lag_price) as executionfee_usdfrom open inner join passiveclose on open.trace=passiveclose.traceLEFT JOIN token_price ON open.tokenIn = token_price.symbol AND passiveclose.date_min = token_price.minute), report AS (SELECTblock_time,block_time as open_block_time,islong as islong,'open' as flag_type,null as detail_close_type,null as close_tx_hash,open_tx_hash as open_tx_hash,address as address, tokenIn, margin, margin_usd,qty,null as close_Vol,openVol as openVol,null as pnl_raw,null as pnl_usd_raw,null as pnl --USD,null as pnl_usd,openFee as openfee,openfee_usd--USD,null as closefee,null as closefee_usd