Get per-token profitability for a wallet across multiple chains.
curl --request GET \
--url https://api.moralis.com/v1/wallets/{walletAddress}/pnl \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/wallets/{walletAddress}/pnl"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/wallets/{walletAddress}/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.moralis.com/v1/wallets/{walletAddress}/pnl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/wallets/{walletAddress}/pnl"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.moralis.com/v1/wallets/{walletAddress}/pnl")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/wallets/{walletAddress}/pnl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"syncedAt": {
"0x1": 1710000000,
"solana-mainnet": "latest"
},
"unsupportedChains": [
"0x89"
],
"failedChains": [
"0x89"
]
},
"result": [
{
"chain": "0x1",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2BD9e",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"totalTokensBought": 100,
"totalTokensSold": 50,
"totalBoughtVolumeUsd": 150,
"totalSoldVolumeUsd": 100,
"totalTrades": 10,
"totalBuys": 5,
"totalSells": 5,
"avgBuyPriceUsd": 1.5,
"avgSellPriceUsd": 2,
"avgCostOfQuantitySold": 75,
"remainingBalance": 50,
"currentPriceUsd": 2.1,
"realizedProfitUsd": 25,
"realizedProfitPercentage": 16.66,
"unrealizedProfitUsd": 5,
"unrealizedProfitPercentage": 3.33,
"totalPnlUsd": 30,
"totalPnlPercentage": 20,
"roi": 0.2,
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18,
"logo": "<string>",
"possibleSpam": false,
"verifiedContract": true,
"securityScore": 95
}
],
"cursor": "<string>",
"limit": 100
}PnL API
Wallet PnL
Per-token profitability rows for a wallet, including realized and unrealized PnL, ROI, volumes, and trade counts.
GET
/
v1
/
wallets
/
{walletAddress}
/
pnl
Get per-token profitability for a wallet across multiple chains.
curl --request GET \
--url https://api.moralis.com/v1/wallets/{walletAddress}/pnl \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/wallets/{walletAddress}/pnl"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.moralis.com/v1/wallets/{walletAddress}/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.moralis.com/v1/wallets/{walletAddress}/pnl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.moralis.com/v1/wallets/{walletAddress}/pnl"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.moralis.com/v1/wallets/{walletAddress}/pnl")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/wallets/{walletAddress}/pnl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"meta": {
"syncedAt": {
"0x1": 1710000000,
"solana-mainnet": "latest"
},
"unsupportedChains": [
"0x89"
],
"failedChains": [
"0x89"
]
},
"result": [
{
"chain": "0x1",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2BD9e",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"totalTokensBought": 100,
"totalTokensSold": 50,
"totalBoughtVolumeUsd": 150,
"totalSoldVolumeUsd": 100,
"totalTrades": 10,
"totalBuys": 5,
"totalSells": 5,
"avgBuyPriceUsd": 1.5,
"avgSellPriceUsd": 2,
"avgCostOfQuantitySold": 75,
"remainingBalance": 50,
"currentPriceUsd": 2.1,
"realizedProfitUsd": 25,
"realizedProfitPercentage": 16.66,
"unrealizedProfitUsd": 5,
"unrealizedProfitPercentage": 3.33,
"totalPnlUsd": 30,
"totalPnlPercentage": 20,
"roi": 0.2,
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18,
"logo": "<string>",
"possibleSpam": false,
"verifiedContract": true,
"securityScore": 95
}
],
"cursor": "<string>",
"limit": 100
}This is the multi-chain successor to the legacy Deep Index Wallet PnL Breakdown endpoint. Pass multiple
chains (or mainnets) to get per-token profitability across chains in a single request.Authorizations
Path Parameters
The address
Query Parameters
Chains to query
Available options:
0x1, ethereum, 0x171, pulse, 0x2105, base, 0x38, binance, 0x89, polygon, 0xa, optimism, 0xa86a, avalanche, all, mainnets Filter to specific token addresses. A single value is coerced to a one-element array. Omit to return all tokens.
Period (e.g. 7d, 30d, all). Ignored when fromTimestamp/toTimestamp are provided.
Example:
"7d"
From timestamp in ms.
To timestamp in ms.
Required range:
x >= 1Encoded v2 cursor (JWT).
Available options:
realizedPnl, unrealizedPnl, totalPnl, volume, tradeCount Required range:
x >= 0Required range:
x >= 0
