Query editor
-- NetNet · All Games — Daily USDG-Normalized Metrics (master union)---- PRICE METHODOLOGY (v2 — closing price, supersedes the earlier same-day-swap-rate version):-- Native-token amounts (COIN, SPCX, MSFT, NET) are converted to USDG using query 8367506's daily closing-- price: the LAST dex.trades swap of the day across ALL USDG-paired venues for that token. This generalizes-- query 8224214's "last Sync event of day" NET pricing to COIN and MSFT, which have NO Sync-emitting pool at-- all (100% of their liquidity is on Uniswap v3/v4 and other concentrated-liquidity venues that emit Swap,-- not Sync). SPCX has a v2 Sync pool but it went dead 2026-08-07; real volume moved to v3/v4. Using-- dex.trades uniformly for all 4 tokens avoids a two-tier methodology. Validated against 8224214's own-- Sync-based NET close: agreement within ~0.3% on every day except the current partial day.-- Days with <$100 total daily USDG-pair volume for a token have close_price_usdg NULLed in 8367506 (thin-- bootstrap liquidity produced nonsensical closes, e.g. COIN swinging $0.0002 -> $1,608 day to day on a-- handful of dust trades). Those NULLs, plus any day with zero trades at all, are forward-filled from the-- most recent prior valid price here (last-observation-carried-forward); the first date range with no prior-- observation yet falls back to the nearest FOLLOWING valid price (backfill), so early rows aren't null.---- FEE BUGFIX (2026-08-18) — COINflip only: cf_placed's stake_coin was previously read from BetPlaced word3-- and treated as the stake base. Verified WRONG against 113 real COIN-native BetPlaced events (90-day sample,-- num_coins 1-4) cross-checked against the actual outbound COIN Transfer from bettor to desk in the same tx-- (tokens.transfers, blockchain='robinhood', contract_address=0x6330d8c3178a418788df01a47479c0ce7ccf450b):-- - word4 (fee) / word2 (payout reserved if won) = exactly 5.000% in 113/113 rows, all num_coins buckets.-- - word2 + word4 = actual COIN transferred, exact match in 113/113 rows.-- - word3 = word2 * 2^num_coins exactly — a max-payout-cap bookkeeping value, NOT a stake amount.-- Corrected stake_coin = word2 + word4 below (matches 8367015's fix). NOTE: fee_coin itself was ALREADY-- correct (it read word4 directly, which is genuinely 5% of word2) — this bug affected spend_usdg only, NOT-- fees_usdg, for COINflip. See query 8367015 for the full verification detail.-- SpaceX Invaders and MSFT Flight Simulator fee formulas were independently re-verified against real transfers-- (163/163 and 10/10 sampled rows respectively matched exactly) and require NO changes.-- Superstore fees_usdg was previously hardcoded to 0 despite query 8224267 already computing real fee data;-- now wired to k.fee_remitted_usdg (fees actually remitted/collected, vs fee_owed_usdg which is the accrued-- liability before remittance). WinNET has no verified protocol-fee event (keeper_credits_net is a keeper-bot-- reimbursement, not a player fee) and remains 0.---- KNOWN CAVEATS (surfaced explicitly, not smoothed over):-- - SpaceX Invaders "win_rate" is NOT meaningful (every settled bet pays out something, it's a multiplier-- ladder, not binary win/loss). rewards_usdg for SPCX below = full payout_spcx converted to USDG for-- EVERY settled bet (not gated on a "win" flag), which is the correct treatment for this game.-- - Climb Inc. "rewards paid to users" has NO verified reward-payout event. The desk buys+stakes NET on-- the player's behalf (that's usdg_spent, treated as spend here); resigns_assumed/fired_assumed (in-- query 8367333) are a LOW-CONFIDENCE frequency-based guess at which of two session-end events is which,-- with no confirmed token-transfer signature distinguishing "reward paid to player" from "book forfeited-- to pool." rewards_usdg for Climb Inc. is therefore reported as NULL rather than guessed at.-- - Pre-2026-07-22 COIN prices are thin/bootstrap; cumulative USDG-equivalent totals before that date-- should be treated as approximate.withpx_raw as (select day, token_symbol, close_price_usdgfrom query_8367506),all_days as (select day from px_rawunion select day from (select cast(date_trunc('day',block_time) as date) as day from robinhood.logswhere contract_address in (0xa99d15dace9aede816600a31c3e4158926000f3c, 0x75edfe49d9ec8c23a9931c5ef32ec56b2444a141,0xf56e517652bb18e519871abb13a382d205f6e375, 0x21089cfcdbf47902a2f3950200ce9ea66bf79ee4,0x7332b329860986e596b2fd71e9c53786c0242ce5, 0x7cf28d61d42352eb2fd68167e9b08f73cbbf21eb))),