> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> End-to-end workflow walkthroughs showing the assistant's multi-step reasoning.

These examples show how the assistant chains multiple tools together to answer complex questions. Each demonstrates a realistic workflow from question to final result.

## From question to dashboard

A single question that triggers schema discovery, SQL, execution, visualization, and sharing.

<Steps>
  <Step title="Ask the question">
    ```
    Show me stablecoin market share by issuer over the last 90 days,
    and create a dashboard I can share.
    ```
  </Step>

  <Step title="Schema search">
    The assistant searches for relevant tables and finds `crosschain.dex.trades`. It checks documentation for best practices on stablecoin analysis.
  </Step>

  <Step title="SQL generation and validation">
    ```sql theme={null}
    SELECT
        DATE(block_timestamp) AS date,
        CASE
            WHEN symbol IN ('USDT', 'USDT.e') THEN 'Tether'
            WHEN symbol IN ('USDC', 'USDC.e') THEN 'Circle'
            WHEN symbol = 'DAI' THEN 'MakerDAO'
            WHEN symbol = 'BUSD' THEN 'Paxos'
            ELSE 'Other'
        END AS issuer,
        SUM(usd_amount) AS daily_volume
    FROM crosschain.dex.trades
    WHERE block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '90 days'
        AND symbol IN ('USDT', 'USDT.e', 'USDC', 'USDC.e', 'DAI', 'BUSD', 'FDUSD', 'TUSD')
    GROUP BY date, issuer
    ORDER BY date DESC;
    ```

    The assistant validates this with `EXPLAIN` before asking you to confirm execution.
  </Step>

  <Step title="Dashboard creation">
    After execution, the assistant:

    * Creates a dashboard with an **area chart** showing stablecoin volume share over time
    * Adds a **summary table** with total volume by issuer
    * Makes the dashboard **public** and returns a share link
  </Step>

  <Step title="Result">
    > Here's your stablecoin market share dashboard for the last 90 days.
    > Tether leads with 62% of volume, followed by Circle at 28%.
    >
    > **Dashboard:** app.allium.so/s2/abc123
    >
    > Want me to share a summary on X?
  </Step>
</Steps>

***

## Real-time portfolio analysis

Using real-time APIs (no SQL) to analyze a wallet's holdings.

<Steps>
  <Step title="Ask the question">
    ```
    What tokens does vitalik.eth hold? Give me a full breakdown with current values.
    ```
  </Step>

  <Step title="Address resolution">
    The assistant resolves `vitalik.eth` to `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` and looks up the address label to confirm it's Vitalik Buterin's wallet.
  </Step>

  <Step title="Balance lookup">
    Calls the **real-time wallet balances** API to get current token holdings across chains - no SQL query needed.
  </Step>

  <Step title="Price enrichment">
    Fetches **current token prices** for all held tokens to calculate USD values and portfolio allocation.
  </Step>

  <Step title="Result">
    > **Vitalik Buterin's Portfolio (Ethereum)**
    >
    > | Token | Balance | USD Value | % of Portfolio |
    > | ----- | ------- | --------- | -------------- |
    > | ETH   | 1,234   | \$3.2M    | 45.2%          |
    > | USDC  | 890,000 | \$890K    | 12.6%          |
    > | ...   | ...     | ...       | ...            |
    >
    > **Total value:** \~\$7.1M across 24 tokens
    >
    > Want me to check balances on other chains too?
  </Step>
</Steps>

***

## Cross-chain comparison

Multi-chain analysis using SQL with schema discovery.

<Steps>
  <Step title="Ask the question">
    ```
    Compare average gas costs across L2s this month.
    Show me which L2 is cheapest for a simple transfer.
    ```
  </Step>

  <Step title="Schema discovery">
    The assistant searches for gas-related schemas across multiple chains. It finds `<chain>.raw.transactions` tables and documentation on gas calculation differences between L2s.
  </Step>

  <Step title="Cross-chain SQL">
    Writes a `UNION ALL` query across multiple L2 chains (Arbitrum, Optimism, Base, Polygon zkEVM, etc.), calculating average gas cost in USD per simple transfer.
  </Step>

  <Step title="Result">
    > **Average gas cost per transfer (this month)**
    >
    > | L2       | Avg Gas Cost | Median   | 95th Percentile |
    > | -------- | ------------ | -------- | --------------- |
    > | Base     | \$0.001      | \$0.0008 | \$0.003         |
    > | Arbitrum | \$0.003      | \$0.002  | \$0.01          |
    > | Optimism | \$0.004      | \$0.003  | \$0.012         |
    > | ...      | ...          | ...      | ...             |
    >
    > Base is currently the cheapest for simple transfers at \~\$0.001 avg.
    >
    > Want me to create a dashboard tracking this over time?
  </Step>
</Steps>

***

## Building on previous context

A multi-turn conversation showing how the assistant builds on earlier work.

<Steps>
  <Step title="Turn 1: Initial question">
    ```
    How many daily active wallets does Uniswap have on Ethereum?
    ```

    The assistant finds `ethereum.dex.trades`, writes SQL filtering for Uniswap, and returns daily active wallet counts.
  </Step>

  <Step title="Turn 2: Refine">
    ```
    Break that down by Uniswap version (v2 vs v3)
    ```

    The assistant **modifies the previous query** to add a version breakdown - no need to re-explain the context.
  </Step>

  <Step title="Turn 3: Expand scope">
    ```
    Add Sushiswap and Curve for comparison
    ```

    Expands the query to include multiple DEXes, adjusting the `WHERE` clause and grouping.
  </Step>

  <Step title="Turn 4: Visualize">
    ```
    Create a dashboard with this data
    ```

    Creates a dashboard with:

    * Line chart of daily active wallets by DEX over time
    * Stacked bar chart showing version breakdown for Uniswap
  </Step>

  <Step title="Turn 5: Share">
    ```
    Make it public and share on X
    ```

    Makes the dashboard public, generates a tweet with key insights and the dashboard link, and returns the X intent URL for you to review and post.
  </Step>
</Steps>
