Skip to main content
GET
/
pools
/
{address}
/
midprice
/
history
Midprice History
curl --request GET \
  --url https://api.hadron.fi/pools/{address}/midprice/history
{
  "start_time": 1773164464,
  "end_time": 1773250864,
  "timeframe": "1h",
  "data": [
    {
      "timestamp": 1773164464,
      "slot": 410333466,
      "midprice": 0.08771598688326776,
      "base_spread_factor": 0.9994999999180436,
      "signature": "E6cGjfbdRs4ShbmZc1AHeLZg7vN79PYHFWe4..."
    },
    {
      "timestamp": 1773168065,
      "slot": 410342211,
      "midprice": 0.08653769129887223,
      "base_spread_factor": 0.9994999999180436,
      "signature": "3Ni7GhiHoPmnUxcgpPMYW61qPkxUunj4WwB9..."
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.hadron.fi/llms.txt

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

Path Parameters

address
string
required
The pool config PDA address.

Query Parameters

timeframe
string
default:"1h"
Sample interval. One of: 1m, 5m, 30m, 1h, 2h, 4h, 12h, 24h, raw.When set to raw, every recorded midprice point is returned without bucketing/sampling. Results are paginated via cursor.
start_time
integer
Start of the time range as a Unix timestamp in seconds (inclusive). Defaults to end_time - 86400 (24 hours ago).
end_time
integer
End of the time range as a Unix timestamp in seconds (inclusive). Defaults to current time.
limit
integer
default:"200"
Number of records per page (1–1000). Only applicable when timeframe=raw.
cursor
integer
Unix timestamp in seconds. Fetch records before this timestamp (newest first). Use the next_cursor value from a previous response to paginate backwards through history. Only applicable when timeframe=raw.
cluster
string
default:"mainnet-beta"
Solana cluster — mainnet-beta or devnet.

Response

start_time
integer
Start of the requested range (Unix seconds).
end_time
integer
End of the requested range (Unix seconds).
timeframe
string
The sample interval used.
next_cursor
integer | null
Timestamp of the oldest record in the current page (Unix seconds). Pass as cursor to fetch the next (older) page. null when there are no more records. Only present when timeframe=raw.
data
array
Array of midprice samples. One entry per time bucket that contains data (sampled modes), or every recorded point (raw mode).
{
  "start_time": 1773164464,
  "end_time": 1773250864,
  "timeframe": "1h",
  "data": [
    {
      "timestamp": 1773164464,
      "slot": 410333466,
      "midprice": 0.08771598688326776,
      "base_spread_factor": 0.9994999999180436,
      "signature": "E6cGjfbdRs4ShbmZc1AHeLZg7vN79PYHFWe4..."
    },
    {
      "timestamp": 1773168065,
      "slot": 410342211,
      "midprice": 0.08653769129887223,
      "base_spread_factor": 0.9994999999180436,
      "signature": "3Ni7GhiHoPmnUxcgpPMYW61qPkxUunj4WwB9..."
    }
  ]
}

Errors

StatusMessage
400Invalid timeframe
400start_time and end_time must be valid unix timestamps in seconds
400cursor must be a valid unix timestamp in seconds