Query by @astrolabe-rwa, updated 2026-10-04. #rwa #commodities #gold
Example query
SELECT block_date AS day, symbol,
round(round(if(sumIf(usd_amount, venue = 'Raydium CLMM') >= 100, quantileExactWeightedIf(0.5)(price_usd, toUInt64(usd_amount * 100), venue = 'Raydium CLMM'), quantileExactWeighted(0.5)(price_usd, toUInt64(usd_amount * 100))), 2) / first_value(round(if(sumIf(usd_amount, venue = 'Raydium CLMM') >= 100, quantileExactWeightedIf(0.5)(price_usd, toUInt64(usd_amount * 100), venue = 'Raydium CLMM'), quantileExactWeighted(0.5)(price_usd, toUInt64(usd_amount * 100))), 2)) OVER (PARTITION BY symbol ORDER BY block_date) * 100, 2) AS price_index
FROM ref.rwa_trades
WHERE block_date >= today() - {{days}} AND symbol IN ('GLDx', 'GOLD')
GROUP BY day, symbol
ORDER BY dayCharts: Gold tokens, price index (first day = 100): GLDx is a share of the GLD ETF, GOLD is one ounce.
| day | symbol | price_index |
|---|---|---|
| 2026-11-09 | GLDx | 100.0 |
| 2026-11-09 | GOLD | 100.0 |
| 2026-11-10 | GLDx | 98.69 |
| 2026-11-10 | GOLD | 99.24 |
| 2026-11-11 | GLDx | 98.17 |
| 2026-11-11 | GOLD | 98.03 |
| 2026-11-12 | GLDx | 95.74 |
| 2026-11-12 | GOLD | 96.55 |
| 2026-11-13 | GLDx | 94.55 |
| 2026-11-13 | GOLD | 95.19 |
| 2026-11-14 | GLDx | 92.62 |
| 2026-11-14 | GOLD | 94.41 |
| 2026-11-15 | GLDx | 93.11 |
| 2026-11-15 | GOLD | 94.42 |
| 2026-11-16 | GLDx | 93.89 |
| 2026-11-16 | GOLD | 94.89 |
| 2026-11-17 | GLDx | 93.93 |
| 2026-11-17 | GOLD | 94.94 |
| 2026-11-18 | GLDx | 91.66 |
| 2026-11-18 | GOLD | 93.47 |
| 2026-11-19 | GLDx | 90.05 |
| 2026-11-19 | GOLD | 90.76 |
| 2026-11-20 | GLDx | 86.07 |
| 2026-11-20 | GOLD | 87.57 |
| 2026-11-21 | GLDx | 86.35 |
| 2026-11-21 | GOLD | 86.95 |
| 2026-11-22 | GLDx | 86.32 |
| 2026-11-22 | GOLD | 87.21 |
28 rows. Computed 2026-11-23T11:23:16Z.