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

# getEventLabels

> MEV labels (FrontRun / Sandwiched) attached to a pair, sourced from swap_type IN ('MEV', 'MEV_SANDWICHED').

### Returns

<ResponseField name="getEventLabels" type="EventLabelConnection!">
  Paginated list of MEV labels for the pair. See [EventLabelConnection](/api-reference/graphql/types/EventLabelConnection).
</ResponseField>

### Arguments

<ResponseField name="id" type="String!" required>
  Pair identifier in `pairAddress:networkId` form (e.g. `0xabc…:56`).
</ResponseField>

<ResponseField name="limit" type="Int">Max labels per page. Clamped to `[1, 100]`. Default `50`.</ResponseField>
<ResponseField name="cursor" type="String">Pagination cursor from previous response.</ResponseField>
<ResponseField name="direction" type="RankingDirection">`DESC` (default) or `ASC`. See [RankingDirection](/api-reference/graphql/types/RankingDirection).</ResponseField>

### Behavior

* `EventLabel.label` is `FrontRun` (mapped from `swap_type=MEV`) or `Sandwiched` (mapped from `swap_type=MEV_SANDWICHED`). See [EventLabelType](/api-reference/graphql/types/EventLabelType).
* For `FrontRun`, `data.index` is the leg index: `0` = front-run (buy leg), `1` = back-run (sell leg). Derived from the sign of the swap's `raw_amount0`.
* Drained amounts are unsigned magnitudes (sign stripped at the API edge). Mobula stores raw signed pool deltas; the front-run / sandwich swap amounts are the closest proxy for the "amount drained in the attack".
* Pagination is keyset on `(date, COALESCE(swaps.index, 0), transaction_hash)` so legacy NULL-index rows still page correctly.

### Example

```graphql theme={null}
query GetEventLabels {
  getEventLabels(id: "0x16b9a82891338f9ba80e2d6970fdda79d1eb0dae:56", limit: 50, direction: ASC) {
    cursor
    items {
      id
      label
      logIndex
      networkId
      timestamp
      transactionIndex
      transactionHash
      data {
        __typename
        ... on FrontRunLabelData { index token0DrainedAmount token1DrainedAmount }
        ... on SandwichedLabelData { token0DrainedAmount token1DrainedAmount }
      }
    }
  }
}
```

### Playground

<iframe src={`https://graphql.mobula.io/graphql?query=${encodeURIComponent('query GetEventLabels($id: String!, $limit: Int, $direction: RankingDirection) { getEventLabels(id: $id, limit: $limit, direction: $direction) { cursor items { id label logIndex networkId timestamp transactionHash data { __typename ... on FrontRunLabelData { index token0DrainedAmount token1DrainedAmount } ... on SandwichedLabelData { token0DrainedAmount token1DrainedAmount } } } } }')}&variables=${encodeURIComponent('{"id": "0x16b9a82891338f9ba80e2d6970fdda79d1eb0dae:56", "limit": 50, "direction": "DESC"}')}`} title="GraphQL Playground" style={{ width: '100%', minHeight: '600px', border: '1px solid var(--color-border)', borderRadius: '8px' }} />
