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

# Flows

> Visualize the paths users take through your product

## Overview

Flows (also called Sankey diagrams) visualize the paths users take through your product. See what users do before and after any event, discover common patterns, and identify unexpected behaviors.

## Use Cases

<AccordionGroup>
  <Accordion title="User Journey Discovery">
    * What do users do after connecting their wallet?
    * What actions lead to a first transaction?
    * Where do users go after viewing the pricing page?
  </Accordion>

  <Accordion title="Drop-off Analysis">
    * Where do users go instead of converting?
    * What do users do after abandoning checkout?
    * Why are users leaving the swap page?
  </Accordion>

  <Accordion title="Feature Discovery">
    * How do users discover feature X?
    * What's the typical path to becoming a power user?
    * Do users explore multiple chains before settling?
  </Accordion>
</AccordionGroup>

## Quick Start

<Steps>
  <Step title="Select Starting Event">
    Choose the event to center your analysis:

    ```
    Starting Event: wallet_connect
    ```
  </Step>

  <Step title="Choose Direction">
    Analyze what happens before, after, or both:

    ```
    Direction: Steps After
    Number of steps: 5
    ```
  </Step>

  <Step title="Configure Display">
    * Set number of steps to show
    * Choose to hide specific events
    * Apply breakdowns
  </Step>

  <Step title="Analyze Patterns">
    Identify common paths and unexpected behaviors
  </Step>
</Steps>

## Flow Directions

### Steps After

See what users do **after** an event:

```mermaid theme={null}
flowchart LR
    A[wallet_connect] --> B[swap_completed<br/>40%]
    A --> C[page_view: /pools<br/>25%]
    A --> D[page_view: /docs<br/>20%]
    A --> E[session_end<br/>15%]
```

**Use for:**

* Understanding what users do after key milestones
* Identifying next-step opportunities
* Finding unexpected behaviors

### Steps Before

See what users do **before** an event:

```mermaid theme={null}
flowchart LR
    A[page_view: /landing<br/>30%] --> E[wallet_connect]
    B[page_view: /docs<br/>25%] --> E
    C[referral_link<br/>25%] --> E
    D[direct_visit<br/>20%] --> E
```

**Use for:**

* Understanding what leads to conversions
* Identifying effective entry points
* Discovering successful paths

### Steps Before & After

See the complete journey around an event:

```mermaid theme={null}
flowchart LR
    subgraph Before["Before"]
        A1[landing 30%]
        A2[docs 25%]
        A3[referral 25%]
        A4[direct 20%]
    end
    subgraph Event["Event"]
        B[wallet_connect]
    end
    subgraph After["After"]
        C1[swap_init 40%]
        C2[pool_view 25%]
        C3[docs 20%]
        C4[leave 15%]
    end
    A1 --> B
    A2 --> B
    A3 --> B
    A4 --> B
    B --> C1
    B --> C2
    B --> C3
    B --> C4
```

**Use for:**

* Complete journey understanding
* Before/after comparisons
* Holistic flow analysis

## Reading Flow Diagrams

### Sankey Structure

```mermaid theme={null}
flowchart LR
    A[Event A<br/>1000 users] --> B[Event B<br/>500 users, 50%]
    A --> C[Event C<br/>300 users, 30%]
    A --> D[Event D<br/>200 users, 20%]
```

**Wider paths** = More users taking that route
**Percentages** = Share of users from previous step

### Multi-Step Flows

```mermaid theme={null}
flowchart LR
    subgraph Step1["Step 1"]
        A[connect]
    end
    subgraph Step2["Step 2"]
        B1[swap]
        B2[pool]
        B3[leave]
    end
    subgraph Step3["Step 3"]
        C1[success 80%]
        C2[fail 20%]
        C3[add_liq 60%]
        C4[leave 40%]
        C5[end]
    end
    A --> B1
    B1 --> C1
    B1 --> C2
    A --> B2
    B2 --> C3
    B2 --> C4
    A --> B3
    B3 --> C5
```

## Configuration Options

### Number of Steps

Control how many steps to display:

```
1 step: Immediate next action only
3 steps: Short journey
5 steps: Medium journey (recommended)
10 steps: Full exploration
```

### Hide Events

Remove noise by hiding irrelevant events:

```
Hide events:
- page_view (too noisy)
- scroll (not meaningful)
- mouse_move (irrelevant)

Keep:
- wallet_connect
- swap_completed
- transaction
```

### Breakdown by Property

Split flows by a property:

```
Breakdown: device_type

Mobile:
connect → swap (25%) → success

Desktop:
connect → swap (45%) → success

→ Desktop users convert better!
```

## Filters

Focus on specific user segments or behaviors:

### Event Filters

Filter the starting event:

```
Starting Event: wallet_connect
  └── where: wallet_type = "metamask"

Only MetaMask connections
```

### User Filters

Filter by user properties:

```
User Filter:
├── country = "US"
├── AND plan = "pro"

US Pro users only
```

### Time Filters

Analyze specific periods:

