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,
      "midprice": 0.08771598688326776,
      "base_spread_factor": 0.9994999999180436
    },
    {
      "timestamp": 1773168065,
      "midprice": 0.08653769129887223,
      "base_spread_factor": 0.9994999999180436
    }
  ]
}

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 after this timestamp. Use the next_cursor value from a previous response to paginate. 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 last record in the current page (Unix seconds). Use as the cursor param to fetch the next 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,
      "midprice": 0.08771598688326776,
      "base_spread_factor": 0.9994999999180436
    },
    {
      "timestamp": 1773168065,
      "midprice": 0.08653769129887223,
      "base_spread_factor": 0.9994999999180436
    }
  ]
}

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