Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ivory.finance/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

Authorization: Bearer <access_token>

Request body

FieldRequiredDefaultDescription
sqlYesQuestDB SQL query
limitNo1000Auto-appended LIMIT for SELECT queries that have none
curl -X POST https://api.ivory.finance/v1/rtdb/query \
  -H "Authorization: Bearer $IVORY_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "SELECT ticker, avg(price) as avg_price, sum(volume) as total_vol FROM trades WHERE timestamp > dateadd(h, -1, now()) SAMPLE BY 5m",
    "limit": 500
  }'
{
  "columns": [
    { "name": "timestamp", "type": "TIMESTAMP" },
    { "name": "ticker",    "type": "SYMBOL" },
    { "name": "avg_price", "type": "DOUBLE" },
    { "name": "total_vol", "type": "LONG" }
  ],
  "dataset": [
    ["2026-03-26T10:00:00.000000Z", "AAPL", 185.42, 42300],
    ["2026-03-26T10:05:00.000000Z", "AAPL", 185.61, 38900]
  ],
  "rows": 2,
  "duration_ms": 4.7
}

QuestDB SQL highlights

QuestDB extends SQL with time-series primitives:
ClauseDescriptionExample
SAMPLE BYAggregate by time bucketSAMPLE BY 1h
LATEST ONLast row per partition keyLATEST ON ts PARTITION BY ticker
dateadd()Date arithmeticdateadd(d, -7, now())
TIMESTAMP(col)Designate timestamp columnUsed in CREATE TABLE
Every query is logged in rt.questdb_queries for audit purposes. The log records the SQL, row count returned, and latency.