> For the complete documentation index, see [llms.txt](https://docs.unstable.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unstable.run/for-users/reading-the-chart.md).

# Reading the chart

The token detail page renders a **native candlestick chart** built on [TradingView Lightweight Charts](https://tradingview.com/lightweight-charts/) — the same library Uniswap and PancakeSwap use for their per-pool views.

## Where the data comes from

Every candle is **derived from on-chain Uniswap V3 `Swap` events** on the token's pool. There is no CEX feed, no DexScreener dependency, no external indexer. When someone trades:

1. Their swap emits a `Swap(sender, recipient, amount0, amount1, sqrtPriceX96, liquidity, tick)` event on the pool contract.
2. Our server reads those events via Alchemy, buckets them by timeframe, and computes OHLCV.
3. Your browser fetches the bucketed candles from `/api/chart/[token]?tf=1m` and hands them to TradingView.

The result: a chart that lags the on-chain state by \~5-30 seconds depending on timeframe, with no third-party dependency.

## Timeframes

The chip row above the chart lets you switch between four resolutions:

| Chip   | Bucket size | Use when                                |
| ------ | ----------- | --------------------------------------- |
| **1M** | 1 minute    | Recent launches, active trading session |
| **5M** | 5 minutes   | Zooming out after a spike               |
| **1H** | 1 hour      | Longer-term view for older tokens       |
| **1D** | 1 day       | Full history for graduated tokens       |

Switching timeframes triggers a fresh fetch — the chart re-renders with the new bucketing in a second or two.

## What the marks mean

| Element                       | Meaning                                                                      |
| ----------------------------- | ---------------------------------------------------------------------------- |
| **Green candle**              | Close ≥ Open — price finished the bucket higher than it started.             |
| **Red candle**                | Close < Open — price finished the bucket lower than it started.              |
| **Wick (thin line)**          | High & low reached during the bucket.                                        |
| **Body (thick rectangle)**    | Open & close of the bucket. Length shows how far the price moved.            |
| **Volume histogram (bottom)** | USDT0 volume traded in the bucket. Colored to match the candle direction.    |
| **Right axis**                | Price in USDT0. Precision auto-adjusts — a $0.000002 token shows 8 decimals. |
| **Bottom axis**               | Local time.                                                                  |

## Chart interactions

* **Hover** — crosshair snaps to the nearest candle; price & time surface on the axes.
* **Scroll wheel** — zoom horizontally.
* **Click + drag** — pan across time.
* **Pinch** on trackpad or touchscreen — zoom.
* **Double-click** on the price axis — reset the vertical zoom.

The chart auto-fits the whole visible range whenever new data arrives.

## Why the first candle looks weird

Every launched token starts with a **single-sided LP position** at the anchor tick. The very first trade — whether from an initial buy or from a first sniper — moves the price into the "in-range" region. That's why brand-new tokens often show a single tall candle: it captures the entire launch tick to the first swap price in one bucket.

Subsequent trades render normally.

## When the chart is empty

If a token was just launched and nobody has traded yet, the chart shows:

> **No trades yet · be the first swap**

Nothing's broken — the pool literally has no `Swap` events to plot. Make the first trade and the first candle appears within a few seconds.

## Reliability under the hood

Unstable is engineered specifically to avoid the "chart keeps disappearing" flakiness common to launcher UIs:

* Every candle response is **cached at the Vercel Edge** for 60 seconds and served with `stale-while-revalidate`, so RPC hiccups don't blank the display.
* On failure, the browser **falls back to the last-known chart** it saved in localStorage.
* The chart is **refetched every 30 seconds** in the background — but only while the tab is visible, to save your battery.

You should see the chart every time you load the page, even on slow connections.

## Next

* [Trades & holders panel](/for-users/trades-and-holders.md) — the recent-trades feed under the chart
* [Fees & creator rewards](/under-the-hood/fees-and-rewards.md) — where every 1% fee flows


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.unstable.run/for-users/reading-the-chart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
