Get Pnl History
curl --request POST \
--url https://api.allium.so/api/v1/developer/wallet/pnl/history \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"addresses": [
{
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana"
}
],
"end_timestamp": "2025-04-10T00:00:00Z",
"granularity": "1h",
"start_timestamp": "2025-04-01T00:00:00Z"
}
'import requests
url = "https://api.allium.so/api/v1/developer/wallet/pnl/history"
payload = {
"addresses": [
{
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana"
}
],
"end_timestamp": "2025-04-10T00:00:00Z",
"granularity": "1h",
"start_timestamp": "2025-04-01T00:00:00Z"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
addresses: [{address: '125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp', chain: 'solana'}],
end_timestamp: '2025-04-10T00:00:00Z',
granularity: '1h',
start_timestamp: '2025-04-01T00:00:00Z'
})
};
fetch('https://api.allium.so/api/v1/developer/wallet/pnl/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.allium.so/api/v1/developer/wallet/pnl/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'addresses' => [
[
'address' => '125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp',
'chain' => 'solana'
]
],
'end_timestamp' => '2025-04-10T00:00:00Z',
'granularity' => '1h',
'start_timestamp' => '2025-04-01T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.allium.so/api/v1/developer/wallet/pnl/history"
payload := strings.NewReader("{\n \"addresses\": [\n {\n \"address\": \"125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp\",\n \"chain\": \"solana\"\n }\n ],\n \"end_timestamp\": \"2025-04-10T00:00:00Z\",\n \"granularity\": \"1h\",\n \"start_timestamp\": \"2025-04-01T00:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.allium.so/api/v1/developer/wallet/pnl/history")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"addresses\": [\n {\n \"address\": \"125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp\",\n \"chain\": \"solana\"\n }\n ],\n \"end_timestamp\": \"2025-04-10T00:00:00Z\",\n \"granularity\": \"1h\",\n \"start_timestamp\": \"2025-04-01T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/developer/wallet/pnl/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addresses\": [\n {\n \"address\": \"125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp\",\n \"chain\": \"solana\"\n }\n ],\n \"end_timestamp\": \"2025-04-10T00:00:00Z\",\n \"granularity\": \"1h\",\n \"start_timestamp\": \"2025-04-01T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana",
"pnl": [
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T22:00:00Z",
"unrealized_pnl": {
"amount": "0.145848378518889629",
"currency": "USD"
}
},
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T23:00:00Z",
"unrealized_pnl": {
"amount": "0.137894957302491137",
"currency": "USD"
}
}
]
},
"items": [
{
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana",
"pnl": [
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T22:00:00Z",
"unrealized_pnl": {
"amount": "0.145848378518889629",
"currency": "USD"
}
},
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T23:00:00Z",
"unrealized_pnl": {
"amount": "0.137894957302491137",
"currency": "USD"
}
}
]
}
],
"error": "<string>",
"cursor": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Holdings
Fetch historical PnL by Wallet
Get the Historical PnL for a given wallet address.
POST
/
api
/
v1
/
developer
/
wallet
/
pnl
/
history
Get Pnl History
curl --request POST \
--url https://api.allium.so/api/v1/developer/wallet/pnl/history \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"addresses": [
{
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana"
}
],
"end_timestamp": "2025-04-10T00:00:00Z",
"granularity": "1h",
"start_timestamp": "2025-04-01T00:00:00Z"
}
'import requests
url = "https://api.allium.so/api/v1/developer/wallet/pnl/history"
payload = {
"addresses": [
{
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana"
}
],
"end_timestamp": "2025-04-10T00:00:00Z",
"granularity": "1h",
"start_timestamp": "2025-04-01T00:00:00Z"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
addresses: [{address: '125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp', chain: 'solana'}],
end_timestamp: '2025-04-10T00:00:00Z',
granularity: '1h',
start_timestamp: '2025-04-01T00:00:00Z'
})
};
fetch('https://api.allium.so/api/v1/developer/wallet/pnl/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.allium.so/api/v1/developer/wallet/pnl/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'addresses' => [
[
'address' => '125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp',
'chain' => 'solana'
]
],
'end_timestamp' => '2025-04-10T00:00:00Z',
'granularity' => '1h',
'start_timestamp' => '2025-04-01T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.allium.so/api/v1/developer/wallet/pnl/history"
payload := strings.NewReader("{\n \"addresses\": [\n {\n \"address\": \"125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp\",\n \"chain\": \"solana\"\n }\n ],\n \"end_timestamp\": \"2025-04-10T00:00:00Z\",\n \"granularity\": \"1h\",\n \"start_timestamp\": \"2025-04-01T00:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.allium.so/api/v1/developer/wallet/pnl/history")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"addresses\": [\n {\n \"address\": \"125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp\",\n \"chain\": \"solana\"\n }\n ],\n \"end_timestamp\": \"2025-04-10T00:00:00Z\",\n \"granularity\": \"1h\",\n \"start_timestamp\": \"2025-04-01T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/developer/wallet/pnl/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addresses\": [\n {\n \"address\": \"125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp\",\n \"chain\": \"solana\"\n }\n ],\n \"end_timestamp\": \"2025-04-10T00:00:00Z\",\n \"granularity\": \"1h\",\n \"start_timestamp\": \"2025-04-01T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana",
"pnl": [
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T22:00:00Z",
"unrealized_pnl": {
"amount": "0.145848378518889629",
"currency": "USD"
}
},
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T23:00:00Z",
"unrealized_pnl": {
"amount": "0.137894957302491137",
"currency": "USD"
}
}
]
},
"items": [
{
"address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp",
"chain": "solana",
"pnl": [
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T22:00:00Z",
"unrealized_pnl": {
"amount": "0.145848378518889629",
"currency": "USD"
}
},
{
"realized_pnl": {
"amount": "0.002335373911312482",
"currency": "USD"
},
"timestamp": "2026-03-19T23:00:00Z",
"unrealized_pnl": {
"amount": "0.137894957302491137",
"currency": "USD"
}
}
]
}
],
"error": "<string>",
"cursor": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This endpoint provides unrealized and realized PnL for wallet addresses at specified time periods and granularities.
Time Range Parameters
start_timestamp- Beginning of the time range (inclusive)end_timestamp- End of the time range (exclusive)- Both timestamps are assumed to be in UTC if no timezone is specified
- All returned data is in UTC
Granularity Options
1d- Daily intervals1h- Hourly intervals5m- 5-minute intervals1m- 1-minute intervals15s- 15-second intervals
Granularity Constraints
The allowed granularity depends on the requested time range:| Time Range | Finest Granularity Allowed |
|---|---|
| 0 - 24 hours | 15s |
| 1 - 7 days | 5m |
| 1 week - 1 year | 1h |
| Over 1 year | 1d |
Supported Chains
Authorizations
Query Parameters
Minimum liquidity of which tokens must have to be included in the response.
Body
application/json
Start of time range (UTC ISO 8601)
End of time range (UTC ISO 8601)
Time interval granularity (1d, 1h, 5m, 1m, 15s)
Available options:
1h, 1d, 1m, 5m, 15s List of wallet chain+address pairs
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Response
Successful Response
Single item response data of type T
- HistoricalPnl
- PnlError
Show child attributes
Show child attributes
Example:
{ "address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp", "chain": "solana", "pnl": [ { "realized_pnl": { "amount": "0.002335373911312482", "currency": "USD" }, "timestamp": "2026-03-19T22:00:00Z", "unrealized_pnl": { "amount": "0.145848378518889629", "currency": "USD" } }, { "realized_pnl": { "amount": "0.002335373911312482", "currency": "USD" }, "timestamp": "2026-03-19T23:00:00Z", "unrealized_pnl": { "amount": "0.137894957302491137", "currency": "USD" } } ] }
Response items of type T
- HistoricalPnl
- PnlError
Show child attributes
Show child attributes
Example:
{ "address": "125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp", "chain": "solana", "pnl": [ { "realized_pnl": { "amount": "0.002335373911312482", "currency": "USD" }, "timestamp": "2026-03-19T22:00:00Z", "unrealized_pnl": { "amount": "0.145848378518889629", "currency": "USD" } }, { "realized_pnl": { "amount": "0.002335373911312482", "currency": "USD" }, "timestamp": "2026-03-19T23:00:00Z", "unrealized_pnl": { "amount": "0.137894957302491137", "currency": "USD" } } ] }
Error message
Pagination cursor for next page
Was this page helpful?
⌘I