charts

Exact captured content · path skills/charts/SKILL.md · sha256 6b86a6abadee3228… · revision 1a99e5086c3c4c4de95f32b5ff67e31e043aee77

Download the exact captured file

---
name: charts
description: >-
  Returns price candles (open, high, low, close, volume in USD, trade count) for any token Chord indexes, at 1m, 5m,
  15m, 1h, 4h, 1d or 1w, with a summary of the window: open, close, change in percent, high, low, volume and trades.
  Can write every candle to a CSV and draw a candlestick chart as an SVG. Built only from Chord's own on-chain trade
  index. Covers Monad, Robinhood Chain (tokenized stocks too), Arc, Avalanche, Base, BNB Chain, Arbitrum, Ethereum and
  Solana. Use when the user asks for a chart, candles, OHLC, price history, "how did X move this week" or data to plot.
  Not for the latest individual trades (use live-trades) or a list of movers (use trending). Read only; never signs or
  moves funds.
license: MIT
compatibility: Needs python3 and HTTPS to api.getchord.xyz. Set CHORD_API_KEY (free at chordsi.xyz/me).
metadata:
  author: Chord (getchord.xyz)
  homepage: https://chordsi.xyz/s/charts
  version: "1.0.0"
---

# Charts

Candles built from Chord's own index of every swap on the venues it reads, never a third-party feed. On the EVM chains
1m, 5m and 15m come from a 1-minute rollup and 1h and above from the hourly rollup; history goes back to when Chord
started indexing the chain. Solana candles are one pool, the token's main one, and go up to 1d.

## Run it

```bash
python3 scripts/charts.py CHAIN TOKEN [--tf TF] [--limit N] [--csv PATH] [--svg PATH]
```

- `CHAIN`: monad, robinhood, arc, avalanche, base, bnb, arbitrum, ethereum or solana.
- `TOKEN`: a contract address (best), a listed symbol, or the native coin (MON, ETH, AVAX, BNB: charted through its wrapped
  token). On Solana, the mint exactly as written, or a symbol when only one token carries it.
- `--tf`: 1m, 5m, 15m, 1h, 4h, 1d or 1w (default 1h; Solana up to 1d). `--limit`: candles, 2 to 1000 (default 48).
- `--csv PATH`: write every candle (time, unix, open, high, low, close, volume_usd, trades). `--svg PATH`: draw the chart.

Example: `python3 scripts/charts.py robinhood NVDA --tf 1d --limit 30 --csv nvda.csv`

## Read the answer

- `summary`: `open` (first candle), `close` (last), `changePct`, `high`, `low`, `volumeUsd`, `trades`, `from` and `to` in UTC,
  `lastCandleOpen` (true = the newest candle is still forming).
- `rows`: `[timeUtc, open, high, low, close, volumeUsd, trades]`, prices in USD to 6 significant digits. At most the newest
  100 are printed; the CSV has all of them. On EVM chains a candle with `trades` 0 had no trade and carries the previous close.
- `files`: paths of the CSV and SVG written. Exit code 3 = several tokens share that symbol: show the candidates and ask.

## How to answer the user

1. Name the token, its chain, the timeframe and the window in UTC.
2. Lead with the close, the change in percent and the range (low to high), then the volume in dollars.
3. Say if the last candle is still open. On Robinhood Chain, stock tokens trade around the clock, so they move while the
   US market is closed: say so when it matters.
4. Describe what the candles show; never predict the next move or give investment advice.

## Cost

One run is one call, plus one when you pass a symbol instead of an address. Writing the CSV or the SVG costs nothing more.
300 calls a month are free; then $0.006 a call from your ChordSI credit. If the script exits with code 4, show the person
the message: their credit is empty or a limit was reached, and chordsi.xyz/me is where they top up.