Skip to main content
Write SQL queries spanning all blockchains offered by Allium. Query raw blockchain data for full flexibility, or leverage abstracted data models to quickly access the data you need (e.g., crosschain.dex.trades and crosschain.stablecoin.transfers).
1

Create a New Query

Navigate to app.allium.so/analyze/queries and click New.
2

Write Your SQL Query

Enter your SQL query in the editor. Here’s an example that fetches DEX USD volume for Ethereum, Base, and Solana over the last 10 days:
-- DEX USD volume for Ethereum, Base, and Solana for the last 10 days
select
  date(block_timestamp) as date,
  chain,
  sum(usd_amount) as usd_volume
from crosschain.dex.trades
where
  block_timestamp >= current_timestamp - interval '10 days'
  and chain in ('ethereum', 'base', 'solana')
group by all
order by date asc;
3

Execute and View Results

Click Run to execute the query. Results appear in table format:
Query results table
Switch to chart view and group by chain to visualize the data:
Query results chart
Learn more about charting options in the Visualize Results guide.

Next Steps

I