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

# Overview

> Token launch, fee management, and SOL/SPL transfers — batched and packed into the fewest possible transactions

The `/utils/sol/*` endpoints live on the same trading service as `/swap/sol/*`
and `/perp/sol/*`. They cover the non-swap workflows previously hosted on the
legacy `public.raze.sh` service: token launches, fee management, SOL/SPL
transfers, mixing, distribution, and consolidation.

All endpoints require an API key (same scheme as the swap routes —
`X-API-Key`, `Authorization: Bearer sk_...`, or `?apiKey=sk_...`).

## Endpoints

<CardGroup cols={2}>
  <Card title="Transfer" href="/api-reference/router/utils/transfer" icon="paper-plane">
    Batch SOL + SPL + Token-2022 transfers. One request → as few txs as fit.
  </Card>

  <Card title="Burn" href="/api-reference/router/utils/burn" icon="fire">
    Batch burn SPL or Token-2022 tokens across many wallets and mints.
  </Card>

  <Card title="Distribute" href="/api-reference/router/utils/distribute" icon="share-nodes">
    One→many SOL distribute.
  </Card>

  <Card title="Consolidate" href="/api-reference/router/utils/consolidate" icon="arrows-to-circle">
    Many→one SOL sweep, percentage-based.
  </Card>

  <Card title="Mixer" href="/api-reference/router/utils/mixer" icon="shuffle">
    One→one SOL routed through ephemeral hops.
  </Card>

  <Card title="Launch" href="/api-reference/router/utils/launch" icon="rocket">
    Token launch (pumpfun / bonk / meteora\_dbc / meteora\_cpamm).
  </Card>

  <Card title="Fees: Claim" href="/api-reference/router/utils/fees/claim" icon="hand-holding-dollar">
    Claim pump.fun creator fees or Meteora partner/creator fees.
  </Card>

  <Card title="Fees: Config" href="/api-reference/router/utils/fees/config" icon="sliders">
    Manage pump.fun creator-fee sharing config.
  </Card>
</CardGroup>

## Batch semantics

`transfer` and `burn` are the two endpoints that accept a true batch (`items[]`).
The server groups items by their signer (sender for `transfer`, wallet for `burn`)
and bin-packs each group into as few **versioned transactions** as the 1232-byte
wire limit allows. Items that share a signer share a tx; items with different
signers go to different txs.

The response includes a `batches[]` array describing the packing — `batches[i]`
describes `transactions[i]`, telling you which input item indices ended up in
that tx and how many non-fee instructions it contains. That lets you do
partial-retry logic when one tx in a batch lands and another doesn't.

```jsonc theme={null}
// Request: 4 items, two senders
{
  "items": [
    { "sender": "A...", "receiver": "X...", "amount": 0.1 },
    { "sender": "A...", "receiver": "Y...", "tokenAddress": "USDC...", "amount": 5 },
    { "sender": "B...", "receiver": "Z...", "amount": 0.2 },
    { "sender": "A...", "receiver": "W...", "amount": 0.05 }
  ]
}

// Response: 2 txs (one per signer)
{
  "success": true,
  "transactions": ["base64...", "base64..."],
  "batches": [
    { "signers": ["A..."], "itemIndices": [0, 1, 3], "instructionCount": 3 },
    { "signers": ["B..."], "itemIndices": [2],       "instructionCount": 1 }
  ]
}
```

## Common request flags

| Flag                      | Default  | What it does                                                                                                   |
| ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `encoding`                | `base64` | Output transaction encoding. `base58` supported for legacy callers.                                            |
| `simulate`                | `false`  | When true, every built tx is run through `simulateTransaction` and the result is attached as `simulations[i]`. |
| `feeTipLamports`          | —        | Override the Raze tip transfer (min 900000 lamports).                                                          |
| `transactionsFeeLamports` | —        | When set, compute-budget instructions are prepended to every output tx.                                        |
| `maxInstructionsPerTx`    | auto     | Optional cap on non-fee instructions per tx. Default fits the 1232-byte budget.                                |

## Common response envelope

```ts theme={null}
{
  success: boolean,
  transactions?: string[],          // serialized partially-signed v0 txs
  batches?: BatchInfo[],            // per-tx packing metadata (transfer/burn)
  mint?: string,                    // launch only
  platform?: string,                // launch + fees/claim only
  status?: object,                  // fees/config status reads
  simulations?: object[],           // present when simulate: true
  error?: string,                   // non-fatal partial-failure summary
}
```

## Token program autodetection

Anywhere a `tokenAddress` (mint) appears, the server batch-fetches the mint
account in one `getMultipleAccounts` call and detects whether the mint is owned
by the SPL Token program or Token-2022. The right program ID is used for
ATA derivation and `transfer_checked` / `burn_checked` instruction building.
Callers don't pass a `tokenProgram` flag.

Token-2022 mints with the **transfer-fee extension** are not yet supported and
will fail on-chain. Open an issue if you hit one and we'll add
`transfer_checked_with_fee`.

## Migration from `public.raze.sh`

These endpoints replace the legacy `public.raze.sh` service, which has been
removed. Endpoint mapping:

| Legacy (removed)                                  | New                                                  |
| ------------------------------------------------- | ---------------------------------------------------- |
| `POST https://public.raze.sh/api/sol/transfer`    | `POST https://router.raze.bot/utils/sol/transfer`    |
| `POST https://public.raze.sh/api/sol/burn`        | `POST https://router.raze.bot/utils/sol/burn`        |
| `POST https://public.raze.sh/api/sol/distribute`  | `POST https://router.raze.bot/utils/sol/distribute`  |
| `POST https://public.raze.sh/api/sol/consolidate` | `POST https://router.raze.bot/utils/sol/consolidate` |
| `POST https://public.raze.sh/api/sol/mixer`       | `POST https://router.raze.bot/utils/sol/mixer`       |
| `POST https://public.raze.sh/api/sol/create`      | `POST https://router.raze.bot/utils/sol/launch`      |
| `POST https://public.raze.sh/api/sol/fee-claim`   | `POST https://router.raze.bot/utils/sol/fees/claim`  |
| `POST https://public.raze.sh/api/sol/fee-config`  | `POST https://router.raze.bot/utils/sol/fees/config` |

The legacy `GET /api/metadata/*`, `GET /api/image/*`, and `POST /api/upload`
endpoints have no public replacement — read Metaplex / Token-2022 metadata via
Solana RPC, serve images through a CDN, and pin to IPFS via Pinata directly.

The new endpoints **require an API key** (the legacy service was open). Default
output encoding is `base64` (legacy was `base58`); pass `encoding: "base58"`
for byte-for-byte compatibility.
