Skip to main content
The Allium AI Assistant helps you write SQL queries by converting plain English questions into SQL statements. Spend more time conducting analysis and less time writing SQL.

How It Works

The AI Assistant is available in the sidebar throughout the Allium App, providing context-aware help wherever you need it.

Key Features

Natural Language to SQL

Ask questions in plain English and get executable SQL queries instantly

Context-Aware Help

The assistant understands your current query editor context and can help improve or fix it

Getting Started

1

Open the Assistant

Click the Assistant icon in the sidebar to open the AI Assistant panel.
AI Assistant sidebar panel in Allium App
2

Ask a Question

Type your question in plain English. The assistant will generate a SQL query with an explanation.
AI Assistant generating SQL from natural language question
Example Questions:
  • “Show me DEX volume by chain for the last 30 days”
  • “What are the top 10 tokens by trading volume on Ethereum?”
  • “Get wallet balances for specific addresses”
3

Use Context-Aware Features

When writing a query in the editor, the assistant automatically picks up your current work. Simply open the assistant and type:
  • “Fix query” - Identify and fix errors in your current query
  • “Improve this query” - Get optimization suggestions
  • “Explain this query” - Understand what your query does
AI Assistant providing context-aware help for existing query
4

Run the Query

Click Run Query to execute the generated SQL directly in the query editor.

Example Query

Question:
Derive DEX Notionals by Blockchain.
Generated SQL:
SELECT
    DATE(block_timestamp) AS date,
    chain,
    SUM(usd_amount) AS usd_volume,
    COUNT(distinct transaction_from_address) AS traders
FROM
    crosschain.dex.trades
WHERE
    block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '90 days'
GROUP BY
    date, chain
ORDER BY
    date DESC;
Explanation: This query aggregates the total notional traded on decentralized exchanges (DEX) for different blockchains by summing up usd_amount for each chain on a daily basis.

DEX Data Available

Allium provides detailed data on DEX trades, including:
  • Trades - Token swaps on major DEXes
  • Aggregator Trades - Trades executed by aggregators or contracts that route swaps across multiple liquidity pools
  • Liquidity Pool Events - Liquidity pool events such as mints, burns, sync, and collect
  • Liquidity Pools - Pool creation events and their parameters
For more detailed information, visit the DEX documentation.

Tips for Success

Be Specific

The more precise your question, the better the AI can understand your data needs

Iterate & Refine

Use the context-aware features to improve existing queries on the fly

Use Commands

Try “fix query”, “improve this”, or “explain” when working with existing SQL

Check Results

Always review generated queries to ensure they match your requirements

Need Help?

Get SupportFor specific queries or deeper insights beyond the AI Assistant, reach out to support@allium.so. We’re happy to set up a Slack or Telegram channel for easy communication.
I