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

# getLookupTablesByAccounts

> Find address lookup tables containing all listed accounts. With bestSet: true, returns a greedy minimal LUT set optimized for transaction size reduction.

<Tip>
  **⚡ Powered by Solana Ridge DB**

  Find address lookup tables containing **all** listed accounts (intersection mode), or use `bestSet: true` to get a greedy minimal LUT set optimized for transaction size reduction.

  **Intersection mode** — returns LUTs where every account in your list appears.

  **Best set mode** — returns the smallest combination of LUTs that covers the most accounts, with `coveredAccounts` and `uncoveredAccounts` in the response. Tune with `maxLookupTables` (default 8), `candidateLimit` (default 5000), and `perAccountLimit` (default 500).
</Tip>

<Note>
  This method costs **1 credit** per call.
</Note>


## OpenAPI

````yaml getlookuptablesbyaccounts post /
openapi: 3.1.0
info:
  title: Solana RPC
  version: 1.0.0
  description: Solana RPC HTTP method reference.
servers:
  - url: https://rpc-mainnet.solanatracker.io
    description: Mainnet RPC endpoint
security: []
paths:
  /:
    post:
      summary: getLookupTablesByAccounts
      description: >-
        Find address lookup tables containing all listed accounts. With bestSet:
        true, returns a greedy minimal LUT set optimized for transaction size
        reduction.
      operationId: getlookuptablesbyaccounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  example: '2.0'
                  default: '2.0'
                  description: The JSON-RPC protocol version.
                id:
                  type: string
                  example: '1'
                  default: '1'
                  description: A unique identifier for the request.
                method:
                  type: string
                  enum:
                    - getLookupTablesByAccounts
                  example: getLookupTablesByAccounts
                  default: getLookupTablesByAccounts
                  description: The name of the RPC method to invoke.
                params:
                  type: array
                  description: Method parameters.
                  minItems: 1
                  maxItems: 1
                  items:
                    type: object
                    required:
                      - accounts
                    properties:
                      accounts:
                        type: array
                        items:
                          type: string
                        minItems: 1
                        description: >-
                          Account public keys that must all appear in each
                          returned LUT (intersection mode), or accounts to cover
                          (bestSet mode).
                      owner:
                        type: string
                        nullable: true
                        description: Optional authority filter.
                      limit:
                        type: integer
                        minimum: 1
                        maximum: 1000
                        default: 100
                      cursor:
                        type: string
                        nullable: true
                      bestSet:
                        type: boolean
                        default: false
                        description: >-
                          When true, return a greedy minimal LUT set for tx size
                          optimization instead of strict intersection.
                      maxLookupTables:
                        type: integer
                        default: 8
                        description: Maximum LUTs in the returned set (bestSet mode).
                      candidateLimit:
                        type: integer
                        default: 5000
                        description: Maximum candidate LUTs to consider (bestSet mode).
                      perAccountLimit:
                        type: integer
                        default: 500
                        description: >-
                          Maximum LUTs per account when building candidates
                          (bestSet mode).
            examples:
              intersection:
                summary: Intersection — LUTs containing all accounts
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getLookupTablesByAccounts
                  params:
                    - accounts:
                        - AccountApubkey11111111111111111111111111111
                        - AccountBpubkey22222222222222222222222222222
                      owner: null
                      limit: 100
                      cursor: null
              bestSet:
                summary: Best LUT set for tx optimization
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getLookupTablesByAccounts
                  params:
                    - accounts:
                        - AccountApubkey11111111111111111111111111111
                        - AccountBpubkey22222222222222222222222222222
                        - AccountCpubkey33333333333333333333333333333
                      bestSet: true
                      maxLookupTables: 8
                      candidateLimit: 5000
                      perAccountLimit: 500
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                  result:
                    type: object
                    properties:
                      lookupTables:
                        type: array
                        items:
                          type: object
                          properties:
                            pubkey:
                              type: string
                              description: Address lookup table public key.
                              example: LUTPubkey1111111111111111111111111111111
                            authority:
                              type: string
                              description: Authority wallet that owns this lookup table.
                              example: 9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p
                            deactivationSlot:
                              type: integer
                              description: >-
                                Slot at which the LUT was deactivated.
                                18446744073709551615 (u64::MAX) means the LUT is
                                still active.
                              example: 18446744073709552000
                            addressCount:
                              type: integer
                              description: Number of addresses stored in the lookup table.
                              example: 12
                            addresses:
                              type: array
                              items:
                                type: string
                              description: All addresses in the lookup table.
                            mints:
                              type: array
                              items:
                                type: string
                              description: Subset of addresses that are known token mints.
                            slot:
                              type: integer
                              description: Slot when the lookup table was last indexed.
                              example: 423867852
                            addressIndex:
                              type: integer
                              description: >-
                                Index of the matched account within the lookup
                                table.
                              example: 42
                            matchedAccounts:
                              type: array
                              items:
                                type: string
                              description: Accounts from the query that appear in this LUT.
                            matchedAddressIndices:
                              type: array
                              items:
                                type: integer
                              description: Indices of matched accounts within the LUT.
                            estimatedBytesSaved:
                              type: integer
                              description: >-
                                Estimated transaction size bytes saved by using
                                this LUT.
                              example: 31
                      nextCursor:
                        type: string
                        nullable: true
                      hasMore:
                        type: boolean
                      count:
                        type: integer
                      coveredAccounts:
                        type: array
                        items:
                          type: string
                        description: >-
                          Accounts covered by the returned LUT set (bestSet
                          mode).
                      uncoveredAccounts:
                        type: array
                        items:
                          type: string
                        description: >-
                          Accounts not covered by any returned LUT (bestSet
                          mode).
                      estimatedBytesSaved:
                        type: integer
                        description: >-
                          Total estimated bytes saved across the returned LUT
                          set (bestSet mode).
              examples:
                bestSet:
                  summary: Best LUT set response
                  value:
                    jsonrpc: '2.0'
                    id: 1
                    result:
                      lookupTables:
                        - pubkey: LUT1pubkey1111111111111111111111111111111111
                          authority: 9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p
                          deactivationSlot: 18446744073709552000
                          addressCount: 200
                          addresses:
                            - AccountApubkey11111111111111111111111111111
                            - AccountBpubkey22222222222222222222222222222
                          mints: []
                          slot: 423867852
                          matchedAccounts:
                            - AccountApubkey11111111111111111111111111111
                            - AccountBpubkey22222222222222222222222222222
                          matchedAddressIndices:
                            - 3
                            - 17
                          estimatedBytesSaved: 62
                      coveredAccounts:
                        - AccountApubkey11111111111111111111111111111
                        - AccountBpubkey22222222222222222222222222222
                      uncoveredAccounts:
                        - AccountCpubkey33333333333333333333333333333
                      estimatedBytesSaved: 62
                      count: 1
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
        '401':
          description: Unauthorized - Invalid or missing API key.
        '429':
          description: Too Many Requests - Rate limit exceeded.
        '503':
          description: Service Unavailable - The server is temporarily unavailable.
        '504':
          description: Gateway Timeout - The request timed out.
      security:
        - ApiKeyQuery: []
components:
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key

````