# Bubble map (linked wallets)

- Section: Tokens (TTF API reference)
- Source: https://ttf.bot/developers/docs/#token-bubbles
- The whole reference as one text: https://ttf.bot/developers/docs/llms-full.txt

`GET /v1/token/{chain}/{address}/bubbles`

- Base URL: `https://api.ttf.bot`
- Cost: 4 credits, 1 if cached
- Plan: requires Starter
- Chains: 8 chains
- API key: required. Send `Authorization: Bearer YOUR_KEY` (or `X-API-Key: YOUR_KEY`).
- A refused call costs nothing; a failed one costs 1 credit (the attempt fee).

Groups of top holders that are linked to each other (they funded each other or trade together), with the share each group holds. The data behind a bubble map picture.

- `mode` is `clusters` when linked groups were found, and `holders` when the map shows the top holders as one group (big tokens are often not mapped). Never call the second one "linked".

## Exact rules

The bubble map: linked holder groups (wallets funded from the same source), or the top holders as one group when no links are known.

One group (core, security, holders, candles, bubbles, deployer, resolve) or one field of a group (price, market, liquidity, tax ...). data is that group's answer (only the field, for a field). Costs that group's credits.

## Parameters

### Path parameters

- `chain` (string, path, required): Chain id.
  - Allowed: `eth`, `sol`, `base`, `bsc`, `abstract`, `arc`, `monad`, `robinhood`.
  - At most 16 characters.
  - Example: `eth`
- `address` (string, path, required): Token address of the chain (0x + 40 hex on EVM chains, base58 on Solana).
  - At most 64 characters.
  - Example: `0x6982508145454ce325ddbe47a25d4ec3d2311933`

## Example request

```bash
curl -sS 'https://api.ttf.bot/v1/token/eth/0x6982508145454ce325ddbe47a25d4ec3d2311933/bubbles' \
  -H 'Authorization: Bearer YOUR_KEY'
```

Put your key in place of `YOUR_KEY`.

## Example answer

`200` (`default`): The bubbles group

```json
{
  "data": {
    "clusters": [
      {
        "holders": [
          {
            "address": "0xf3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3",
            "balance": "27394538220371.5",
            "pct": 6.513,
            "tags": [
              "cex"
            ]
          }
        ],
        "id": 1,
        "pct": 8.2,
        "size": 3,
        "tags": [
          "cex"
        ]
      }
    ],
    "mode": "clusters",
    "stats": {
      "in_view_pct": 41.07,
      "largest_pct": 6.51,
      "linked_groups": 4,
      "top10_pct": 31.42,
      "wallets": 30
    },
    "tag_text": {
      "cex": "Exchange"
    },
    "total_cluster_pct": 12.4
  },
  "meta": {
    "cost": 4,
    "request_id": "3f2a9c0e5b7d4e18a6c1f0b2d9e8a7c6"
  }
}
```

## Response fields

`always` = in every answer; `always*` = in every answer that does not narrow it with `fields`; any other field is left out when there is no value (never `null`). Objects are open: ignore keys you do not know.

A `200` answer is `{"data", "meta"}` (`TokenGroupAnswer`).

### `data`

- `clusters` (array of objects, always): The groups, biggest first.
  - `holders` (array of objects, always): The wallets of the group.
    - `address` (string, always): Wallet. Address on its chain: 0x + 40 hex (lower case) on EVM chains, base58 on Solana.
    - `pct` (number, always): Share of the supply it holds. Percent (5.2 = 5.2 %).
    - `balance` (string): Tokens it holds (human units). Decimal string (never a float, no exponent).
    - `label` (string): A public name of the wallet (an exchange, a contract) when known. Third-party text: escape it.
    - `marks` (array of strings): Behaviour marks of the wallet. Known values: `sniper`, `bundler`, `insider`, `dev` (more may come: handle unknown ones).
    - `tags` (array of strings): Tags of this wallet or group (what tag_text explains). Known values: `cex`, `dex`, `contract`, `burn`, `team`, `sniper`, `bundler`, `insider`, `dev` (more may come: handle unknown ones).
  - `id` (integer, always): Group number in this answer.
  - `size` (integer, always): Wallets in the group.
  - `pct` (number): Share of the supply the group holds. Percent (5.2 = 5.2 %).
  - `tags` (array of strings): Tags of this wallet or group (what tag_text explains). Known values: `cex`, `dex`, `contract`, `burn`, `team`, `sniper`, `bundler`, `insider`, `dev` (more may come: handle unknown ones).
