Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get Wallet PnL Breakdown

GEThttps://deep-index.moralis.io/api/v2.2/wallets/:address/profitability

Retrieves profitability information for a specific wallet address. Can be filtered by one or more tokens.

PATH PARAMS
addressstringrequired
The wallet address for which profitability is to be retrieved.
QUERY PARAMS
daysstring
Timeframe in days for which profitability is calculated, Options include 'all', '7', '30', '60', '90' default is 'all'.
chainstring
The chain to query
token_addressesarray
The token addresses list to filter the result with
No items in the array
Responses
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.EvmApi.wallets.getWalletProfitability({
"chain": "0x1",
"address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
});

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"result": {
"token_address": "",
"avg_buy_price_usd": "",
"avg_sell_price_usd": "",
"total_usd_invested": "",
"total_tokens_sold": "",
"total_tokens_bought": "",
"total_sold_usd": "",
"avg_cost_of_quantity_sold": "",
"count_of_trades": 1,
"realized_profit_usd": "",
"realized_profit_percentage": 1,
"total_buys": 1,
"total_sells": 1,
"name": "",
"symbol": "",
"decimals": "",
"logo": "",
"logo_hash": "",
"thumbnail": "",
"possible_spam": true
}
}