---
# System prepended metadata

title: Sample queries for website

---

# Sample queries for website

## Recent Ethereum blocks

Basic information about recent Ethereum blocks

```sql
SELECT number, "timestamp", hash, transaction_count, gas_used
FROM eth.recent_blocks
```

## OpenSea NFT sales across Ethereum/Polygon

Compare the number of NFTs being sold in a five-minute window across both Polygon and Ethereum

```sql
SELECT chain, count(*) as nft_sales, TO_TIMESTAMP((block_timestamp / 300) * 300) as time_window
FROM nft.recent_sales 
GROUP BY time_window, chain
ORDER BY time_window desc
```

## Recent NFT mints

Retrieve recent NFT mints in Ethereum

```sql
SELECT token_address, token_id, to_address, UNIX_TIMESTAMP() - block_timestamp as seconds_ago 
FROM eth.recent_nft_transfers
```

## Transfers of ERC-1155 tokens on Polygon

See the recent ERC-1155 token transfers on the Polygon network.

```sql
SELECT token_address, token_id, from_address, to_address, "value"
FROM polygon.recent_token_transfers
WHERE token_standard = 'erc1155'
```

## Average transaction fees for Ethereum

See the recent average transaction fees paid to include a transaction in the Ethereum network.

```sql
SELECT block_number,
       TO_TIMESTAMP(block_timestamp) as block_timestamp,
       avg(gas) as avg_gas_used,
       avg(gas_price / 1e9) AS avg_gas_price_in_gwei,
       avg(gas * (gas_price / 1e18)) AS avg_fee_in_eth
FROM eth.recent_transactions
GROUP BY block_number, block_timestamp
```

## Total Bitcoin transferred by block number

See the total amount of Bitcoin transferred in the last 30 minutes, broken down by block.

```sql
SELECT block_number, SUM(output_value) / 1e8 AS btc_transferred 
FROM btc.recent_transactions
GROUP BY block_number
```
