Get the top traders for a token on a single chain.
curl --request GET \
--url https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders"
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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders', 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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders",
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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders"
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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders")
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": 19800000
}
},
"token": {
"chain": "0x1",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"possibleSpam": true,
"verifiedContract": true,
"securityScore": 123,
"currentPriceUsd": 123
},
"result": [
{
"walletAddress": "0xWallet",
"totalTokensBought": 123,
"totalTokensSold": 123,
"totalBoughtVolumeUsd": 123,
"totalSoldVolumeUsd": 123,
"totalTrades": 123,
"avgBuyPriceUsd": 123,
"avgSellPriceUsd": 123,
"avgCostOfQuantitySold": 123,
"realizedProfitUsd": 123,
"realizedProfitPercentage": 123,
"unrealizedProfitUsd": 123,
"totalPnlUsd": 123,
"totalPnlPercentage": 123,
"roi": 123
}
],
"cursor": "<string>",
"limit": 100
}PnL API
Top Traders by Token
Leaderboard of top traders for a (chain, token) pair, ranked by a selectable PnL metric, with per-trader volumes and realized/unrealized profit.
GET
/
v1
/
chains
/
{chainAlias}
/
tokens
/
{tokenAddress}
/
top-traders
Get the top traders for a token on a single chain.
curl --request GET \
--url https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders"
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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders', 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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders",
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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders"
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/chains/{chainAlias}/tokens/{tokenAddress}/top-traders")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moralis.com/v1/chains/{chainAlias}/tokens/{tokenAddress}/top-traders")
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": 19800000
}
},
"token": {
"chain": "0x1",
"tokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"possibleSpam": true,
"verifiedContract": true,
"securityScore": 123,
"currentPriceUsd": 123
},
"result": [
{
"walletAddress": "0xWallet",
"totalTokensBought": 123,
"totalTokensSold": 123,
"totalBoughtVolumeUsd": 123,
"totalSoldVolumeUsd": 123,
"totalTrades": 123,
"avgBuyPriceUsd": 123,
"avgSellPriceUsd": 123,
"avgCostOfQuantitySold": 123,
"realizedProfitUsd": 123,
"realizedProfitPercentage": 123,
"unrealizedProfitUsd": 123,
"totalPnlUsd": 123,
"totalPnlPercentage": 123,
"roi": 123
}
],
"cursor": "<string>",
"limit": 100
}This is the successor to the legacy Deep Index Top Traders by Token endpoint, with a selectable ranking metric (
sortBy) and low-liquidity, volume, and trade-count filters.Authorizations
Path Parameters
The alias of the chain.
Available options:
0x1, ethereum, 0x171, pulse, 0x2105, base, 0x38, binance, 0x89, polygon, 0xa, optimism, 0xa86a, avalanche The address
Query Parameters
Required range:
x >= 1Encoded v2 cursor (JWT).
Available options:
realizedPnl, unrealizedPnl, totalPnl, volume, tradeCount Required range:
x >= 0Required range:
x >= 0
