> ## Documentation Index
> Fetch the complete documentation index at: https://sonar-cf3aeac7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# fast-trade channel

> Receive every trade of a token or pool as it happens, with no enrichment.

`fast-trade` sends one event per trade for a token, a pool, or a token inside one pool. It is the lightest channel: events carry only the trade, with no extra lookups, so they are delivered as soon as the block is processed.

**Weight:** 1 per subscription. See [Subscription weight](https://sonar-cf3aeac7.mintlify.site/websocket/limits-and-errors.md#subscription-weight).

## Parameters

| Param | Type | Required | Description |
| - | - | - | - |
| `chain` | string | Yes | Chain in `evm:<chainId>` form, for example `"evm:8453"`. |
| `token` | string | One of `token` or `pool` | Token address, `0x` plus 40 hex characters. |
| `pool` | string | One of `token` or `pool` | Pool address (`0x` plus 40 hex characters) or 32-byte pool id (`0x` plus 64 hex characters, used by Uniswap V4-style pools). |
| `maxUpdatesPerMinute` | integer | No | 1 to 600. Samples the subscription: at most this many events per minute per followed token, no cursors, no resume. See [Sampling](https://sonar-cf3aeac7.mintlify.site/websocket/messages.md#sampling-with-maxupdatesperminute). |
| `excludeNoise` | boolean | No | Drop dust and low-value trades. See [Excluding noise](#excluding-noise). |

Sending neither `token` nor `pool` fails with:

```json theme={null}
<- {"type":"error","id":"trades","code":"INVALID_PARAMETERS","message":"token or pool is required","details":[{"field":"","message":"token or pool is required"}]}
```

The channel does not check that the token or pool exists. An address that never trades produces no events.

## Which trades you receive

Every event is **oriented** to one token: `data.token` is the token the trade is described from, and `data.tokenVs` is the other side of the pool. Amounts, prices and `type` (`buy` or `sell`) are all from the point of view of `data.token`.

| You send | You receive | Oriented to |
| - | - | - |
| `token` only | Trades of that token in any pool, subject to the [quote-token rule](#the-quote-token-rule) | `token` |
| `pool` only | Every trade in that pool | The pool's base token |
| `token` and `pool` | Every trade in that pool | `token` |

> [!WARNING]
>
> With both `token` and `pool`, the token must be one of the pool's two tokens. If it isn't, the subscription succeeds but never delivers anything. No error is returned.

Each swap has a base token and a quote token. The quote is the side that prices the other: a stablecoin, the chain's native or wrapped-native token, or another recognised quote asset. In a MEME/WETH pool, MEME is the base and WETH is the quote.

### The quote-token rule

A `token`-only subscription matches a trade when the token is the trade's base token, or when it is the quote token but the quote is not a recognised quote asset.

In practice, subscribing to a quote asset such as WETH or USDC by `token` gives you only trades where that asset is the **base**, for example WETH in a WETH/USDC pool. You do **not** receive every MEME/WETH trade on the chain. That keeps a WETH subscription about WETH's own price, not every token priced in WETH.

To follow a quote asset in a specific pool anyway, send both `token` and `pool`. That combination is matched by pool, so the quote-token rule doesn't apply.

## Excluding noise

With `excludeNoise: true`, a trade is dropped when **any** of these is true. "Followed token" means `token` if you sent it, otherwise the pool's base token.

1. The trade's USD value is \$0.10 or less.
2. The followed token's USD price is not a finite number, or is above `3.4e30`, or below `1e-16`.
3. The followed token trades in more than one pool, and the trade's USD value is \$100 or less.

Whether a token trades in more than one pool is cached for about 5 minutes. For subscriptions with `token`, it is looked up before `subscribed` is sent. For `pool`-only subscriptions it is looked up on the first trade, so the first few trades may be filtered as if the token had a single pool.

## Event data

`data` is a trade event:

**token** `string`

Address of the token the trade is viewed from, lowercase. All `token*` fields describe this token and all `*Vs` fields describe the other side.

**tokenVs** `string`

Address of the other token in the pair, lowercase.

**pair** `string`

Pool address or 32-byte pool id, lowercase.

**poolType** `string | null`

Pool type id, for example `uniswap-v3`.

**date** `number`

Trade time in Unix epoch milliseconds (block time).

**timestamp** `number`

Same value as `date`.

**blockNumber** `number`

Block number of the trade.

**tokenPrice** `number`

USD price of `token` at the time of the trade.

**tokenPriceVs** `number`

USD price of `tokenVs` at the time of the trade.

**tokenAmount** `number`

Amount of `token` traded, adjusted for decimals. Always positive.

**tokenAmountVs** `number`

Amount of `tokenVs` traded, adjusted for decimals. Always positive.

**tokenAmountRaw** `string`

Amount of `token` as a raw integer string in base units. Always positive.

**tokenAmountRawVs** `string`

Amount of `tokenVs` as a raw integer string in base units. Always positive.

**tokenAmountUsd** `number`

USD value of the trade.

**tokenNativePrice** `number`

Price of `token` in the chain's native coin (for example ETH): `tokenPrice` divided by the native coin's USD price at the time of the trade. `0` when the native price is unknown.

**type** `"buy" | "sell"`

Direction from the point of view of `token`. `buy`: `token` left the pool (the trader received `token`). `sell`: `token` entered the pool (the trader gave up `token`).

**operation** `"regular"`

Always `regular`.

**blockchain** `string`

Chain display **name**, for example `Ethereum` or `Base`. This is not a chain id.

**hash** `string`

Transaction hash.

**sender** `string`

Address that initiated the transaction (the trader's wallet), lowercase.

**gasFeesUSD** `number | null`

Gas fee for this trade in USD: the transaction's gas cost, split evenly across the swaps in that transaction. `null` when unknown.

## Example

Follow a token on Base, without noise:

```json theme={null}
-> {"op":"subscribe","id":"meme-trades","channel":"fast-trade","params":{"chain":"evm:8453","token":"0x1111111111111111111111111111111111111111","excludeNoise":true}}
<- {"type":"subscribed","id":"meme-trades","channel":"fast-trade","cursor":"38123456-0"}
<- {"type":"event","id":"meme-trades","channel":"fast-trade","cursor":"38123457-0:1","data":{"token":"0x1111111111111111111111111111111111111111","tokenVs":"0x4200000000000000000000000000000000000006","pair":"0x2222222222222222222222222222222222222222","poolType":"uniswap-v3","date":1796292003000,"blockNumber":38123457,"tokenPrice":0.0102,"tokenPriceVs":3412.57,"tokenAmount":15000,"tokenAmountVs":0.044834,"tokenAmountUsd":153,"tokenNativePrice":0.00000298895,"type":"buy","operation":"regular","blockchain":"Base","hash":"0x9f1c4b0e7d2a6c8f3e5b1a0d4c7e9f2b6a8d0c3e5f7a9b1c2d4e6f8a0b2c4d6e","sender":"0x3333333333333333333333333333333333333333","tokenAmountRaw":"15000000000000000000000","tokenAmountRawVs":"44834000000000000","gasFeesUSD":0.0042,"timestamp":1796292003000}}
<- {"type":"cursor","id":"meme-trades","cursor":"38123610-0"}
```

Every trade in one pool, at most one per second:

```json theme={null}
-> {"op":"subscribe","id":"pool-ticker","channel":"fast-trade","params":{"chain":"evm:8453","pool":"0x2222222222222222222222222222222222222222","maxUpdatesPerMinute":60}}
<- {"type":"subscribed","id":"pool-ticker","channel":"fast-trade"}
<- {"type":"event","id":"pool-ticker","channel":"fast-trade","data":{"token":"0x1111111111111111111111111111111111111111","...":"..."}}
```

The sampled subscription has no `cursor` on `subscribed` or on events.

```javascript Browser theme={null}
const ws = new WebSocket("wss://api.example.com/v1/ws");

ws.onopen = () => ws.send(JSON.stringify({
  op: "subscribe",
  id: "meme-trades",
  channel: "fast-trade",
  params: {
    chain: "evm:8453",
    token: "0x1111111111111111111111111111111111111111",
    excludeNoise: true,
  },
}));

ws.onmessage = (frame) => {
  const msg = JSON.parse(frame.data);
  if (msg.type === "event") {
    const t = msg.data;
    console.log(`${t.type} ${t.tokenAmount} @ $${t.tokenPrice} ($${t.tokenAmountUsd}) ${t.hash}`);
  }
};
```

```python Python (websockets) theme={null}
import asyncio
import json

import websockets

async def main():
    async with websockets.connect("wss://api.example.com/v1/ws") as ws:
        await ws.send(json.dumps({
            "op": "subscribe",
            "id": "meme-trades",
            "channel": "fast-trade",
            "params": {
                "chain": "evm:8453",
                "token": "0x1111111111111111111111111111111111111111",
                "excludeNoise": True,
            },
        }))
        async for raw in ws:
            msg = json.loads(raw)
            if msg["type"] == "event":
                t = msg["data"]
                print(t["type"], t["tokenAmount"], "@", t["tokenPrice"], t["hash"])

asyncio.run(main())
```

## Related

* [Large trade alerts guide](https://sonar-cf3aeac7.mintlify.site/guides/large-trade-alerts.md)
* [`GET /trades`](https://sonar-cf3aeac7.mintlify.site/api-reference/trades/get-trades) for trade history with the same fields
* [Cursors and resuming](https://sonar-cf3aeac7.mintlify.site/websocket/cursors-and-resume.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.