# Mobula-compatible endpoints

Routes that answer in the shape of the Mobula API, for clients that already speak it.

These routes accept Mobula-style requests and answer in the Mobula response shape.
Use them only if your client already speaks that API.
New integrations should use the native routes in the [API reference](/api/).
Every route here needs the same `Authorization: <key>` header as the native routes.

## Chain spelling

The `blockchain` parameter (and `chainId` where a route accepts it) takes an exact id.
Chain names such as `ethereum` are refused with `400` and the message `unknown chain`.
The match is exact: no lowercasing and no trimming.

| Chain | Accepted values |
|---|---|
| Ethereum | `evm:1` or `1` |
| BNB Chain | `evm:56` or `56` |
| Base | `evm:8453` or `8453` |
| Solana | `solana:solana` or `solana` |

On these routes Solana is `solana`, not `1399811149`.
`/v2/fast-search` is the one exception to exact matching: it lowercases its chain list and strips spaces.

## Addresses

An EVM address is 40 hex characters.
The `0x` prefix is optional and case is ignored.
Answers spell EVM addresses as lowercase hex.
A Solana address is base58 and case-sensitive.
The zero address is refused where a wallet or token is required.

## Token routes

| Route | Parameters | Answer |
|---|---|---|
| `GET /v2/token/details` | `blockchain` (or `chainId`), `address` (required) | Price, supply, volume and holder figures for one token. Marked `partial`. |
| `POST /v2/token/details` | Body: a JSON array of `{blockchain, address, currencies?}`, at most 50 items and 64 KiB. Query `currencies=EUR,...`, at most 8 codes. | `{payload: [...], partial: true}` with one entry per item, or `null` for an item that has no answer. The all-time high and low fields are `null`. |
| `GET /v2/token/security` | `blockchain` (required, no `chainId` fallback), `address` | Security flags and buy and sell taxes. Answers `503` with `Retry-After` when busy. |
| `GET /v2/token/markets` | `blockchain`, `address`; `pairToken` (comma list, up to 10); `sortBy` (only `liquidityUSD`); `limit` (default 10, max 100) | `{data, totalCount, partial: true}`: the token's pools by 24 h volume. |
| `GET /v2/token/trades-enriched` | `blockchain`, `address` (token or pool); `sortOrder` `asc` or `desc` (default `desc`); `type` (comma list of `buy`, `sell`, `deposit`, `withdrawal`); `pool`; `cursor` (with `asc` only); `limit` (default 10, max 500); `offset` (`offset + limit` at most 5000); `fromDate`, `toDate` (Unix seconds, Unix milliseconds or RFC 3339); `label` (only `dev`); `swapRecipients`, `transactionSenderAddresses` (up to 10 each); `route=true` | Trades with wallet and pool context, plus `hasMore`. `swapTypes`, `minAmountUSD` and `maxAmountUSD` answer `400`. |
| `GET /v2/token/holder-positions` | `blockchain`, `address`; `limit` (default 100, max 250); `offset`; `includeNativeBalance=true` | The top holders with their positions. `label` and `walletAddresses` answer `400`. |
| `GET /v2/token/trader-positions` | Same as holder-positions | The top traders by realized PnL, in the holder-positions shape, plus `built` and `asOfBlock`. |
| `GET /v2/token/dev-history` | `blockchain` (required), `address`; `limit` (default and max 200) | Other tokens created by the token's deployer. |
| `GET /v2/token/ohlcv-history` | `chainId`, `address` (both required); `period` (default `5m`; one of `1s 5s 15s 30s 1m 5m 15m 30m 1h 4h 6h 12h 1d 1w`); `amount` (default 500, max 2000); `to` (Unix ms) | `{data: [{t, o, h, l, c, v}]}`: USD candles of the token's busiest pool, oldest first. |

## Market (pool) routes

| Route | Parameters | Answer |
|---|---|---|
| `GET /v2/market/details` | `blockchain`, `address` (a pool) | `{data, partial: true}` for one pool. An unknown pool answers `404`. |
| `GET /v2/market/ohlcv-history` | Same as `/v2/token/ohlcv-history`, with `address` a pool | USD candles for that one pool. An unknown pool answers `404`. |

## Wallet routes

| Route | Parameters | Answer |
|---|---|---|
| `GET /v2/wallet/analysis` | `chainIds` (or `blockchains`, or `chainId`; a comma list, chains are merged); `wallet` (required); `period` `1d`, `7d`, `30d` or `90d` (default `7d`), or `from` and `to` in ms (window at most 90 days); `includeNetworkBreakdown` | Trading statistics for the wallet over the window. PnL fields are `null` for now. |
| `GET /v2/wallet/trades` | `blockchains` (or `chainIds`; exactly one chain); `wallet`; `from`, `to` in ms (window at most 30 days, default the last 30 days); `limit` (default 50, max 100); `cursor`; `order` (only `asc`); `swapRecipients`; `transactionSenderAddresses` (EVM only). With `tokenAddress`: `order` `asc` or `desc` (default `desc`) and `offset` (`offset + limit` at most 5000), no cursor. | `data` (trades, oldest first), `pagination: {hasMore, nextCursor}` and `partial`. More than 20,000 trades for one token answers `422`. |

## Search and metadata

| Route | Parameters | Answer |
|---|---|---|
| `GET /v2/fast-search` | `input` (required, 1 to 1024 bytes); `filters` (JSON, for example `{"blockchains":"evm:1,solana"}`; default every searchable chain); `sortBy` `volume24h`, `marketCap` or `liquidity` (default: relevance) | Matching tokens. Marked `partial`. |
| `GET /system-metadata` | `chainId` (optional, default all chains); `factories=false` leaves out factories | The list of known DEX factories and launchpads per chain. A known chain that is not served answers an empty list. |

## Pulse

`POST /v2/pulse` answers token lists for a launch-tracking view.
The body is `{subscriptionId, compressed, maxUpdatesPerMinute, coalesce, views: [...]}` with up to 10 views.
Each view is `{name, model, chainId: [...], limit, offset, addressToExclude, filters, sortBy, sortOrder, includeTokens}`.
`model` is one of `new`, `bonding` or `bonded`.
The answer is `{"data": {"<view name>": {"data": [cards]}}}`.
It answers `503` while the launch feed is starting.
For the same data in the native shape, use [`GET /v2/pilot/trenches/{chain_id}`](/api/operations/get-trenches/).

## WebSocket

`GET /v2/mobula/ws` upgrades to a WebSocket.
Messages are JSON text frames of the form `{"type": ..., "payload": ...}`.

| `type` | `payload` |
|---|---|
| `ohlcv` | `{asset or address, chainId, period, subscriptionId, maxUpdatesPerMinute}` |
| `token-details` | `{tokens: [{blockchain, address}], subscriptionId, maxUpdatesPerMinute}` |
| `stream` | Trades: `{chainIds, events, filters, subscriptionId}` |
| `holders` | `{tokens, sortBy, includeNativeBalance, subscriptionId}` |
| `pulse-v2` | The same body as `POST /v2/pulse` |
| `pulse-pause` | `{action: "pause" or "unpause", views: [...]}` |
| `unsubscribe` | `{subscriptionId, type?, viewName?, tokens?}` |

Send `{"event":"ping"}` to get `{"event":"pong"}`.
A subscription is confirmed with `{"event":"subscribed", ...}`.
An error arrives as `{"event":"error","message": ...}`.
The socket answers `503` when no live feed is attached.
