An example of client side interactive querying on an online parquet file. For simplicity, we filtered down the data for just 1 day and just Polkadot. The tech stack behind it is mainly DuckDB, Quarto & ObservableJS.
Code
gaiadb = DuckDBClient. of ({
gaia : FileAttachment ("https://dashboards.data.paritytech.io/datasets/transfers/t1.parquet" )
})
Enter an address below, to show what transfers it received on the 6th of August (Some examples provided for convenience):
1qnJN7FViy3HZaxZK9tGAA71zxHSBeUweirKqCaox4t8GT7
13TJFUPpr3GbSukRA5921hUdr5gwvE2dzzzD1Dsj89s1Ki6p
Code
viewof address = Inputs. text ();
results = gaiadb. query (`
SELECT block_number, sender, receiver, amount
FROM gaia
WHERE receiver = ' ${ address} '
` );
Result table
Code
Inputs. table (results, { sort : "timestamp" , reverse : true });
Plotting stuff
Please note: the result is truncated due to my inability to do frontend properly, thank you. :’)
Code
secondpass = gaiadb. query (`
SELECT block_number, sender, receiver, amount
FROM gaia
WHERE receiver = ' ${ address} '
ORDER BY amount DESC
LIMIT 15
` );
//| fig-align: right
Plot. barX (secondpass, {x : "amount" , y : "sender" , sort : {y : "x" }}). plot ()