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

# Tokens

> Deployments, top lists, batch enrichment, OHLCV, and token discovery

For a full **trending-page** query (multiple leaderboards + `tokens` enrichment in one request), see [Trending board](./trending-board).

## `recentDeploys`

Most recent token deployments across supported platforms, newest first.

### Arguments

| Name       | Type     | Required | Description                                                |
| ---------- | -------- | -------- | ---------------------------------------------------------- |
| `limit`    | `Int`    | no       | Default `100`, max `1000`.                                 |
| `offset`   | `Int`    | no       | Default `0`.                                               |
| `platform` | `String` | no       | Comma-separated (e.g. `"pumpfun,pumpswap"`). Omit for all. |

### Return type

```graphql theme={null}
type Deploy {
  mint: String!
  name: String!
  symbol: String!
  uri: String!
  signer: String!          # deployer wallet
  platform: String!
  time: String!            # ISO-8601
  slot: String!
  migrated: String         # null if still bonding
  creatorBuySol: Float
  creatorBuyTokens: Float
  creatorBuyPrice: Float
}
```

### Example

```graphql theme={null}
query {
  recentDeploys(limit: 20, platform: "pumpfun") {
    mint name symbol signer platform time migrated creatorBuySol
  }
}
```

***

## `deployByMint`

Fetch the deployment record for a single mint. Returns `null` for unknown mints.

### Arguments

| Name   | Type     | Required | Description                      |
| ------ | -------- | -------- | -------------------------------- |
| `mint` | `String` | yes      | Token mint address (≥ 32 chars). |

### Example

```graphql theme={null}
query {
  deployByMint(mint: "So11111111111111111111111111111111111111112") {
    name symbol signer platform time migrated
  }
}
```

***

## `recentMigrations`

Tokens that have recently migrated off a bonding curve onto an AMM pool (e.g. Pump.fun → PumpSwap). Same shape as `recentDeploys`; every row has a non-null `migrated` timestamp.

### Arguments

| Name       | Type     | Required | Description                      |
| ---------- | -------- | -------- | -------------------------------- |
| `limit`    | `Int`    | no       | Default `100`, max `1000`.       |
| `offset`   | `Int`    | no       | Default `0`.                     |
| `platform` | `String` | no       | Comma-separated platform filter. |

### Example

```graphql theme={null}
query { recentMigrations(limit: 10) { mint name symbol platform time migrated } }
```

***

## `topTokens`

Tokens ranked over a rolling window. Same rankings as REST `GET /api/sol/tokens/top`.

### Arguments

| Name       | Type           | Required | Description                                                  |
| ---------- | -------------- | -------- | ------------------------------------------------------------ |
| `hours`    | `Int`          | no       | Rolling window. Default `24`, max `168`.                     |
| `limit`    | `Int`          | no       | Default `100`, max `100`.                                    |
| `sort`     | `TopTokenSort` | no       | `VOLUME` (default) or `TXNS` (transaction count).            |
| `platform` | `String`       | no       | Comma-separated platform filter (e.g. `"pumpfun,pumpswap"`). |

### Return type

```graphql theme={null}
enum TopTokenSort {
  VOLUME
  TXNS
}

type TopToken {
  mint: String!
  tradeCount: Int!
  totalSolVolume: Float!
  uniqueTraders: Int!
  buySolVolume: Float!
  sellSolVolume: Float!
  netFlow: Float!
  buySellRatio: Float!
  bundleCount: Int!
  sniperCount: Int!
  name: String
  symbol: String
  platform: String
  deployedAt: String
}

type TopTokensPage {
  data: [TopToken!]!
  count: Int!
  hours: Int!
  limit: Int!
  sort: String!
}
```

### Example

```graphql theme={null}
query {
  topTokens(hours: 24, limit: 50, sort: TXNS, platform: "pumpfun") {
    sort hours count
    data { mint symbol tradeCount totalSolVolume uniqueTraders }
  }
}
```

***

## `tokens` (batch enrichment)

Fetch many mints in one query. Each mint is a `Token` object — **only request the nested fields you need** to avoid unnecessary RPC work (`metadata`, `holders`, `supply` are the heavier branches).

### Arguments

| Name    | Type         | Required | Description                                       |
| ------- | ------------ | -------- | ------------------------------------------------- |
| `mints` | `[String!]!` | yes      | Mint addresses. Deduped server-side; max **500**. |

### `Token` nested fields

| Field               | Arguments                              | REST equivalent                          |
| ------------------- | -------------------------------------- | ---------------------------------------- |
| `mint`              | —                                      | (scalar on parent)                       |
| `deploy`            | —                                      | `GET /tokens/mint/{mint}`                |
| `priceChanges`      | —                                      | `GET /tokens/price-changes/{mint}`       |
| `tradingVolume`     | `hours?` (default 24, max 168)         | `GET /trades/volume/{mint}`              |
| `metadata`          | —                                      | `GET /tokens/metadata/{mint}`            |
| `holders`           | `limit?`, `fresh?`                     | `GET /tokens/holders/{mint}`             |
| `supply`            | —                                      | `GET /tokens/supply/{mint}`              |
| `sniperBundleStats` | —                                      | `GET /tokens/mint/{mint}?analysis=stats` |
| `topTraders`        | `limit?` (max 100)                     | `GET /tokens/toptraders/{mint}`          |
| `ohlcv`             | `timeframe?`, `limit?`, `from?`, `to?` | `GET /tokens/ohlc/{mint}`                |

### Example

