Query editor
-- 元クエリ: 2386401 "glp3 profit per adress" / https://dune.com/queries/2386401-- glpETH apr13 48days プールのアドレス別損益(変動金利 20% 前提・49 日)。-- 変更点:-- - 合計を sum(cast(... as decimal(38,0))) → double に-- - prices.usd に `minute >= now() - interval '7' day` を追加(結果は不変、スキャン量削減)-- - 注: profit は実行時点の WETH 価格を使う元仕様のままwithswap as (selectevt_block_time,recipient,variableTokenDelta,fixedTokenDeltafromvoltz_arbitrum.glpEth_apr13_48days_vamm_evt_Swap),summ as (selectrecipient,cast(sum(cast(variableTokenDelta as decimal(38,0))) as double) / 1e18 as totalVar,cast(sum(cast(fixedTokenDelta as decimal(38,0))) as double) / 1e18 as totalFixfromswapGROUP BYrecipient),ethprice as (selectpricefromprices.usdwheresymbol = 'WETH'and minute >= now() - interval '7' dayorder byminute desclimit1)selectrecipient,(totalFix + totalVar * 20) * price * 49 / 365 / 100 as profit,totalVar,totalFix,pricefromsumm,ethpriceorder byprofit DESC