# GMGN Wallet Portfolio & PnL Tracker — Holdings & Profit (`logiover/gmgn-wallet-portfolio-pnl-tracker`) Actor

Track any wallet's complete portfolio across Solana, BSC, Ethereum, Base, Tron, Monad. Every token (current + past) with cost basis, realized/unrealized profit, holding period, transfer history, wallet tags. Plus per-period PnL (1d/7d/30d), native-token funding source. Zerion/DeBank alternative.

- **URL**: https://apify.com/logiover/gmgn-wallet-portfolio-pnl-tracker.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** Automation, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## GMGN Wallet Portfolio & PnL Tracker — Full Crypto Wallet Holdings, Profit & Loss, Holding Period

![GMGN Wallet Portfolio & PnL Tracker — Holdings & Profit](https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/GjS6nQ8qauOdq9KGy-actor-p6VOa2BUVFeSG548W-f5Ml2zg1L4-images.png)

**Track any crypto wallet's complete portfolio and PnL — across Solana, BSC, Ethereum, Base, Tron, and Monad.** For each wallet, get every token holding (current and historical) with cost basis, realized profit, unrealized profit, PnL multiplier, buy/sell counts, holding period, and transfer history. Plus a per-wallet summary (overall PnL, total USD value, winrate, balances per chain, wallet tags, Twitter link) and per-period PnL stats.

> The on-chain Zerion / DeBank alternative scraper. Pass a wallet, get its full crypto CV.

---

### 🚀 What this actor does

For each `(chain, walletAddress)` pair you submit, the actor:

1. Fetches the **full holdings list** with pagination (up to `maxHoldingsPerWallet`), each token row carrying cost basis, profit, transfer history, holding period.
2. (Optional) Fetches the **wallet summary** with overall PnL, balances, winrate, tags, Twitter / ENS, follower count.
3. (Optional) Fetches **per-period PnL stats** for `1d`, `7d`, `30d` — token count, winrate, realized / unrealized profit, volume.
4. (Optional) Fetches the **native funding source** — which wallet sent the first SOL/BNB/ETH to this wallet (key for insider / cluster detection).

The dataset emits one row per holding + one summary row + one row per requested PnL period + one funding row, all distinguished by `_kind`.

---

### 💡 Use cases

- **Copy-trade audit** — verify a candidate trader's claimed PnL by looking at their actual on-chain holdings.
- **Smart-money following** — see what every top wallet from the leaderboard currently holds.
- **Insider / cluster detection** — chain `nativeFromAddress` back through funding wallets to map insider networks.
- **DeBank / Zerion alternative** — display any wallet's portfolio in your own UI with rich PnL.
- **Crypto tax tools** — extract cost basis + realized profit per token for tax calculation pipelines.
- **Trader leaderboards** — verify Twitter trader claims against on-chain reality.
- **Influencer accountability** — public-figure wallets, audit their actual returns.
- **Memecoin alpha sourcing** — see which positions top wallets are loading up on right now.
- **Fund-flow forensics** — visualize how a wallet funded → bought → sold across time.

---

### ⚙️ Input configuration

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `wallets` | `array` | required | Array of `{ chain, address }`. |
| `maxHoldingsPerWallet` | `integer` | `200` | Cap holdings paginated per wallet. |
| `orderBy` | `string` | `"last_active_timestamp"` | `last_active_timestamp`, `total_profit`, `total_value`, `balance`, `buys`, `sells` |
| `direction` | `string` | `"desc"` | `desc` or `asc` |
| `hideSmall` | `boolean` | `false` | Drop dust positions. |
| `sellout` | `boolean` | `true` | Include fully-sold positions (lifetime history). |
| `hideAbnormal` | `boolean` | `false` | Drop honeypot / blacklisted tokens. |
| `includeWalletSummary` | `boolean` | `true` | Emit a `wallet_summary` row per wallet. |
| `includePnlPeriods` | `string[]` | `["7d"]` | Emit `pnl_period` row per chosen period (`1d`, `7d`, `30d`). |
| `includeNativeTransfers` | `boolean` | `false` | Emit `native_funding` row with funding-source wallet. |
| `minTotalValueUsd` | `number` | `0` | Drop holdings below this USD value. |
| `useProxy` | `boolean` | `true` | |
| `proxyConfiguration` | `object` | residential | |
| `maxConcurrency` | `integer` | `5` | |

---

### 📦 Output rows (distinguished by `_kind`)

