ohlcv_history - recent candles (one-shot)
One-shot request: returns the most recent N 1-second candles for a pool. Use it to seed a chart, then upgrade to subscribe_ohlcv for live updates. Pass one of mint or pool, plus an optional limit (1 – 500, default 200).
| Channel | Socket.IO event with ack |
| Auth | auth.api_key in the handshake |
Example
- JavaScript
- Python
socket.emit("ohlcv_history", { pool: "4mBL…", limit: 200 }, (ack) => {
if (!ack.ok) return console.error(ack);
for (const [t, o, h, l, c, v] of ack.data) {
console.log(new Date(t), `o=${o} h=${h} l=${l} c=${c} v=${v}`);
}
});
from datetime import datetime
# sio.call blocks until the server acks the one-shot request.
ack = sio.call("ohlcv_history", {"pool": "4mBL…", "limit": 200})
if ack["ok"]:
for t, o, h, l, c, v in ack["data"]:
print(datetime.fromtimestamp(t / 1000), f"o={o} h={h} l={l} c={c} v={v}")
Response (ack)
{
"ok": true,
"pool": "4mBL…",
"data": [
[1779812627000, 0.000000033, 0.000000034, 0.000000033, 0.000000034, 5.12],
[1779812628000, 0.000000034, 0.000000035, 0.000000034, 0.000000035, 7.40]
]
}
Tuples are [ timestamp_ms, open, high, low, close, volume ], sorted oldest → newest. Format matches the live ohlcv stream.
Try it
Notes
- This is the only paid one-shot WS call - the rest are subscribes.
- Returns whatever's currently in the rolling Redis window (typically the last ~2 minutes of 1s candles between flushes to ClickHouse). For deeper history, a REST
/ohlcvendpoint withfrom/tois on the roadmap.