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

> ## Agent Instructions
> Rail402 is an x402 payment facilitator, Stellar-native Bazaar discovery layer, and agent tooling for the Stellar network. It currently targets stellar:testnet.
> The live testnet facilitator is https://facilitator.rail402.dev with endpoints /verify, /settle, /supported, /health, and /discovery/*.
> Payment amounts use 7-decimal SEP-41 integer (stroop) arithmetic. Never use floating-point math for amounts.
> Every rejection returns a machine-readable error code and a non-null human-readable reason. When explaining a failure, surface both.

# The analytics snapshot for a live dashboard

> All-time totals, trailing 24h/7d/30d activity windows (with new-participant counts),
facilitator market share, and the most active sellers of the last 30 days — one
poll-friendly response, cached ~15s server-side. `coverage` states which SAC transfers
this deployment's tail watches ("all" on testnet; a curated asset list on pubnet), so
absence of a payment is always interpretable.




## OpenAPI

````yaml /api-reference/explorer.openapi.yaml get /ecosystem
openapi: 3.1.0
info:
  title: Rail402 Explorer API
  version: 0.1.0
  summary: x402 payments explorer for Stellar
  description: >
    Read-only public API over x402 payment activity observed on Stellar. The
    explorer watches the

    ledger directly (Soroban RPC + Horizon), classifies x402 settlements
    structurally — no

    facilitator registration is required for a payment to appear — attributes
    each payment to the

    facilitator that submitted it, and enriches sellers via the x402 Bazaar.


    **Amounts** are stroop-scale integer strings (7 decimals). Every amount
    field has a

    `…Decimal` companion for display; never do arithmetic on the decimal form.


    **Confidence tiers** (every payment carries one; inference is never
    presented as fact):

    - `rail402` — submitted by the Rail402 deployment's published signer.

    - `verified-facilitator` — submitter matches a registered facilitator's live
    `/supported` signers.

    - `x402-shaped` — structurally an x402 settlement, submitter unknown.


    **History**: the full Soroban RPC retention window (~7 days) is backfilled
    for all

    facilitators including unknown ones, and every registry-verified
    facilitator's complete

    chain-epoch history (back to the 2025-12-17 testnet reset) is recovered from
    Horizon.

    Horizon-recovered rows have no `asset`/`assetCode` (that string only exists
    in event data);

    `assetContract` is always present.


    **Errors** are always `{ code, reason, retryable, details? }` — branch on
    `code`, never parse

    `reason`. CORS is open (`*`): browsers may call this API directly.
servers:
  - url: https://explorer-explorer.up.railway.app
    description: stellar:testnet
security: []
tags:
  - name: payments
    description: The payment stream and per-transaction detail
  - name: entities
    description: Sellers and facilitators
  - name: registry
    description: Facilitator self-registration
  - name: ops
    description: Health and metrics
paths:
  /ecosystem:
    get:
      tags:
        - payments
      summary: The analytics snapshot for a live dashboard
      description: >
        All-time totals, trailing 24h/7d/30d activity windows (with
        new-participant counts),

        facilitator market share, and the most active sellers of the last 30
        days — one

        poll-friendly response, cached ~15s server-side. `coverage` states which
        SAC transfers

        this deployment's tail watches ("all" on testnet; a curated asset list
        on pubnet), so

        absence of a payment is always interpretable.
      operationId: getEcosystem
      parameters:
        - name: network
          in: query
          schema:
            type: string
          description: CAIP-2 network id
      responses:
        '200':
          description: The ecosystem snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EcosystemSnapshot'
