Query editor
-- in order to be compatible with materialized views parameters the variables *must* have the following values-- points_start_day 2024-10-10-- veurvchf_coeff 2-- vnxau_coeff 6.66666with-- calculate points for providing liquidity in VNX tokenslp_all_chains AS (SELECT * FROM "query_4047334(veurvchf_coeff='{{veurvchf_lp_coeff}}',points_start_day='{{points_start_day}}')" -- Avalanche Balancer and Trader Joe lp pointsUNION ALLselect * from dune.vnx.result_vnx_polygon_lp_points_combined -- Polygon lp points view materialized for performance with hardcoded variable valuesUNION ALLSELECT * FROM dune.vnx.result_vnx_ethereum_lp_points_combined -- Ethereum lp points view materialized for performance with hardcoded variable valuesUNION ALLSELECT * FROM dune.vnx.result_vnx_solana_lp_points_combined -- Solana lp points view materialized for performance with hardcoded variable valuesUNION ALLSELECT * FROM "query_4072294(veurvchf_coeff='{{veurvchf_lp_coeff}}',vnxau_coeff='{{vnxau_coeff}}',points_start_day='{{points_start_day}}')" -- Arbitrum Uniswap)--select * from lp_all_chains order by points_cumulative_balance desc-- add points for holding of VNX tokens, total_points AS (SELECTcoalesce(lp.blockchain, h.blockchain) as blockchain, coalesce(lp.address, h.address) as address, DATE '{{points_start_day}}' as start_day, cast(now() as date) as snapshot_day, coalesce(lp.veur_points,0) + coalesce(h.veur_points,0) as veur_points, coalesce(lp.vchf_points,0) + coalesce(h.vchf_points,0) as vchf_points, coalesce(lp.vgbp_points,0) + coalesce(h.vgbp_points,0) as vgbp_points, coalesce(lp.vnxau_points,0) + coalesce(h.vnxau_points,0) as vnxau_points, coalesce(h.vnxlu_points,0) as vnxlu_points, coalesce(lp.points_cumulative_balance,0) + coalesce(h.points_cumulative_balance,0) as points_cumulative_balanceFROM lp_all_chains lp-- FULL OUTER JOIN dune.vnx.result_vnx_holders_points_combined h on h.blockchain=lp.blockchain and h.address=lp.address -- VNX tokens holding points view materialized for performanceFULL OUTER JOIN query_3995737 h on h.blockchain=lp.blockchain and h.address=lp.address -- VNX tokens holding points view materialized for performance--GROUP BY 1,2)select * from total_pointsorder by points_cumulative_balance desc