```
Time Range: Last 30 days
Granularity: Daily

See recent behavior patterns
```

## Web3 Flow Examples

### Post-Wallet Connection

**Starting Event:** `wallet_connect` · **Direction:** 5 Steps After

```mermaid theme={null}
flowchart TB
    A[wallet_connect] --> B[swap_initiated 40%]
    A --> C[pool_viewed 25%]
    A --> D[docs_viewed 20%]
    A --> E[session_end 15%]
    B --> B1[transaction swap 75%]
    C --> C1[liquidity_added 50%]
    D --> D1[wallet_connect 30%]
```

### Pre-Transaction Path

**Starting Event:** Transaction (any) · **Direction:** 5 Steps Before

```mermaid theme={null}
flowchart TB
    A1[token_selected 90%] --> A2[swap_quoted 85%] --> A3[swap_initiated 60%] --> T[Transaction]
    B1[pool_viewed 75%] --> B2[liquidity_add_clicked 20%] --> T
    C1[staking_page_viewed 80%] --> C2[stake_clicked 20%] --> T
```

### Cross-Chain Exploration

**Starting Event:** `chain_changed` · **Breakdown:** new\_chain

```mermaid theme={null}
flowchart LR
    subgraph Before["Before → Arbitrum"]
        A1[swap_failed Ethereum 40%]
        A2[price_comparison_viewed 35%]
        A3[gas_estimate_viewed 25%]
    end
    E[chain_changed]
    subgraph After["After"]
        B1[swap_completed 65%]
        B2[returned_to_ethereum 35%]
    end
    A1 --> E
    A2 --> E
    A3 --> E
    E --> B1
    E --> B2
```

### NFT Journey

**Starting Event:** `nft_viewed` · **Filter:** collection = "CoolCats"

```mermaid theme={null}
flowchart TB
    A[nft_viewed] --> B[additional_nft_viewed 35%]
    A --> C[wallet_connect 30%]
    A --> D[collection_explored 20%]
    A --> E[session_end 15%]
    C --> C1[mint_initiated 60%]
    C1 --> C2[transaction mint 70%]
```

## Analyzing Flows

### Identifying Patterns

**High-Volume Paths:**
Look for the thickest flows—these are your main user journeys.

```
If 60% of users go: landing → docs → wallet_connect
→ Optimize this path! It's your main funnel.
```

**Unexpected Paths:**
Look for surprising flows.

```
If 20% of users go: checkout → settings → checkout
→ Are they looking for payment options?
```

### Identifying Drop-Off

**Exit Points:**
Where do users leave?

```mermaid theme={null}
flowchart LR
    A[swap_initiated] --> B[session_end 25%]
```

→ Users leaving before completing—investigate UX

**Detours:**
Where do users go instead of converting?

```mermaid theme={null}
flowchart LR
    subgraph Expected["Expected"]
        A1[swap_page] --> B1[swap_completed]
    end
    subgraph Actual["Actual"]
        A2[swap_page] --> B2[docs 40%]
    end
```

→ Users need more information before swapping

### Comparing Segments

Use breakdowns to compare:

```mermaid theme={null}
flowchart TB
    subgraph Mobile["Mobile after wallet_connect"]
        M[wallet_connect] --> M1[swap 25%]
        M --> M2[leave 40%]
        M --> M3[browse 35%]
    end
    subgraph Desktop["Desktop after wallet_connect"]
        D[wallet_connect] --> D1[swap 45%]
        D --> D2[leave 20%]
        D --> D3[browse 35%]
    end
```

→ Mobile users leaving more—mobile UX issue?

## Best Practices

### Choose Meaningful Starting Events

```
✅ Good starting events:
- wallet_connect (key milestone)
- purchase_completed (conversion point)
- feature_used (engagement signal)
- signup_completed (lifecycle event)

❌ Poor starting events:
- page_view (too broad)
- click (too generic)
- scroll (not meaningful)
```

### Hide Noise

Remove events that obscure patterns:

```
Hide:
- Generic page_views (keep specific ones)
- Scroll events
- Mouse events
- Internal/system events
```

### Use Appropriate Step Counts

```
Immediate impact: 1-2 steps
Journey analysis: 3-5 steps
Full exploration: 5-10 steps

More steps = more complexity
Start small, expand as needed
```

### Segment Meaningfully

```
✅ Actionable breakdowns:
- device_type (fix mobile?)
- traffic_source (optimize channel?)
- user_tier (different needs?)

❌ Not actionable:
- random_id
- timestamp
```

## Saving & Sharing

### Save Flow

1. Configure your flow analysis
2. Click **Save**
3. Name it: "Post-Wallet Connect Journey"

### Add to Board

Include flows in dashboards for ongoing monitoring. All saved flows can be added to boards.

## Next Steps

<CardGroup cols={2}>
  <Card title="Boards" icon="table-columns" href="/analysis/boards">
    Create dashboards with flows
  </Card>

  <Card title="Cohorts" icon="users" href="/analysis/cohorts">
    Analyze flows for specific segments
  </Card>
</CardGroup>
