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

# 1-Minute Candles from Fills

> Build OHLCV candles for a market from raw fills, and know which ones are final.

Fetch a window with `/v1/fills`, keep the taker's fill of each match (so each trade counts once), and bucket by minute. Only treat candles that end at or before `completeThroughTs` as final.

```python Python theme={null}
# uses get() from Rate Limits
from collections import defaultdict

def candles(market, start, end, outcome=0):
    rows, after = [], None
    while True:
        params = {"markets": market, "from": start, "to": end, "limit": 50000}
        if after:
            params["after"] = after
        page = get("/v1/fills", **params)
        rows += page["fills"]
        final_through = page["completeThroughTs"]
        after = page["next"]
        if not after:
            break
    bars = defaultdict(list)
    for _, ts, _, _, o, side, shares, usd, _, is_taker, _ in rows:
        if o != outcome or not is_taker or shares == 0:
            continue
        bars[ts - ts % 60].append((usd / shares, shares / 1e6))
    out = []
    for minute in sorted(bars):
        prices = [p for p, _ in bars[minute]]
        out.append({
            "t": minute, "open": prices[0], "high": max(prices), "low": min(prices),
            "close": prices[-1], "volume": sum(v for _, v in bars[minute]),
            "final": minute + 60 <= final_through + 1,
        })
    return out
```

<Tip>
  Send `Accept-Encoding: gzip` (requests does by default): a full page of fills is 1 to 3 MB of digits and shrinks about six times.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.