#### 1. `holding` (one per token the wallet held)
- `tokenAddress`, `tokenSymbol`, `tokenName`, `tokenLogo`, `tokenDecimals`
- `balance`, `totalValue`, `totalFee`, `buys`, `sells`, `isOpenOrClose`
- `totalProfit`, `totalProfitPnl`, `realizedProfit`, `realizedPnl`, `unrealizedProfit`, `unrealizedPnl`
- `historyBoughtCost`, `historyBoughtAmount`, `historySoldIncome`, `historyTransferInCost`, `historyTransferInAmount`, `historyTransferOutIncome`, `historyTransferOutAmount`
- `avgHoldingPeriod`, `startHoldingAt`, `endHoldingAt`, `lastActiveTimestamp`
- `makerTokenTags` — per-token wallet tags (e.g. `creator`, `dev_team`, `sniper`, `fresh_wallet`)
- `statLastHoldAt`, `statWinRate7d`, `statRealizedProfit7d`, `statRealizedPnl7d`, `statBuy7d`, `statSell7d`, `statTokenNum`
- `followCount`, `remarkCount`
- `gmgnWalletUrl`, `gmgnTokenUrl`

#### 2. `wallet_summary` (one per wallet)
- Identity: `walletEns`, `walletAvatar`, `walletName`, `walletTwitterUsername`, `walletTwitterName`, `walletTwitterBind`, `walletTwitterFans`, `walletFollowersCount`, `walletIsBlueVerified`
- Balances: `walletEthBalance`, `walletSolBalance`, `walletTrxBalance`, `walletBnbBalance`, `walletBalance`, `walletTotalValue`
- PnL: `unrealizedProfit`, `unrealizedPnl`, `realizedProfit`, `pnl`, `pnl1d`, `pnl7d`, `pnl30d`, `realizedProfit1d`, `realizedProfit7d`, `realizedProfit30d`, `winrate`, `allPnl`, `totalProfit`, `totalProfitPnl`
- Activity: `buy`, `buy1d`, `buy7d`, `buy30d`, `sell`, `sell1d`, `sell7d`, `sell30d`
- History totals: `historyBoughtCost`, `tokenAvgCost`, `tokenSoldAvgProfit`, `tokenNum`, `profitNum`
- 7-day PnL buckets: `pnlLtMinusDot5Num`, `pnlMinusDot50xNum`, `pnlLt2xNum`, `pnl2x5xNum`, `pnlGt5xNum`
- `avgHoldingPeriod`, `lastActiveTimestamp`
- Tags: `walletTags`, `walletTagRank`, `refreshRequestedAt`, `updatedAt`

#### 3. `pnl_period` (one per (wallet, period))
- `period` (`1d` / `7d` / `30d`)
- `periodTokenNum`, `periodTokenProfitNum`, `periodWinRate`, `periodPnl`
- `periodRealizedProfit`, `periodUnrealizedProfit`, `periodTotalProfit`, `periodTotalProfitPnl`, `periodVolume`

#### 4. `native_funding` (one per wallet — only when `includeNativeTransfers: true`)
- `nativeFromAddress` — the wallet that funded this one with native token
- `nativeAmount`, `nativeTransferAt`, `nativeFundTxHash`
- `nativeTwitterUsername`, `nativeNickname`
- `gmgnFundingWalletUrl` — convenience link to chase the funding chain

---

### 🧪 Example output (holding row)

