Get Pnl
curl --request POST \
--url https://api.allium.so/api/v1/developer/wallet/pnl \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
[
{
"chain": "ethereum",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
{
"chain": "solana",
"address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
}
]
'import requests
url = "https://api.allium.so/api/v1/developer/wallet/pnl"
payload = [
{
"chain": "ethereum",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
{
"chain": "solana",
"address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
}
]
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([
{chain: 'ethereum', address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'},
{chain: 'solana', address: 'vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg'}
])
};
fetch('https://api.allium.so/api/v1/developer/wallet/pnl', 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",
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([
[
'chain' => 'ethereum',
'address' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
],
[
'chain' => 'solana',
'address' => 'vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg'
]
]),
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"
payload := strings.NewReader("[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"\n },\n {\n \"chain\": \"solana\",\n \"address\": \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\"\n }\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")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"\n },\n {\n \"chain\": \"solana\",\n \"address\": \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/developer/wallet/pnl")
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 {\n \"chain\": \"ethereum\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"\n },\n {\n \"chain\": \"solana\",\n \"address\": \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\"\n }\n]"
response = http.request(request)
puts response.read_body{
"data": {
"chain": "<string>",
"address": "<string>",
"tokens": [
{
"token_address": "<string>",
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"raw_balance": "<string>",
"current_price": {
"amount": "<string>",
"currency": "USD"
},
"current_balance": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl_ratio_change": 123,
"attributes": {
"total_liquidity_usd": {
"amount": 123,
"details": "<string>"
},
"price_diff_1d": 123,
"price_diff_pct_1d": 123,
"price_diff_1h": 123,
"price_diff_pct_1h": 123,
"total_supply": 123,
"fully_diluted_valuation_usd": 123,
"volume_1h": 123,
"volume_1d": 123,
"volume_usd_1h": 123,
"volume_usd_1d": 123,
"volume_24h": 123,
"volume_usd_24h": 123,
"trade_count_1h": 123,
"trade_count_1d": 123,
"all_time_high": 123,
"all_time_low": 123,
"image_url": "<string>",
"token_creation_time": "2023-11-07T05:31:56Z",
"holders_count": 123,
"stellar_fields": {}
},
"historical_breakdown": [
{
"trade": {
"token_address": "<string>",
"token_amount": "<string>",
"token_price_usd": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
}
}
]
}
],
"total_balance": {
"amount": "<string>",
"currency": "USD"
},
"total_realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl_ratio_change": 123
},
"items": [
{
"chain": "<string>",
"address": "<string>",
"tokens": [
{
"token_address": "<string>",
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"raw_balance": "<string>",
"current_price": {
"amount": "<string>",
"currency": "USD"
},
"current_balance": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl_ratio_change": 123,
"attributes": {
"total_liquidity_usd": {
"amount": 123,
"details": "<string>"
},
"price_diff_1d": 123,
"price_diff_pct_1d": 123,
"price_diff_1h": 123,
"price_diff_pct_1h": 123,
"total_supply": 123,
"fully_diluted_valuation_usd": 123,
"volume_1h": 123,
"volume_1d": 123,
"volume_usd_1h": 123,
"volume_usd_1d": 123,
"volume_24h": 123,
"volume_usd_24h": 123,
"trade_count_1h": 123,
"trade_count_1d": 123,
"all_time_high": 123,
"all_time_low": 123,
"image_url": "<string>",
"token_creation_time": "2023-11-07T05:31:56Z",
"holders_count": 123,
"stellar_fields": {}
},
"historical_breakdown": [
{
"trade": {
"token_address": "<string>",
"token_amount": "<string>",
"token_price_usd": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
}
}
]
}
],
"total_balance": {
"amount": "<string>",
"currency": "USD"
},
"total_realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl_ratio_change": 123
}
],
"error": "<string>",
"cursor": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Holdings
Fetch current PnL by Wallet
Get the PnL for a given wallet address.
POST
/
api
/
v1
/
developer
/
wallet
/
pnl
Get Pnl
curl --request POST \
--url https://api.allium.so/api/v1/developer/wallet/pnl \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
[
{
"chain": "ethereum",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
{
"chain": "solana",
"address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
}
]
'import requests
url = "https://api.allium.so/api/v1/developer/wallet/pnl"
payload = [
{
"chain": "ethereum",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
{
"chain": "solana",
"address": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"
}
]
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([
{chain: 'ethereum', address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'},
{chain: 'solana', address: 'vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg'}
])
};
fetch('https://api.allium.so/api/v1/developer/wallet/pnl', 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",
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([
[
'chain' => 'ethereum',
'address' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
],
[
'chain' => 'solana',
'address' => 'vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg'
]
]),
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"
payload := strings.NewReader("[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"\n },\n {\n \"chain\": \"solana\",\n \"address\": \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\"\n }\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")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"chain\": \"ethereum\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"\n },\n {\n \"chain\": \"solana\",\n \"address\": \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/developer/wallet/pnl")
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 {\n \"chain\": \"ethereum\",\n \"address\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"\n },\n {\n \"chain\": \"solana\",\n \"address\": \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\"\n }\n]"
response = http.request(request)
puts response.read_body{
"data": {
"chain": "<string>",
"address": "<string>",
"tokens": [
{
"token_address": "<string>",
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"raw_balance": "<string>",
"current_price": {
"amount": "<string>",
"currency": "USD"
},
"current_balance": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl_ratio_change": 123,
"attributes": {
"total_liquidity_usd": {
"amount": 123,
"details": "<string>"
},
"price_diff_1d": 123,
"price_diff_pct_1d": 123,
"price_diff_1h": 123,
"price_diff_pct_1h": 123,
"total_supply": 123,
"fully_diluted_valuation_usd": 123,
"volume_1h": 123,
"volume_1d": 123,
"volume_usd_1h": 123,
"volume_usd_1d": 123,
"volume_24h": 123,
"volume_usd_24h": 123,
"trade_count_1h": 123,
"trade_count_1d": 123,
"all_time_high": 123,
"all_time_low": 123,
"image_url": "<string>",
"token_creation_time": "2023-11-07T05:31:56Z",
"holders_count": 123,
"stellar_fields": {}
},
"historical_breakdown": [
{
"trade": {
"token_address": "<string>",
"token_amount": "<string>",
"token_price_usd": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
}
}
]
}
],
"total_balance": {
"amount": "<string>",
"currency": "USD"
},
"total_realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl_ratio_change": 123
},
"items": [
{
"chain": "<string>",
"address": "<string>",
"tokens": [
{
"token_address": "<string>",
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"raw_balance": "<string>",
"current_price": {
"amount": "<string>",
"currency": "USD"
},
"current_balance": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"unrealized_pnl_ratio_change": 123,
"attributes": {
"total_liquidity_usd": {
"amount": 123,
"details": "<string>"
},
"price_diff_1d": 123,
"price_diff_pct_1d": 123,
"price_diff_1h": 123,
"price_diff_pct_1h": 123,
"total_supply": 123,
"fully_diluted_valuation_usd": 123,
"volume_1h": 123,
"volume_1d": 123,
"volume_usd_1h": 123,
"volume_usd_1d": 123,
"volume_24h": 123,
"volume_usd_24h": 123,
"trade_count_1h": 123,
"trade_count_1d": 123,
"all_time_high": 123,
"all_time_low": 123,
"image_url": "<string>",
"token_creation_time": "2023-11-07T05:31:56Z",
"holders_count": 123,
"stellar_fields": {}
},
"historical_breakdown": [
{
"trade": {
"token_address": "<string>",
"token_amount": "<string>",
"token_price_usd": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"average_cost": {
"amount": "<string>",
"currency": "USD"
},
"realized_pnl": {
"amount": "<string>",
"currency": "USD"
}
}
]
}
],
"total_balance": {
"amount": "<string>",
"currency": "USD"
},
"total_realized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl": {
"amount": "<string>",
"currency": "USD"
},
"total_unrealized_pnl_ratio_change": 123
}
],
"error": "<string>",
"cursor": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This endpoint provides current PnL metrics for wallet addresses, including unrealized PnL, realized PnL, average cost, current balance, and current USD balance.
Supported Chains
Authorizations
Query Parameters
Minimum liquidity of which tokens must have to be included in the response.
Body
application/json
Response
Successful Response
Single item response data of type T
- PnlByWallet
- PnlError
Show child attributes
Show child attributes
Response items of type T
- PnlByWallet
- PnlError
Show child attributes
Show child attributes
Error message
Pagination cursor for next page
Was this page helpful?
⌘I