Sample SQL Query

Example: Query all trades on Osmosis DEX and order them by Pool

SELECT
	count(*) as Trades,
	attribute_value as Pool_ID
FROM `numia-data.osmosis.osmosis_event_attributes`
WHERE event_type = 'token_swapped'
AND attribute_key = 'pool_id'
GROUP BY 2
ORDER BY 1 desc;

💡 Tip: For a primer in SQL queries, visit https://www.w3schools.com/sql/

Last updated