# Crypto Whale Tracker: Large DEX Trades on 5 EVM Chains (`lx112/onchain-whale-trades`) Actor

Large buys and sells of any ERC-20 over the last N minutes on Base, Ethereum, Arbitrum, Optimism or Polygon, read live from DEX swap events: USD size, side, wallet and transaction, buy/sell volume, net flow, and top net buyers and sellers.

- **URL**: https://apify.com/lx112/onchain-whale-trades.md
- **Developed by:** [leo xing](https://apify.com/lx112) (community)
- **Categories:** Developer tools, Automation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 token reports

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Onchain Whale Trades Tracker

See who is buying and selling a token in size, right now. For any ERC-20 on **Base, Ethereum,
Arbitrum, Optimism or Polygon**, this actor reads the token's DEX swaps over the last N minutes
and returns:

- **Totals:** number of trades, buys vs sells, buy and sell volume in USD, net flow
- **Large trades:** side, USD size, token and quote amounts, wallet, transaction hash and time
- **Top net buyers and sellers** among the largest trades

Data is read live from the blockchain (Uniswap v3, plus Aerodrome on Base and Velodrome on
Optimism, against the wrapped native token or USDC), priced with Chainlink. No API keys needed.

### Input

| Field | Example | Notes |
|---|---|---|
| Chain | `base` | base, eth, arbitrum, optimism, polygon |
| Token contract addresses | `0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed` | one report per token |
| Look-back window | `60` | 5 to 240 minutes; capped at 12,000 blocks (about 50 minutes on Arbitrum) |
| Minimum trade size (USD) | `1000` | filters the listed trades only; totals include everything |
| Max trades listed | `20` | 1 to 40 |

### Output (one dataset item per token)

```json
{
  "chain": "eth",
  "token": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
  "symbol": "UNI",
  "trades": 26,
  "buys": 7,
  "sells": 19,
  "buyVolumeUsd": 775.7,
  "sellVolumeUsd": 53210.7,
  "netFlowUsd": -52435,
  "largestTradeUsd": 12127.7,
  "largeTrades": [
    { "side": "sell", "usd": 12127.7, "tokenAmount": 1716.84, "quoteAmount": 5.05, "quoteSymbol": "WETH",
      "wallet": "0xd5a809D6dbEe62A34Cf4106080C6e04B8d9ce285", "tx": "0x2549…", "approxTime": "2026-10-22T15:58:11.000Z", "dex": "uniswap-v3" }
  ],
  "topBuyers": [], "topSellers": []
}
```

### Pricing

Pay per event: you're charged once per **token report** that completes. Invalid addresses and
failed chain reads are not charged.

### Good to know

- Trades are taken from the token's 3 deepest WETH/USDC (or WPOL/USDC) pools. Trades routed only
  through other pairs aren't counted.
- "Wallet" is the transaction sender, looked up for the 40 largest trades.
- This is factual onchain data, not trading or investment advice.

# Actor input Schema

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

Blockchain the tokens live on.

## `tokens` (type: `array`):

ERC-20 token addresses on the selected chain. One report per token.

## `minutes` (type: `integer`):

How far back to scan. Capped at 12,000 blocks per token (4 hours on Base, OP and Polygon; about 50 minutes on Arbitrum).

## `minUsd` (type: `integer`):

Only list trades at least this large. Totals always include every trade.

## `maxTradesPerToken` (type: `integer`):

How many of the largest trades to list for each token.

## Actor input object example

```json
{
  "chain": "base",
  "tokens": [
    "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed"
  ],
  "minutes": 60,
  "minUsd": 1000,
  "maxTradesPerToken": 20
}
```

# Actor output Schema

## `results` (type: `string`):

One report per token: totals, buy/sell volume, net flow, largest trades with wallets, top buyers and sellers.

# 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 = {
    "tokens": [
        "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lx112/onchain-whale-trades").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 = { "tokens": ["0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed"] }

# Run the Actor and wait for it to finish
run = client.actor("lx112/onchain-whale-trades").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "tokens": [
    "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed"
  ]
}' |
apify call lx112/onchain-whale-trades --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lx112/onchain-whale-trades"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/QW5pJwIWNXO5GEeRA/builds/DngyDQRTUL8xKkzIN/openapi.json
