Volume History
curl --request GET \
--url https://api.hadron.fi/pools/{address}/volume/historyimport requests
url = "https://api.hadron.fi/pools/{address}/volume/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.hadron.fi/pools/{address}/volume/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hadron.fi/pools/{address}/volume/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hadron.fi/pools/{address}/volume/history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hadron.fi/pools/{address}/volume/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hadron.fi/pools/{address}/volume/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"start_time": 1772646065,
"end_time": 1773250865,
"timeframe": "24h",
"data": [
{
"timestamp": 1772582400,
"volume": 115.41,
"fees": 0
},
{
"timestamp": 1772668800,
"volume": 1058.62,
"fees": 0
},
{
"timestamp": 1772755200,
"volume": 267.98,
"fees": 0
}
]
}
Pools
Volume History
Returns historical trading volume for a pool in daily buckets.
GET
/
pools
/
{address}
/
volume
/
history
Volume History
curl --request GET \
--url https://api.hadron.fi/pools/{address}/volume/historyimport requests
url = "https://api.hadron.fi/pools/{address}/volume/history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.hadron.fi/pools/{address}/volume/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hadron.fi/pools/{address}/volume/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hadron.fi/pools/{address}/volume/history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hadron.fi/pools/{address}/volume/history")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hadron.fi/pools/{address}/volume/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"start_time": 1772646065,
"end_time": 1773250865,
"timeframe": "24h",
"data": [
{
"timestamp": 1772582400,
"volume": 115.41,
"fees": 0
},
{
"timestamp": 1772668800,
"volume": 1058.62,
"fees": 0
},
{
"timestamp": 1772755200,
"volume": 267.98,
"fees": 0
}
]
}
Path Parameters
string
required
The pool config PDA address.
Query Parameters
string
default:"24h"
Bucket size. Currently only
24h is supported.integer
Start of the time range as a Unix timestamp in seconds. Defaults to 7 days ago.
integer
End of the time range as a Unix timestamp in seconds. Defaults to current time.
string
default:"mainnet-beta"
Solana cluster —
mainnet-beta or devnet.Response
integer
Start of the requested range (Unix seconds).
integer
End of the requested range (Unix seconds).
string
The bucket size used.
array
{
"start_time": 1772646065,
"end_time": 1773250865,
"timeframe": "24h",
"data": [
{
"timestamp": 1772582400,
"volume": 115.41,
"fees": 0
},
{
"timestamp": 1772668800,
"volume": 1058.62,
"fees": 0
},
{
"timestamp": 1772755200,
"volume": 267.98,
"fees": 0
}
]
}
Sub-day timeframes (
1h, 4h, 12h) are planned for a future release.Errors
| Status | Message |
|---|---|
400 | Only 24h timeframe is supported for volume history in v1 |