Query editor
-- VRF Economics Detail-- Dune: query_6689928-- Depends on: shared/request_gas_refunded.sql (query_6689874)-- shared/fulfillment_gas_refunded.sql (query_6689874)-- shared/daily_oracle_gas.sql (query_6689991)-- Tables: paintswap_sonic.paintswapvrfcoordinator_evt_randomwordsrequested---- Detailed breakdown of VRF economics per day.-- Shows where every unit of value flows: user payments, refunds, fees, oracle gas, and FeeM.---- User side:-- required = (callbackGasLimit + 300,000) × gasPricePaid (minimum per request)-- user_excess = request_refund × 10/9 (optional overpayment, inferred from refund)-- total_user_paid = required + user_excess-- request_refund = 90% of excess overpayment (at request time)-- fulfill_refund = 90% of unused callback gas × gasPricePaid (at fulfillment)-- net_user_cost = total_user_paid - request_refund - fulfill_refund---- Protocol fee income (from 10% charge on refunds):-- fee_from_excess = request_refund / 9 (10% of excess)-- fee_from_unused_gas = fulfill_refund / 9 (10% of unused gas value)-- failed_refunds = refunds that failed to send (retained by protocol)-- total_fee_income = fee_from_excess + fee_from_unused_gas + failed_refunds---- Oracle gas (actual from sonic.transactions, not estimated):-- oracle_gas = SUM(gas_used × gas_price) from fulfillment txs-- feem_rebate = oracle_gas × 90% (Sonic FeeM program)---- Profit:-- profit_before_feem = net_user_cost - oracle_gas-- net_profit = net_user_cost - oracle_gas × 10%---- Visualization 1: Line chart (user economics)-- Title: User Economics (Daily)-- X-axis: day-- Y-axis: total_user_paid_s, total_refunded_s, net_user_cost_s-- Y-axis label: S---- Visualization 2: Stacked bar (protocol fee breakdown)-- Title: Protocol Fee Income-- X-axis: day-- Y-axis: fee_from_excess_s, fee_from_unused_gas_s, failed_refunds_retained_s-- Stack: enabled-- Y-axis label: S---- Visualization 3: Line chart (profit with oracle gas & FeeM)-- Title: Profit After Oracle Gas & FeeM-- X-axis: day-- Y-axis: net_user_cost_s, oracle_gas_s, feem_rebate_s, profit_before_feem_s, net_profit_s-- Y-axis label: S---- Visualization 4: Area chart (cumulative net profit)-- Title: Cumulative Net Profit-- X-axis: day-- Y-axis: cumulative_net_profit_sWITH daily_requests AS (SELECTdate_trunc('day', evt_block_time) AS day,COUNT(*) AS requests,