- `mode` (string, always): clusters = linked groups were found; holders = no links known, the top holders are shown as one group (never "linked"). One of: `clusters`, `holders`.
- `stats` (object): Totals over the map (a value the source does not give is absent).
  - `bundlers_pct` (number): Share held by bundler wallets. Percent (5.2 = 5.2 %).
  - `dev_pct` (number): Share held by the developer. Percent (5.2 = 5.2 %).
  - `half_supply_wallets` (integer): How few wallets hold half the supply.
  - `in_view_pct` (number): Share of the supply the wallets on the map hold. Percent (5.2 = 5.2 %).
  - `insiders_pct` (number): Share held by insider wallets. Percent (5.2 = 5.2 %).
  - `largest_pct` (number): Share of the biggest single wallet. Percent (5.2 = 5.2 %).
  - `linked_groups` (integer): Linked groups found.
  - `snipers_pct` (number): Share held by sniper wallets. Percent (5.2 = 5.2 %).
  - `top10_pct` (number): Share of the 10 biggest wallets. Percent (5.2 = 5.2 %).
  - `wallets` (integer): Wallets on the map.
- `tag_text` (map of strings): What each tag means, keyed by tag.
- `total_cluster_pct` (number): Share of the supply held by all linked groups together. Percent (5.2 = 5.2 %).

### `meta`

- `cost` (integer, always): Credits this call finally spent (= the X-Credits-Cost header). 0 for free routes and refused calls.
- `request_id` (string, always): Id of this request (= the X-Request-Id header). Quote it to support.
- `cached` (array of strings): The groups answered from the shared answer cache (charged at their cached weight). Absent when none.
- `partial` (array of strings): Something is missing. A bare group name ("holders"): that group failed, its entry in data is {"error": {...}} and only the attempt fee can apply. A dotted "\<group>.\<part>" ("security.holders"): a part of a group that DID answer is missing (see its complete / missing); that group is still billed. Absent when nothing is missing.

## Errors

| Status | Code | When |
| --- | --- | --- |
| 400 | `bad_request` | Bad request: unknown chain, address, field or option. Not charged. Codes: bad_request. |
| 401 | `unauthorized` | The API key is missing or not valid. Not charged. Codes: unauthorized. |
| 402 | `payment_required` | The subscription of this API key has ended. Not charged. Codes: payment_required. |
| 403 | `forbidden` | The key has no developer plan, or does not include the asked groups. Not charged. Codes: forbidden. |
| 404 | `not_found` | Not found: no data for this token (the attempt fee applies, see the description), or the API is switched off / an unknown route (not charged). Codes: not_found. |
| 405 | `method_not_allowed` | Wrong HTTP method (every data route is GET). Not charged. Codes: method_not_allowed. |
| 422 | `refused` | This token cannot be scanned. The attempt fee (1 credit) applies. Codes: refused. |
| 429 | `rate_limited` | Too many requests per second, or the credits of the minute / day / month are used up. See Retry-After. Not charged. Codes: rate_limited. |
| 500 | `internal` | Unexpected error. Not charged. Codes: internal. |
| 502 | `upstream` | A data provider did not answer. The attempt fee (1 credit) applies to core and the paid-provider groups. Codes: upstream. |
| 503 | `capacity` `busy` `unavailable` | Capacity, shedding, busy providers or the limits store is unavailable. See Retry-After. Not charged. Codes: capacity, busy, unavailable. |
| 504 | `timeout` | The data took too long. The attempt fee (1 credit) applies to core and the paid-provider groups. Codes: timeout. |
| other | `error` | Any other refusal of the HTTP layer (rare): the status says which. Codes: error. |

Every error is `{"error": {"code", "message", "doc_url", "request_id"}}`. What each code means and how to fix it: [Errors](https://ttf.bot/developers/docs/md/errors.md).