components:
  schemas:
    EcosystemSnapshot:
      type: object
      required:
        - generatedAt
        - networks
        - coverage
        - totals
        - windows
        - facilitators
        - topSellers
      properties:
        generatedAt:
          type: string
          format: date-time
        networks:
          type: array
          items:
            type: string
        coverage:
          type: array
          description: Which SAC transfers this deployment's tail watches, per network
          items:
            type: object
            required:
              - network
              - watchedSacs
            properties:
              network:
                type: string
              watchedSacs:
                description: '"all", or the list of watched SAC contract addresses'
                oneOf:
                  - type: string
                    enum:
                      - all
                  - type: array
                    items:
                      type: string
        totals:
          allOf:
            - $ref: '#/components/schemas/Stats'
          description: >-
            All-time aggregates; byAsset entries additionally carry
            totalDecimal/assetCode
        windows:
          type: object
          required:
            - 24h
            - 7d
            - 30d
          properties:
            24h:
              $ref: '#/components/schemas/EcosystemWindow'
            7d:
              $ref: '#/components/schemas/EcosystemWindow'
            30d:
              $ref: '#/components/schemas/EcosystemWindow'
        facilitators:
          type: array
          description: All-time share per facilitator, largest first
          items:
            type: object
            required:
              - facilitatorId
              - payments
              - share
              - windows
            properties:
              facilitatorId:
                type:
                  - string
                  - 'null'
                description: >-
                  null = structurally x402 but unattributed (the x402-shaped
                  tier)
              displayName:
                type: string
              verified:
                type: boolean
              payments:
                type: integer
              share:
                type: number
                description: Ratio of payment counts (not volume), 0..1
              windows:
                type: object
                description: Payment counts inside each trailing window
                properties:
                  24h:
                    type: integer
                  7d:
                    type: integer
                  30d:
                    type: integer
              lastPaymentAt:
                type: string
                format: date-time
        topSellers:
          type: array
          description: Most active sellers over the trailing 30 days (max 10)
          items:
            type: object
            required:
              - network
              - payTo
              - payments
              - uniqueBuyers
              - volume
              - lastPaymentAt
            properties:
              network:
                type: string
              payTo:
                type: string
              payments:
                type: integer
              uniqueBuyers:
                type: integer
              volume:
                type: array
                items:
                  $ref: '#/components/schemas/AssetVolume'
              lastPaymentAt:
                type: string
                format: date-time
              serviceName:
                type: string
                description: Bazaar name
                when known: null
    Stats:
      type: object
      required:
        - totalPayments
        - uniqueBuyers
        - uniqueSellers
        - byScheme
        - byConfidence
        - byAsset
      properties:
        totalPayments:
          type: integer
        uniqueBuyers:
          type: integer
        uniqueSellers:
          type: integer
        byScheme:
          type: object
          additionalProperties:
            type: integer
          example:
            exact: 653
            upto: 22
        byConfidence:
          type: object
          additionalProperties:
            type: integer
          example:
            rail402: 45
            verified-facilitator: 565
            x402-shaped: 65
        byAsset:
          type: array
          items:
            type: object
            required:
              - assetContract
              - count
              - total
            properties:
              assetContract:
                type: string
              asset:
                type: string
              count:
                type: integer
              total:
                type: string
                description: >-
                  BigInt-safe integer-string sum (never a float, never 64-bit
                  SQL)
        firstPaymentAt:
          type: string
          format: date-time
          description: >
            Earliest observed payment — the "data since" anchor. On mainnet this
            is the

            complete-history first for every watched/verified operator (Horizon
            retains full

            history); on testnet nothing older can exist (a chain reset wipes
            all upstream

            sources). It is an observation floor, not a network-wide "first
            ever" guarantee.
        lastPaymentAt:
          type: string
          format: date-time
    EcosystemWindow:
      type: object
      required:
        - payments
        - uniqueBuyers
        - uniqueSellers
        - newBuyers
        - newSellers
        - volume
      properties:
        payments:
          type: integer
        uniqueBuyers:
          type: integer
        uniqueSellers:
          type: integer
        newBuyers:
          type: integer
          description: Buyers whose first-ever observed payment falls inside this window
        newSellers:
          type: integer
        volume:
          type: array
          items:
            $ref: '#/components/schemas/AssetVolume'
    AssetVolume:
      type: object
      required:
        - assetContract
        - count
        - total
        - totalDecimal
      properties:
        assetContract:
          type: string
        asset:
          type: string
          description: SEP-11 asset string ("native" | "CODE:ISSUER")
        assetCode:
          type: string
        count:
          type: integer
        total:
          type: string
          description: BigInt-safe integer-string sum (never a float, never 64-bit SQL)
        totalDecimal:
          type: string
          description: Human amount

````