Query editor
-- estimated NEAR contract gas rebates (burnt_gas_reward = 30% of wasm execution gas)-- reward = 0.3 * gas_burnt_for_function_call * receipt gas_price; paid even when the-- call fails, so no execution_status filter.-- near.actions only exposes the full receipt outcome gas (execution_gas_burnt), which-- also contains non-rebated fees; rebate_estimate_near subtracts the known constants.with function_call_receipts as (selectdate_trunc('month', block_date) as month,receipt_id,receipt_receiver_account_id,max(execution_gas_burnt) as execution_gas_burnt,max(gas_price) as gas_price,count(*) as function_call_actions,max(cardinality(execution_outcome_receipt_ids)) as created_receiptsfrom near.actionswhere block_date >= date '2025-10-01' and block_date <= date '2025-10-31'and action_kind = 'FUNCTION_CALL'and receipt_predecessor_account_id <> 'system'and substr(receipt_receiver_account_id, -9) = '.craft.tg'group by 1, 2, 3)selectmonth,sum(0.3 * cast(execution_gas_burnt as double) * cast(gas_price as double)) / 1e24as rebate_upper_bound_near,sum(0.3 * greatest(cast(execution_gas_burnt as double)- 108.0595e9 -- action_receipt_creation exec fee- 780e9 * function_call_actions -- action_function_call exec base fee- 308.0595e9 * created_receipts, -- send + creation fees per created receipt0) * cast(gas_price as double)) / 1e24as rebate_estimate_near,count(distinct receipt_receiver_account_id) as unique_accounts,sum(function_call_actions) as total_callsfrom function_call_receiptsgroup by 1