Query editor
-- Total Historical ZARP Transfer Volume (All Chains Combined) with USD ValueWITH zarp_price_data AS (SELECTCAST(json_extract_scalar(pool, '$.attributes.base_token_price_usd') AS double) as zarp_price_usdFROM (SELECT json_extract(http_get('https://api.geckoterminal.com/api/v2/networks/eth/tokens/0xb755506531786C8aC63B756BaB1ac387bACB0C04/pools'),'$.data') as pools_data)CROSS JOIN UNNEST(CAST(pools_data AS array(json))) AS t(pool)WHERE json_extract_scalar(pool, '$.attributes.base_token_price_usd') IS NOT NULLLIMIT 1),solana_transfers AS (SELECTSUM(amount) / 1e6 AS total_volumeFROM tokens_solana.transfersWHERE token_mint_address = 'dngKhBQM3BGvsDHKhrLnjvRKfY5Q7gEnYGToj9Lk8rk'),ethereum_transfers AS (SELECTSUM(amount) AS total_volumeFROM tokens.transfersWHERE contract_address = 0xb755506531786c8ac63b756bab1ac387bacb0c04AND blockchain = 'ethereum'),base_transfers AS (SELECTSUM(amount) AS total_volumeFROM tokens.transfersWHERE contract_address = 0xb755506531786c8ac63b756bab1ac387bacb0c04AND blockchain = 'base'),polygon_transfers AS (SELECTSUM(amount) AS total_volumeFROM tokens.transfersWHERE contract_address = 0xb755506531786c8ac63b756bab1ac387bacb0c04AND blockchain = 'polygon')SELECT(COALESCE(s.total_volume, 0) +COALESCE(e.total_volume, 0) +COALESCE(b.total_volume, 0) +COALESCE(p.total_volume, 0)) AS total_historical_volume_zarp,(COALESCE(s.total_volume, 0) +COALESCE(e.total_volume, 0) +COALESCE(b.total_volume, 0) +COALESCE(p.total_volume, 0)) * COALESCE(pr.zarp_price_usd, 0) AS total_historical_volume_usd,pr.zarp_price_usd AS current_zarp_priceFROM solana_transfers sCROSS JOIN ethereum_transfers eCROSS JOIN base_transfers bCROSS JOIN polygon_transfers pCROSS JOIN zarp_price_data pr;