```json
{
  "_kind": "holding",
  "chain": "sol",
  "walletAddress": "923yorRvuaL9zFTGkSWhN2DkGXRBjPLiAsN9AzFHk68j",
  "tokenAddress": "5jvjr...pump",
  "tokenSymbol": "WIF",
  "balance": 1473847721.14,
  "totalValue": 4830.03,
  "buys": 133,
  "sells": 0,
  "totalProfit": 3416.58,
  "totalProfitPnl": 2.88,
  "historyBoughtCost": 1115.58,
  "historyBoughtAmount": 1382641929.65,
  "historySoldIncome": 0,
  "avgHoldingPeriod": 9765.96,
  "startHoldingAt": "2026-05-14T08:00:13.000Z",
  "lastActiveTimestamp": null,
  "makerTokenTags": ["creator", "dev_team", "sniper"],
  "statWinRate7d": 0.28,
  "statRealizedProfit7d": -1188.54,
  "statBuy7d": 612,
  "statSell7d": 30,
  "gmgnWalletUrl": "https://gmgn.ai/sol/address/923yorRvuaL9zFTGkSWhN2DkGXRBjPLiAsN9AzFHk68j",
  "gmgnTokenUrl": "https://gmgn.ai/sol/token/5jvjr...pump",
  "scrapedAt": "2026-05-15T12:00:00.000Z"
}
````

***

### 🧰 Recipes

#### 1. Full portfolio dump for one wallet

```json
{
  "wallets": [{ "chain": "sol", "address": "..." }],
  "maxHoldingsPerWallet": 500,
  "includeWalletSummary": true,
  "includePnlPeriods": ["1d", "7d", "30d"],
  "includeNativeTransfers": true
}
```

#### 2. Watchlist daily snapshot

```json
{
  "wallets": [/* 20 wallets */],
  "maxHoldingsPerWallet": 100,
  "includeWalletSummary": true,
  "minTotalValueUsd": 10
}
```

Daily wallet-portfolio snapshots. Diff against yesterday for movement detection.

#### 3. Cluster discovery via native funding

```json
{
  "wallets": [...],
  "maxHoldingsPerWallet": 50,
  "includeNativeTransfers": true
}
```

For each wallet, `nativeFromAddress` reveals who funded it — follow the chain to map clusters.

#### 4. Copy-trade audit

```json
{
  "wallets": [{ "chain": "sol", "address": "TRADER_WALLET" }],
  "includePnlPeriods": ["1d", "7d", "30d"],
  "maxHoldingsPerWallet": 200,
  "sellout": true
}
```

Realized vs unrealized split — is the trader actually profitable, or just sitting on paper gains?

#### 5. Tax export

```json
{
  "wallets": [{ "chain": "eth", "address": "MY_WALLET" }],
  "maxHoldingsPerWallet": 1000,
  "sellout": true,
  "hideSmall": false
}
```

Then export the dataset to CSV → import into your tax tool.

***

### 🛡️ Under the hood

- **Endpoints** —
  - `GET /pf/api/v1/wallet/{chain}/{addr}/holdings?limit=50&order_by=...&direction=...&hide_small=...&sellout=...&hide_abnormal=...` (paginated)
  - `GET /defi/quotation/v1/smartmoney/{chain}/walletNew/{addr}` (summary — already contains per-period PnL: pnl1d/7d/30d, realizedProfit1d/7d/30d, winrate1d/7d/30d, volume1d/7d/30d)
  - `POST /pf/api/v1/wallets/{chain}/person_wallets_pnl_info/{period}` `{ wallet_addresses: [...] }` (advanced, opt-in — same period stats as summary; only enable if you need `token_num` or `total_profit_pnl` fields)
  - `GET /api/v1/native_transfer/{chain}/{addr}` (funding source)
- **Pagination** — GMGN's `next` cursor; the actor follows it until `maxHoldingsPerWallet`.
- **Auth** — none.
- **Proxy** — Apify Residential default.
- **Retries** — 5 attempts with exponential backoff on 403 / 429 / 5xx.

***

### ⚡ Performance

| Configuration | Rows | Time | Cost |
|--------------|------|------|------|
| 1 wallet, summary + 200 holdings | ~205 | <30s | <$0.01 |
| 10 wallets, full portfolio + all periods | ~2K | ~1-2 min | ~$0.04 |
| 100 wallets, 100 holdings each | ~10K | ~10 min | ~$0.20 |

***

### 📅 Recommended schedules

- **Daily wallet watch** — once per day for your tracked wallets.
- **Live copy-trade source** — every 15-30 minutes for tight copy-trading.
- **Weekly research export** — once per week for monthly portfolio reports.

***

### ❓ FAQ

#### What's the difference between `pnl` and `totalProfitPnl`?

`pnl` = realized profit multiplier (across the wallet's lifetime). `totalProfitPnl` per holding = total profit ÷ total cost on THAT token.

#### Why is `totalValue` sometimes lower than `historyBoughtCost`?

The wallet is sitting on losses (token price dropped). `unrealizedProfit` will be negative.

#### What's `avgHoldingPeriod`?

Average seconds the wallet holds a position. Shorter = scalper / sniper. Longer = swing / diamond hands.

#### What's `makerTokenTags` on a holding?

Per-token roles for this wallet — `creator`, `dev_team`, `sniper`, `fresh_wallet`, `whale`. Different from the wallet's GLOBAL tags.

#### Can I use this to detect insider activity?

Yes. Combine `makerTokenTags: ["sniper"]` + `walletTags: ["fresh_wallet"]` + `realizedProfit > 0` = fresh wallet sniped early, made profit → strong insider signal.

#### How fresh is the PnL data?

GMGN recomputes wallet PnL every ~5 minutes. The actor pulls whatever's current.

#### How does this differ from the Smart Money Wallet Leaderboard?

Leaderboard = TOP-N WALLETS on a chain. This = DEEP DIVE on specific wallets. Use leaderboard to discover, this to investigate.

#### Does it work for non-public wallets?

Yes — any on-chain address. The wallet doesn't need to be linked to a Twitter or have a GMGN profile.

#### Can I get historical position values?

Each `holding` row carries `historyBoughtCost`, `historyBoughtAmount`, `historySoldIncome`, `startHoldingAt`, `endHoldingAt` — a compressed lifetime history.

#### What's `pnlGt5xNum`?

Number of tokens in the wallet's history that returned more than 5×. Higher = more home runs.

#### How do I detect wash trading?

Self-funded transfers + same-side high-frequency trades. Pull `historyTransferIn*` + check if `nativeFromAddress` is one of the wallet's other addresses.

#### Can I scrape Ethereum smart contracts (vaults / safes)?

Yes — pass the contract address as the wallet. Results may include LP positions and vault tokens.

#### What does `walletTagRank` contain?

GMGN's internal rank for each tag (e.g. `{"smart_degen": 47}` means this wallet is #47 in the smart\_degen tag).

***

### 🔗 Related actors

- **GMGN Smart Money Wallet Leaderboard** — discover top wallets to track.
- **GMGN Smart Money Buy Signals** — live whale buy feed.
- **GMGN Token Holders Intelligence** — see who holds a specific token (reverse view).
- **GMGN Trending Memecoin Scanner** — what's heating up.
- **GMGN New Token Launch Detector** — fresh launches.
- **GMGN Token Rugcheck & Deep Analytics** — security per token.
- **GMGN Crypto KOL Twitter & Telegram Signal Feed** — KOL chatter.

***

### 🆘 Support

Bug? Missing field? Open an issue on the actor's Apify page.

# Actor input Schema

## `wallets` (type: `array`):

List of wallets to track. Each entry: `{ chain, address }`. Up to 100 wallets per run. Chain: sol, bsc, eth, base, tron, monad.

## `maxHoldingsPerWallet` (type: `integer`):

How many tokens per wallet to fetch. GMGN's pagination returns 50 per page — the actor follows the `next` cursor up to this cap.

## `orderBy` (type: `string`):

Field to sort by before truncation. Pick the metric that best matches your use case.

## `direction` (type: `string`):

Sort direction. desc = highest first (default, matches the source UI). asc = lowest first — useful for hunting unfamiliar entries.

## `hideSmall` (type: `boolean`):

Drop dust positions (GMGN-defined threshold ~$0.1).

## `sellout` (type: `boolean`):

Include tokens the wallet has fully sold (balance=0). Useful for full lifetime history.

## `hideAbnormal` (type: `boolean`):

Drop tokens flagged by GMGN as honeypots / blacklisted.

## `includeWalletSummary` (type: `boolean`):

Emit one extra row per wallet with overall PnL, total value, winrate, balances per chain, tags, Twitter linked status.

## `includePnlPeriods` (type: `array`):

Fetch per-period PnL detail rows from the auth-gated /person\_wallets\_pnl\_info endpoint. NOTE: same period stats (pnl1d/7d/30d, realizedProfit1d/7d/30d, winrate1d/7d/30d, volume1d/7d/30d) are already returned in the wallet\_summary row without this option. Leave empty unless you need the extra fields (token\_num, total\_profit\_pnl).

## `includeNativeTransfers` (type: `boolean`):

Fetch /native\_transfer to find which wallet funded this one (key for insider / cluster detection).

## `minTotalValueUsd` (type: `number`):

Drop rows whose total USD value is below this threshold. Default 0 = no filter.

## `useProxy` (type: `boolean`):

Route requests through Apify Proxy. Strongly recommended ON — residential proxy is the most reliable way to bypass Cloudflare rate limits.

## `proxyConfiguration` (type: `object`):

Apify Proxy configuration. Residential proxy group is recommended for the highest success rate against Cloudflare.

## `maxConcurrency` (type: `integer`):

Maximum number of API calls running in parallel. Higher = faster runs but more chance of hitting rate limits. 3-5 is safe.

## Actor input object example

```json
{
  "wallets": [
    {
      "chain": "sol",
      "address": "Hf8NZnnPh8RabWVDrvUeA2iSFQP6d1GWKmtApyV9kdVf"
    },
    {
      "chain": "bsc",
      "address": "0x2ce9d43d1cba6ae31d7f07bfe0098dfa2d833373"
    }
  ],
  "maxHoldingsPerWallet": 200,
  "orderBy": "last_active_timestamp",
  "direction": "desc",
  "hideSmall": false,
  "sellout": true,
  "hideAbnormal": false,
  "includeWalletSummary": true,
  "includePnlPeriods": [],
  "includeNativeTransfers": false,
  "minTotalValueUsd": 0,
  "useProxy": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 5
}
```

# Actor output Schema

## `_kind` (type: `string`):

holding / wallet\_summary / pnl\_period / native\_funding

## `chain` (type: `string`):

Blockchain slug

## `walletAddress` (type: `string`):

Wallet address

## `tokenAddress` (type: `string`):

Token contract (holding rows)

## `tokenSymbol` (type: `string`):

Token symbol

## `tokenName` (type: `string`):

Token name

## `balance` (type: `string`):

Token balance

## `totalValue` (type: `string`):

Position value USD

## `buys` (type: `string`):

Buy count for this token

## `sells` (type: `string`):

Sell count for this token

## `totalProfit` (type: `string`):

Total profit on this token

## `totalProfitPnl` (type: `string`):

Total profit ÷ total cost

## `historyBoughtCost` (type: `string`):

Lifetime cost of buys

## `historySoldIncome` (type: `string`):

Lifetime income from sells

## `avgHoldingPeriod` (type: `string`):

Average holding period seconds

## `startHoldingAt` (type: `string`):

ISO time first acquired

## `endHoldingAt` (type: `string`):

ISO time fully exited

## `makerTokenTags` (type: `string`):

Per-token wallet roles

## `walletTags` (type: `string`):

Wallet global tags

## `walletTwitterUsername` (type: `string`):

Linked Twitter handle

## `walletTotalValue` (type: `string`):

Wallet total USD (summary row)

## `pnl1d` (type: `string`):

Overall 1d PnL multiplier

## `pnl7d` (type: `string`):

Overall 7d PnL multiplier

## `pnl30d` (type: `string`):

Overall 30d PnL multiplier

## `winrate` (type: `string`):

Overall winrate

## `tokenNum` (type: `string`):

Distinct tokens touched

## `period` (type: `string`):

1d / 7d / 30d (pnl\_period rows)

## `periodPnl` (type: `string`):

PnL for the period

## `periodRealizedProfit` (type: `string`):

Realized profit for the period

## `periodVolume` (type: `string`):

Volume for the period

## `nativeFromAddress` (type: `string`):

Wallet that funded with native token

## `nativeAmount` (type: `string`):

Native funding amount

## `nativeTransferAt` (type: `string`):

ISO time of native funding

## `gmgnWalletUrl` (type: `string`):

GMGN wallet page

## `gmgnTokenUrl` (type: `string`):

GMGN token page

## `scrapedAt` (type: `string`):

Scrape timestamp

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "wallets": [
        {
            "chain": "sol",
            "address": "Hf8NZnnPh8RabWVDrvUeA2iSFQP6d1GWKmtApyV9kdVf"
        },
        {
            "chain": "bsc",
            "address": "0x2ce9d43d1cba6ae31d7f07bfe0098dfa2d833373"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/gmgn-wallet-portfolio-pnl-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "wallets": [
        {
            "chain": "sol",
            "address": "Hf8NZnnPh8RabWVDrvUeA2iSFQP6d1GWKmtApyV9kdVf",
        },
        {
            "chain": "bsc",
            "address": "0x2ce9d43d1cba6ae31d7f07bfe0098dfa2d833373",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("logiover/gmgn-wallet-portfolio-pnl-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "wallets": [
    {
      "chain": "sol",
      "address": "Hf8NZnnPh8RabWVDrvUeA2iSFQP6d1GWKmtApyV9kdVf"
    },
    {
      "chain": "bsc",
      "address": "0x2ce9d43d1cba6ae31d7f07bfe0098dfa2d833373"
    }
  ]
}' |
apify call logiover/gmgn-wallet-portfolio-pnl-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=logiover/gmgn-wallet-portfolio-pnl-tracker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "GMGN Wallet Portfolio & PnL Tracker — Holdings & Profit",
        "description": "Track any wallet's complete portfolio across Solana, BSC, Ethereum, Base, Tron, Monad. Every token (current + past) with cost basis, realized/unrealized profit, holding period, transfer history, wallet tags. Plus per-period PnL (1d/7d/30d), native-token funding source. Zerion/DeBank alternative.",
        "version": "1.0",
        "x-build-id": "DKgy57b208HbR5Ifd"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/logiover~gmgn-wallet-portfolio-pnl-tracker/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-logiover-gmgn-wallet-portfolio-pnl-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/logiover~gmgn-wallet-portfolio-pnl-tracker/runs": {
            "post": {
                "operationId": "runs-sync-logiover-gmgn-wallet-portfolio-pnl-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/logiover~gmgn-wallet-portfolio-pnl-tracker/run-sync": {
            "post": {
                "operationId": "run-sync-logiover-gmgn-wallet-portfolio-pnl-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "wallets"
                ],
                "properties": {
                    "wallets": {
                        "title": "Wallets",
                        "type": "array",
                        "description": "List of wallets to track. Each entry: `{ chain, address }`. Up to 100 wallets per run. Chain: sol, bsc, eth, base, tron, monad."
                    },
                    "maxHoldingsPerWallet": {
                        "title": "Max Holdings per Wallet",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "How many tokens per wallet to fetch. GMGN's pagination returns 50 per page — the actor follows the `next` cursor up to this cap.",
                        "default": 200
                    },
                    "orderBy": {
                        "title": "Holdings Order By",
                        "enum": [
                            "last_active_timestamp",
                            "total_profit",
                            "total_value",
                            "balance",
                            "buys",
                            "sells"
                        ],
                        "type": "string",
                        "description": "Field to sort by before truncation. Pick the metric that best matches your use case.",
                        "default": "last_active_timestamp"
                    },
                    "direction": {
                        "title": "Direction",
                        "enum": [
                            "desc",
                            "asc"
                        ],
                        "type": "string",
                        "description": "Sort direction. desc = highest first (default, matches the source UI). asc = lowest first — useful for hunting unfamiliar entries.",
                        "default": "desc"
                    },
                    "hideSmall": {
                        "title": "Hide Small Holdings",
                        "type": "boolean",
                        "description": "Drop dust positions (GMGN-defined threshold ~$0.1).",
                        "default": false
                    },
                    "sellout": {
                        "title": "Include Sold-Out Positions",
                        "type": "boolean",
                        "description": "Include tokens the wallet has fully sold (balance=0). Useful for full lifetime history.",
                        "default": true
                    },
                    "hideAbnormal": {
                        "title": "Hide Abnormal Tokens",
                        "type": "boolean",
                        "description": "Drop tokens flagged by GMGN as honeypots / blacklisted.",
                        "default": false
                    },
                    "includeWalletSummary": {
                        "title": "Include Wallet Summary",
                        "type": "boolean",
                        "description": "Emit one extra row per wallet with overall PnL, total value, winrate, balances per chain, tags, Twitter linked status.",
                        "default": true
                    },
                    "includePnlPeriods": {
                        "title": "Include PnL Periods (advanced)",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Fetch per-period PnL detail rows from the auth-gated /person_wallets_pnl_info endpoint. NOTE: same period stats (pnl1d/7d/30d, realizedProfit1d/7d/30d, winrate1d/7d/30d, volume1d/7d/30d) are already returned in the wallet_summary row without this option. Leave empty unless you need the extra fields (token_num, total_profit_pnl).",
                        "items": {
                            "type": "string",
                            "enum": [
                                "1d",
                                "7d",
                                "30d"
                            ],
                            "enumTitles": [
                                "1 day",
                                "7 days",
                                "30 days"
                            ]
                        },
                        "default": []
                    },
                    "includeNativeTransfers": {
                        "title": "Include Native Transfer Source",
                        "type": "boolean",
                        "description": "Fetch /native_transfer to find which wallet funded this one (key for insider / cluster detection).",
                        "default": false
                    },
                    "minTotalValueUsd": {
                        "title": "Minimum Total Value (USD)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Drop rows whose total USD value is below this threshold. Default 0 = no filter.",
                        "default": 0
                    },
                    "useProxy": {
                        "title": "Use Apify Proxy",
                        "type": "boolean",
                        "description": "Route requests through Apify Proxy. Strongly recommended ON — residential proxy is the most reliable way to bypass Cloudflare rate limits.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Apify Proxy configuration. Residential proxy group is recommended for the highest success rate against Cloudflare.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrent Requests",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of API calls running in parallel. Higher = faster runs but more chance of hitting rate limits. 3-5 is safe.",
                        "default": 5
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
