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

# Analyze Trade Context

> Analyzes all transactions that touched a specific account (market) within ±N slots of your transaction. Shows PoH tick offsets to understand who traded before/after you. Essential for front-running and sandwich attack detection.



## OpenAPI

````yaml /api-reference/openapi.json post /analyze-trade
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:
  /analyze-trade:
    post:
      tags:
        - Trade Analysis
      summary: Analyze Trade Context
      description: >-
        Analyzes all transactions that touched a specific account (market)
        within ±N slots of your transaction. Shows PoH tick offsets to
        understand who traded before/after you. Essential for front-running and
        sandwich attack detection.
      operationId: analyzeTrade
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - signature
                - account_id
              properties:
                signature:
                  type: string
                  description: Your transaction signature (base58, 87-88 characters)
                  pattern: ^[1-9A-HJ-NP-Za-km-z]{87,88}$
                  example: >-
                    pHXgUjY4cVvi5orXuK3b66MBhF2W3MpXruRGKodqTWze7354iVQ66k1rWCzyWTU7UDeebojPTpW9ZmVv9Dn12cg
                account_id:
                  type: string
                  description: >-
                    The market/account ID you were trading on (base58, 32-44
                    characters)
                  pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
                  example: FnmStvzQ27Pm4U8r3M6gPD7mnk6ST6HwraPsoNmYpump
                slot_range:
                  type: integer
                  description: Number of slots before/after to search
                  default: 4
                  minimum: 1
                  maximum: 100
                  example: 4
                start_time:
                  type: integer
                  description: >-
                    Unix timestamp - start of time window to search for original
                    transaction (optional filter)
                  example: 1729368000
                end_time:
                  type: integer
                  description: >-
                    Unix timestamp - end of time window to search for original
                    transaction (optional filter)
                  example: 1729371600
                limit:
                  type: integer
                  description: Results per page (pagination)
                  default: 100
                  maximum: 1000
                  example: 100
                page:
                  type: integer
                  description: Page number for pagination
                  default: 1
                  minimum: 1
                  example: 1
            examples:
              basic:
                summary: Basic request
                value:
                  signature: >-
                    pHXgUjY4cVvi5orXuK3b66MBhF2W3MpXruRGKodqTWze7354iVQ66k1rWCzyWTU7UDeebojPTpW9ZmVv9Dn12cg
                  account_id: FnmStvzQ27Pm4U8r3M6gPD7mnk6ST6HwraPsoNmYpump
                  slot_range: 4
      responses:
        '200':
          description: Successful analysis
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      original_transaction:
                        $ref: '#/components/schemas/Transaction'
                      slot_range:
                        type: object
                        properties:
                          from:
                            type: integer
                            example: 370537737
                          to:
                            type: integer
                            example: 370537745
                          range:
                            type: integer
                            example: 4
                      results_by_slot:
                        type: array
                        items:
                          type: object
                          properties:
                            slot:
                              type: integer
                            slot_offset:
                              type: integer
                              description: >-
                                Negative = before, 0 = same slot, Positive =
                                after
                            transactions:
                              type: array
                              items:
                                allOf:
                                  - $ref: '#/components/schemas/Transaction'
                                  - type: object
                                    properties:
                                      poh_tick_offset:
                                        type: integer
                                        description: >-
                                          PoH tick difference from your
                                          transaction
                                      matched_in_read:
                                        type: boolean
                                      matched_in_written:
                                        type: boolean
                                      is_original:
                                        type: boolean
                            transaction_count:
                              type: integer
                      summary:
                        type: object
                        properties:
                          total_matching_transactions:
                            type: integer
                          displayed_in_page:
                            type: integer
                          slots_with_activity:
                            type: integer
                          earliest_poh_tick_offset:
                            type: integer
                          latest_poh_tick_offset:
                            type: integer
                  pagination:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      total_items:
                        type: integer
                      has_next_page:
                        type: boolean
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Validation failed
                details:
                  - signature format is invalid (expected base58, 87-88 chars)
                timestamp: '2025-10-02T15:30:45.123Z'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid API key
                details: API key is invalid or has been revoked
                timestamp: '2025-10-02T15:30:45.123Z'
        '403':
          description: Forbidden - Subscription required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Subscription required
                details: Active subscription (trial, active, or grace_period) required
                timestamp: '2025-10-02T15:30:45.123Z'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    properties:
                      retry_after_seconds:
                        type: integer
              example:
                error: Too many requests
                message: 'Rate limit: 6 requests per minute. Please try again later.'
                retry_after_seconds: 45
                timestamp: '2025-10-02T15:30:45.123Z'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Transaction:
      type: object
      properties:
        signature:
          type: string
          description: Base58-encoded transaction signature
          example: >-
            pHXgUjY4cVvi5orXuK3b66MBhF2W3MpXruRGKodqTWze7354iVQ66k1rWCzyWTU7UDeebojPTpW9ZmVv9Dn12cg
        signer:
          type: string
          description: Base58-encoded signer public key
          example: FnmStvzQ27Pm4U8r3M6gPD7mnk6ST6HwraPsoNmYpump
        slot:
          type: integer
          description: Solana slot number when transaction was processed
          example: 370537741
        poh_tick:
          type: integer
          description: Proof of History tick count
          example: 23714415424
        entry_index:
          type: integer
          description: Index of the entry within the slot
          example: 2
        tx_index:
          type: integer
          description: Index of the transaction within the entry
          example: 0
        timestamp:
          type: string
          format: date-time
          description: Transaction timestamp
          example: '2025-10-01T19:22:33Z'
        is_vote:
          type: integer
          description: Whether this is a vote transaction (0=false, 1=true)
          example: 0
        accounts_read_count:
          type: integer
          description: Number of accounts read by the transaction
          example: 22
        accounts_written_count:
          type: integer
          description: Number of accounts written by the transaction
          example: 35
    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
  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).

````