> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 🪪 May 16, 2026 - OG Coin Flag

> New isOGCoin flag identifies the original token for a given name on each chain — exposed across token/market details, pulse, and stream endpoints.

**TL;DR**: Every token now carries an `isOGCoin` boolean — `true` when no other token on the same chain already has that `name`, `false` when it's a copycat / rename, `null` while resolution is still pending.

## What is `isOGCoin`?

A token is the **OG** for its name on a given chain when no prior row in our database shares the same `(chainId, name)`. The flag is scoped per-chain — the same name can be OG on multiple chains independently (e.g. "PEPE" can be OG on both Solana and Base).

| Value   | Meaning                                                                                   |
| ------- | ----------------------------------------------------------------------------------------- |
| `true`  | First time we see this `name` on this chain — original / OG                               |
| `false` | Another token with the same `name` already exists on this chain                           |
| `null`  | Flag is being resolved (async, settles within a few seconds of creation or on first swap) |

## Where it shows up

* **`/api/2/token/details`** — top-level `isOGCoin` field on the response.
* **`/api/2/market/details`** — included inside each `base` / `quote` token block.
* **Pulse WSS** (`/api/2/pulse`) — surfaced at the root and inside the nested `token` object. Filterable as `is_og_coin` or `isOGCoin`.
* **WSS token-details & market-details streams** — same shape as the REST equivalents.

## How it's resolved

Two paths, both async — never blocks token creation:

1. **At creation** — `TokensStorage._upsert` fires a fire-and-forget `findFirst` against `public.tokens.name` (GIN trigram indexed) right after the token row lands, then writes back via `updatePartial(updateDb=true)`. Both Redis and DB land in the same write, broadcast through the token-state delta channel.
2. **Lazy retry** — the `token-handler` `is_og_coin` service watches the swap stream and, for any token still showing `isOGCoin = null` in Redis, re-runs the lookup. Catches anything the creation-time path race-lost against `dbAsync` DB writes.

## Use cases

* **Spot copycats**: filter Pulse / token-details by `isOGCoin = false` to surface every rename that's piggybacking on an existing token's name.
* **Highlight originals**: badge UIs can mark `isOGCoin = true` tokens as the canonical entry for that name on this chain.
* **Quality scoring**: combine with `securityScore`, `bonded`, and `dexscreenerListed` to weight authentic tokens above their copycats.

***

Shipped by Florian