```graphql theme={null}
query Enrich($mints: [String!]!) {
  tokens(mints: $mints) {
    mint
    deploy { name symbol platform }
    priceChanges { currentPrice change1h { change } }
    tradingVolume(hours: 24) { totalSolVolume tradeCount }
    metadata { dexPaid offChain { image } }
  }
}
```

***

## Single-mint shortcuts

These mirror one branch of `tokens` when you only need one mint:

| Query                                | Description                                               |
| ------------------------------------ | --------------------------------------------------------- |
| `tokenMetadata(mint)`                | On-chain + off-chain metadata, `dexPaid`                  |
| `tokenHolders(mint, limit?, fresh?)` | Ranked holders + `source` tier                            |
| `tokenSupply(mint)`                  | Circulating supply via RPC                                |
| `topTraders(mint, limit?)`           | Top wallets by PnL (USD when SOL price available)         |
| `sniperBundleStats(mint)`            | Sniper/bundle aggregates + optional creator deploy counts |

***

## `liveDeploys` / `liveMigrations` / `migratingDeploys`

Snapshots from the in-memory live board (same data as REST `GET /tokens/deploys`, `/tokens/migrations`, `/tokens/migrating`). Returns `[Deploy!]`.

### Arguments

| Name       | Type     | Required | Description               |
| ---------- | -------- | -------- | ------------------------- |
| `limit`    | `Int`    | no       | Default `100`, max `200`. |
| `offset`   | `Int`    | no       | Default `0`.              |
| `platform` | `String` | no       | Comma-separated filter.   |

### Example

```graphql theme={null}
query {
  migratingDeploys(limit: 20, platform: "pumpfun") {
    mint name symbol platform time
  }
}
```

***

## `searchTokens`

Free-text search across token name / symbol / mint.

### Arguments

| Name    | Type     | Required | Description               |
| ------- | -------- | -------- | ------------------------- |
| `query` | `String` | yes      | Non-empty search term.    |
| `limit` | `Int`    | no       | Default `100`, max `100`. |

### Return type

```graphql theme={null}
type SearchToken {
  mint: String!
  name: String!
  symbol: String!
  platform: String!
  uri: String!
  time: String!
  createdAt: String
  priority: Int!
}
```

### Example

```graphql theme={null}
query {
  searchTokens(query: "pepe", limit: 10) {
    mint name symbol platform
  }
}
```

***

## `stats`

Platform-wide approximate counts from the analytics store.

### Return type

```graphql theme={null}
type PlatformStats {
  totalTrades: Int!
  totalDeploys: Int!
  totalAlerts: Int!
}
```

### Example

```graphql theme={null}
query { stats { totalTrades totalDeploys totalAlerts } }
```

***

## `ohlcv`

Open / High / Low / Close / Volume candles for a mint at the requested timeframe. Backed by pre-aggregated materialized views.

### Arguments

| Name        | Type     | Required | Description                                                                         |
| ----------- | -------- | -------- | ----------------------------------------------------------------------------------- |
| `mint`      | `String` | yes      | Token mint address (≥ 32 chars).                                                    |
| `timeframe` | `String` | no       | `1s`, `5s`, `15s`, `30s`, `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `1d`. Default `1s`. |
| `limit`     | `Int`    | no       | Default `100`, max `10000`.                                                         |
| `from`      | `String` | no       | Start time in **ms since epoch** as a string.                                       |
| `to`        | `String` | no       | End time in **ms since epoch** as a string.                                         |

### Return type

```graphql theme={null}
type OHLCVCandle {
  timestamp: String!
  tokenMint: String!
  open: String!
  high: String!
  low: String!
  close: String!
  volume: String!
  trades: String!
  solPrice: String!
}
```

### Example

```graphql theme={null}
query {
  ohlcv(mint: "So11111111111111111111111111111111111111112", timeframe: "1m", limit: 200) {
    timestamp open high low close volume trades
  }
}
```

***

## `priceChanges`

Current price plus percentage change over standard lookback intervals (5m, 1h, 4h, 12h, 24h). Returns `null` for mints without price history.

### Arguments

| Name   | Type     | Required | Description                      |
| ------ | -------- | -------- | -------------------------------- |
| `mint` | `String` | yes      | Token mint address (≥ 32 chars). |

### Return type

```graphql theme={null}
type PriceChangeInterval {
  change: Float   # percent; null if not enough history
  price: Float!
}

type PriceChanges {
  currentPrice: Float!
  currentPriceUsd: String
  oldestPrice: Float!
  change5m: PriceChangeInterval
  change1h: PriceChangeInterval
  change4h: PriceChangeInterval
  change12h: PriceChangeInterval
  change24h: PriceChangeInterval
}
```

### Example

```graphql theme={null}
query {
  priceChanges(mint: "So11111111111111111111111111111111111111112") {
    currentPrice currentPriceUsd
    change5m { change price }
    change1h { change price }
    change24h { change price }
  }
}
```

***

## `signerCounts`

Deploy and migration counts for a wallet — useful for identifying prolific creators.

### Arguments

| Name     | Type     | Required | Description                  |
| -------- | -------- | -------- | ---------------------------- |
| `signer` | `String` | yes      | Wallet address (≥ 32 chars). |

### Return type

```graphql theme={null}
type SignerCounts {
  signer: String!
  deployCount: Int!
  migrationCount: Int!
  totalCount: Int!
}
```

### Example

```graphql theme={null}
query {
  signerCounts(signer: "3ixtZXbbJjNEq89GbeFu8vJMGDMNSePofNEf5kecVhsA") {
    deployCount migrationCount totalCount
  }
}
```
