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

# Check Sandwich Attacks (Async)

> Check one or more transaction signatures for sandwich attacks within a configurable slot range. Submits an async job and returns a jobId. Poll `/mev/job-status/:jobId` for results. Results are cached for 5 minutes. Uses RPC pre-lookup for efficient ClickHouse partition pruning. Detection covers cross-slot and intra-slot (same PoH tick) ordering via entry_index/tx_index.



## OpenAPI

````yaml /api-reference/openapi.json post /mev/check-sandwich
openapi: 3.0.3
info:
  title: Blockline MEV Analytics API
  description: >-
    Professional MEV analytics API for Solana. Analyze transaction context,
    detect front-running, identify sandwich attacks, and gain competitive
    intelligence on Solana MEV activity.
  version: 1.0.0
  contact:
    name: Blockline Support
    url: https://blockline.soltop.sh
servers:
  - url: https://api.soltop.sh
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Trade Analysis
    description: Analyze MEV activity and transaction context
  - name: Transactions
    description: Transaction details and metadata
  - name: Wallets
    description: Wallet transaction history
  - name: Data Management
    description: Backfill and data operations
  - name: MEV Analysis
    description: >-
      Sandwich attack detection: scan wallets, check transactions, and profile
      attackers (async job queue)
  - name: Write Locks
    description: Account write lock contention and hot account analysis
paths:
  /mev/check-sandwich:
    post:
      tags:
        - MEV Analysis
      summary: Check Sandwich Attacks (Async)
      description: >-
        Check one or more transaction signatures for sandwich attacks within a
        configurable slot range. Submits an async job and returns a jobId. Poll
        `/mev/job-status/:jobId` for results. Results are cached for 5 minutes.
        Uses RPC pre-lookup for efficient ClickHouse partition pruning.
        Detection covers cross-slot and intra-slot (same PoH tick) ordering via
        entry_index/tx_index.
      operationId: checkSandwich
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - signatures
              properties:
                signatures:
                  oneOf:
                    - type: string
                      description: Single transaction signature
                    - type: array
                      items:
                        type: string
                      maxItems: 50
                      description: Array of transaction signatures (max 50)
                  example:
                    - >-
                      48kLA6633tthDaBHTpzv9qXFkypFajpzyAd7hP8xRu8ggr8VhG5NXUKs7M2SYi57ntDKwPEqFgUGHrvXVd7pzFRE
                slot_range:
                  type: integer
                  minimum: 0
                  maximum: 1000
                  default: 20
                  description: Slot range (±) to search for attackers. 0 = intra-slot only.
      responses:
        '200':
          description: Job submitted or cached result returned
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: Job queued
                    properties:
                      success:
                        type: boolean
                        example: true
                      jobId:
                        type: string
                        example: mev-sandwich-check-abc123-1773915254896
                      status:
                        type: string
                        example: queued
                      message:
                        type: string
                        example: >-
                          Sandwich check started. Poll /mev/job-status/:jobId
                          for updates.
                  - $ref: '#/components/schemas/SandwichCheckResponse'
                    type: object
                    description: Cached result
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing:
                  value:
                    error: Invalid request
                    details: signatures is required (string or array of strings)
                tooMany:
                  value:
                    error: Invalid request
                    details: Maximum 50 signatures per request
        '401':
          $ref: 02ca5649-c9d9-4a5e-8f26-a133d5c61cc5
        '403':
          $ref: 80776eac-c595-4f19-9646-9d6dc9a6cf2c
        '429':
          $ref: cfbde83c-0b04-46b0-b46a-c3a713982079
      security:
        - SupabaseJWT: []
components:
  schemas:
    SandwichCheckResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            results:
              type: array
              items:
                $ref: '#/components/schemas/SandwichCheckResult'
            summary:
              type: object
              properties:
                total_checked:
                  type: integer
                  description: Number of signatures submitted
                total_found:
                  type: integer
                  description: Number found in timing_data
                total_sandwich_attacks:
                  type: integer
                  description: Number of sandwich attacks detected
                slot_range_used:
                  type: integer
                  description: Slot range used for the analysis
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          description: Detailed error information
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
    SandwichCheckResult:
      type: object
      properties:
        signature:
          type: string
          description: Input transaction signature
        found:
          type: boolean
          description: Whether the transaction was found in timing_data
        slot:
          type: integer
          description: Slot number
        poh_tick:
          type: string
          description: PoH tick position (BigInt as string)
        signer:
          type: string
          description: Wallet that signed the transaction
        pools:
          type: array
          items:
            type: object
            properties:
              pool_address:
                type: string
              pool_label:
                type: string
              dex_name:
                type: string
        incidents:
          type: array
          items:
            $ref: '#/components/schemas/SandwichIncident'
        sandwich_detected:
          type: boolean
          description: Whether a sandwich attack was detected
        success:
          type: boolean
          description: Whether the victim's transaction executed successfully
    SandwichIncident:
      type: object
      properties:
        attacker_signature:
          type: string
          description: Attacker's transaction signature
        attacker_signer:
          type: string
          description: Attacker's wallet address
        slot:
          type: integer
          description: Slot of the attacker's transaction
        poh_tick:
          type: string
          description: PoH tick position (BigInt as string)
        poh_tick_offset:
          type: string
          description: PoH tick distance from victim (negative = before)
        interaction_type:
          type: string
          enum:
            - sandwich_frontrun
            - sandwich_backrun
          description: Type of sandwich leg (only sandwich incidents are returned)
        pool_address:
          type: string
          description: DEX pool where the interaction occurred
        pool_label:
          type: string
          description: Human-readable pool label
        success:
          type: boolean
          description: Whether the attacker's transaction executed successfully
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key authentication. Format: `sk_live_xxx` (production) or
        `sk_test_xxx` (testing). Obtain your API key from the [Blockline
        Dashboard](https://blockline.soltop.sh/dashboard/api-keys).
    SupabaseJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Supabase JWT authentication. Used for MEV Analysis and Write Locks
        endpoints. Requires an active subscription (trial, active, or
        grace_period status).

````