openapi: 3.1.0
info: {}
paths:
  /sweetspot.api.v1.AuthService/Authenticate:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: Authenticate
      description: |-
        Exchange a signed nonce for a 6-hour keypair session token. UNAUTHENTICATED if the
         pubkey has no outstanding nonce, the nonce has expired, the signature
         is invalid, or the pubkey is not registered as a quoting authority.
      operationId: sweetspot.api.v1.AuthService.Authenticate
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.AuthenticateRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.AuthenticateResponse'
  /sweetspot.api.v1.AuthService/Challenge:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: Challenge
      description: |-
        Get a nonce to sign. Idempotent per pubkey within the nonce TTL;
         calling twice returns distinct nonces but only the most recent is
         accepted by Authenticate.
      operationId: sweetspot.api.v1.AuthService.Challenge
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.ChallengeRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.ChallengeResponse'
  /sweetspot.api.v1.AuthService/RequestLoginCode:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: RequestLoginCode
      description: |-
        Send a 6-digit passwordless login code to an organization user's email.
         Requests are limited to one per email per minute.
      operationId: sweetspot.api.v1.AuthService.RequestLoginCode
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.RequestLoginCodeRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.RequestLoginCodeResponse'
  /sweetspot.api.v1.AuthService/Revoke:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: Revoke
      description: Invalidate a token before its natural expiration.
      operationId: sweetspot.api.v1.AuthService.Revoke
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.RevokeRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.RevokeResponse'
  /sweetspot.api.v1.AuthService/VerifyLoginCode:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: VerifyLoginCode
      description: Exchange a passwordless login code for a 7-day bearer session token.
      operationId: sweetspot.api.v1.AuthService.VerifyLoginCode
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.VerifyLoginCodeRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.VerifyLoginCodeResponse'
  /sweetspot.api.v1.HistoricalService/GetCandles:
    post:
      tags:
        - sweetspot.api.v1.HistoricalService
      summary: GetCandles
      operationId: sweetspot.api.v1.HistoricalService.GetCandles
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetCandlesRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetCandlesResponse'
  /sweetspot.api.v1.HistoricalService/GetTrades:
    post:
      tags:
        - sweetspot.api.v1.HistoricalService
      summary: GetTrades
      operationId: sweetspot.api.v1.HistoricalService.GetTrades
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetTradesRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetTradesResponse'
  /sweetspot.api.v1.MakerService/GetBalance:
    post:
      tags:
        - sweetspot.api.v1.MakerService
      summary: GetBalance
      description: |-
        One-shot snapshot of current balances — useful on cold start before
         opening the stream.
      operationId: sweetspot.api.v1.MakerService.GetBalance
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetBalanceRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetBalanceResponse'
  /sweetspot.api.v1.MakerService/GetNavHistory:
    post:
      tags:
        - sweetspot.api.v1.MakerService
      summary: GetNavHistory
      description: |-
        Time-bucketed historical NAV (USD net asset value) scoped to the
         authenticated maker.
      operationId: sweetspot.api.v1.MakerService.GetNavHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetNavHistoryRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetNavHistoryResponse'
  /sweetspot.api.v1.MakerService/GetStats:
    post:
      tags:
        - sweetspot.api.v1.MakerService
      summary: GetStats
      description: |-
        Rolling 1s / 1m / 5m activity rates scoped to the authenticated maker:
         fill rate, TX submission outcomes, plus the venue-wide oracle update
         rate for cross-reference.
      operationId: sweetspot.api.v1.MakerService.GetStats
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetMakerStatsRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetMakerStatsResponse'
  /sweetspot.api.v1.MakerService/GetVolumeBreakdown:
    post:
      tags:
        - sweetspot.api.v1.MakerService
      summary: GetVolumeBreakdown
      description: |-
        1h / 24h / 30d volume + fill count broken down by pair, scoped to
         the authenticated maker.
      operationId: sweetspot.api.v1.MakerService.GetVolumeBreakdown
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetMakerVolumeBreakdownRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetMakerVolumeBreakdownResponse'
  /sweetspot.api.v1.MakerService/GetVolumeSeries:
    post:
      tags:
        - sweetspot.api.v1.MakerService
      summary: GetVolumeSeries
      description: Time-bucketed volume series scoped to the authenticated maker.
      operationId: sweetspot.api.v1.MakerService.GetVolumeSeries
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetMakerVolumeSeriesRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetMakerVolumeSeriesResponse'
  /sweetspot.api.v1.MakerService/SubscribeBalance: {}
  /sweetspot.api.v1.MakerService/SubscribeFills: {}
  /sweetspot.api.v1.MakerService/SubscribeMarketSnapshots: {}
  /sweetspot.api.v1.MarketDataService/GetBook:
    post:
      tags:
        - sweetspot.api.v1.MarketDataService
      summary: GetBook
      description: |-
        One-shot book snapshot. Convenient for cold-start reconciliation
         without opening a streaming RPC.
      operationId: sweetspot.api.v1.MarketDataService.GetBook
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetBookRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetBookResponse'
  /sweetspot.api.v1.MarketDataService/ListPairs:
    post:
      tags:
        - sweetspot.api.v1.MarketDataService
      summary: ListPairs
      description: Return the catalog of discovered pairs + their spot metadata.
      operationId: sweetspot.api.v1.MarketDataService.ListPairs
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.ListPairsRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.ListPairsResponse'
  /sweetspot.api.v1.MarketDataService/Subscribe: {}
  /sweetspot.api.v1.MarketDataService/SubscribeFills: {}
  /sweetspot.api.v1.MarketDataService/SubscribeMarketSnapshots: {}
  /sweetspot.api.v1.StatsService/GetAssetTvls:
    post:
      tags:
        - sweetspot.api.v1.StatsService
      summary: GetAssetTvls
      operationId: sweetspot.api.v1.StatsService.GetAssetTvls
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetAssetTvlsRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetAssetTvlsResponse'
  /sweetspot.api.v1.StatsService/GetSummary:
    post:
      tags:
        - sweetspot.api.v1.StatsService
      summary: GetSummary
      operationId: sweetspot.api.v1.StatsService.GetSummary
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetSummaryRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetSummaryResponse'
  /sweetspot.api.v1.StatsService/GetVolumeBreakdown:
    post:
      tags:
        - sweetspot.api.v1.StatsService
      summary: GetVolumeBreakdown
      description: 1h / 24h / 30d volume + fill count broken down by pair.
      operationId: sweetspot.api.v1.StatsService.GetVolumeBreakdown
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetVolumeBreakdownRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetVolumeBreakdownResponse'
  /sweetspot.api.v1.StatsService/GetVolumeSeries:
    post:
      tags:
        - sweetspot.api.v1.StatsService
      summary: GetVolumeSeries
      operationId: sweetspot.api.v1.StatsService.GetVolumeSeries
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.GetVolumeSeriesRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.GetVolumeSeriesResponse'
  /sweetspot.api.v1.TxService/SubmitTx:
    post:
      tags:
        - sweetspot.api.v1.TxService
      summary: SubmitTx
      description: |-
        Forward a transaction to upstream submission paths. Returns
         the parsed signature immediately; landing/confirmation are reported
         asynchronously on `SubscribeTxStatus`.
      operationId: sweetspot.api.v1.TxService.SubmitTx
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sweetspot.api.v1.SubmitTxRequest'
        required: true
      responses:
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sweetspot.api.v1.SubmitTxResponse'
  /sweetspot.api.v1.TxService/SubscribeBlockhash: {}
  /sweetspot.api.v1.TxService/SubscribeSlots: {}
  /sweetspot.api.v1.TxService/SubscribeTxStatus: {}
components:
  schemas:
    connect-protocol-version:
      type: number
      title: Connect-Protocol-Version
      enum:
        - 1
      description: Define the version of the Connect protocol
      const: 1
    connect-timeout-header:
      type: number
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        message:
          type: string
          description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/connect.error_details.Any'
          description: A list of messages that carry the error details. There is no limit on the number of messages.
      title: Connect Error
      additionalProperties: true
      description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation'
    connect.error_details.Any:
      type: object
      properties:
        type:
          type: string
          description: 'A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.'
        value:
          type: string
          format: binary
          description: The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.
        debug:
          oneOf:
            - type: object
              title: Any
              additionalProperties: true
              description: Detailed error information.
          discriminator:
            propertyName: type
          title: Debug
          description: Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.
      additionalProperties: true
      description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details.
    sweetspot.api.v1.AssetTvl:
      type: object
      properties:
        asset:
          title: asset
          $ref: '#/components/schemas/sweetspot.api.v1.SpotMetadata'
        totalBalance:
          title: total_balance
          description: |-
            Sum of every maker's balance for this spot, in token units (e.g.
             "1500.5" SOL — not atoms).
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        makerCount:
          type: integer
          title: maker_count
          description: How many makers currently hold a non-zero balance of this asset.
      title: AssetTvl
      additionalProperties: false
    sweetspot.api.v1.AuthenticateRequest:
      type: object
      properties:
        pubkey:
          title: pubkey
          $ref: '#/components/schemas/sweetspot.api.v1.Pubkey'
        signature:
          title: signature
          description: Signature over AUTH_DOMAIN_PREFIX || nonce from the outstanding Challenge.
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
      title: AuthenticateRequest
      additionalProperties: false
    sweetspot.api.v1.AuthenticateResponse:
      type: object
      properties:
        sessionToken:
          type: string
          title: session_token
          description: |-
            Opaque bearer token. Clients pass this back as
             `authorization: Bearer <session_token>` metadata on all authenticated RPCs.
        makerId:
          title: maker_id
          description: Resolved maker identity the token speaks for.
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        expiresAt:
          title: expires_at
          description: |-
            Absolute session expiration. Clients should re-auth before this
             moment; server will start returning UNAUTHENTICATED once it passes.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: AuthenticateResponse
      additionalProperties: false
    sweetspot.api.v1.BalanceUpdate:
      type: object
      properties:
        spotId:
          title: spot_id
          $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
        makerId:
          title: maker_id
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        balance:
          title: balance
          description: Token units (e.g. "1.5" SOL), not raw atoms.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
      title: BalanceUpdate
      additionalProperties: false
      description: |-
        Low-level per-spot balance sample, used by the indexer and by historical
         queries. `MakerBalanceEvent` is the streaming form.
    sweetspot.api.v1.Blockhash:
      type: object
      properties:
        hash:
          type: string
          title: hash
          format: byte
      title: Blockhash
      additionalProperties: false
    sweetspot.api.v1.BlockhashEvent:
      type: object
      properties:
        blockhash:
          title: blockhash
          $ref: '#/components/schemas/sweetspot.api.v1.Blockhash'
        recommendedCuPrice:
          type:
            - integer
            - string
          title: recommended_cu_price
          format: int64
          description: |-
            Server's current priority-fee recommendation (microlamports per CU)
             sampled from recent landed txs. Zero = no recommendation yet.
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: BlockhashEvent
      additionalProperties: false
    sweetspot.api.v1.Candle:
      type: object
      properties:
        ts:
          title: ts
          description: Candle open time.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        open:
          title: open
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        high:
          title: high
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        low:
          title: low
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        close:
          title: close
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        volume:
          title: volume
          description: Base-asset volume over the interval.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: Candle
      additionalProperties: false
    sweetspot.api.v1.CandleInterval:
      type: string
      title: CandleInterval
      enum:
        - CANDLE_INTERVAL_UNSPECIFIED
        - CANDLE_INTERVAL_1M
        - CANDLE_INTERVAL_5M
        - CANDLE_INTERVAL_15M
        - CANDLE_INTERVAL_30M
        - CANDLE_INTERVAL_1H
        - CANDLE_INTERVAL_4H
        - CANDLE_INTERVAL_1D
    sweetspot.api.v1.ChallengeRequest:
      type: object
      properties:
        pubkey:
          title: pubkey
          description: The pubkey (quoting authority) that will sign the challenge.
          $ref: '#/components/schemas/sweetspot.api.v1.Pubkey'
      title: ChallengeRequest
      additionalProperties: false
    sweetspot.api.v1.ChallengeResponse:
      type: object
      properties:
        nonce:
          type: string
          title: nonce
          format: byte
          description: Single-use random nonce. Client signs AUTH_DOMAIN_PREFIX || nonce.
        expiresAt:
          title: expires_at
          description: Absolute expiration. Server rejects Authenticate after this moment.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: ChallengeResponse
      additionalProperties: false
    sweetspot.api.v1.CrossVenueWindowStats:
      type: object
      properties:
        window:
          title: window
          $ref: '#/components/schemas/sweetspot.api.v1.StatsWindow'
        volumeQuote:
          title: volume_quote
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        fillCount:
          type:
            - integer
            - string
          title: fill_count
          format: int64
      title: CrossVenueWindowStats
      additionalProperties: false
      description: |-
        Cross-venue equivalent of `WindowStats`. `volume_base` is dropped — summing
         base across pairs with different base assets mixes denominations.
    sweetspot.api.v1.Decimal:
      type: object
      properties:
        value:
          type: string
          title: value
      title: Decimal
      additionalProperties: false
      description: |-
        Human-readable decimal string (e.g. "155.14"). The client must parse
         with a decimal library that matches rust_decimal semantics.
    sweetspot.api.v1.FeedLevel:
      type: string
      title: FeedLevel
      enum:
        - FEED_LEVEL_UNSPECIFIED
        - FEED_LEVEL_L1
        - FEED_LEVEL_L2
        - FEED_LEVEL_L3
    sweetspot.api.v1.FillEvent:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        side:
          title: side
          $ref: '#/components/schemas/sweetspot.api.v1.Side'
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: FillEvent
      additionalProperties: false
    sweetspot.api.v1.GetAssetTvlsRequest:
      type: object
      title: GetAssetTvlsRequest
      additionalProperties: false
    sweetspot.api.v1.GetAssetTvlsResponse:
      type: object
      properties:
        assets:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.AssetTvl'
          title: assets
      title: GetAssetTvlsResponse
      additionalProperties: false
    sweetspot.api.v1.GetBalanceRequest:
      type: object
      properties:
        spotIds:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
          title: spot_ids
          description: Optional per-spot filter; empty = all spots.
      title: GetBalanceRequest
      additionalProperties: false
    sweetspot.api.v1.GetBalanceResponse:
      type: object
      properties:
        balances:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.MakerBalanceEvent'
          title: balances
      title: GetBalanceResponse
      additionalProperties: false
    sweetspot.api.v1.GetBookRequest:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        level:
          title: level
          $ref: '#/components/schemas/sweetspot.api.v1.FeedLevel'
      title: GetBookRequest
      additionalProperties: false
    sweetspot.api.v1.GetBookResponse:
      type: object
      oneOf:
        - type: object
          properties:
            l1:
              title: l1
              $ref: '#/components/schemas/sweetspot.api.v1.L1Event'
          title: l1
          required:
            - l1
        - type: object
          properties:
            l2:
              title: l2
              $ref: '#/components/schemas/sweetspot.api.v1.L2SnapshotEvent'
          title: l2
          required:
            - l2
        - type: object
          properties:
            l3:
              title: l3
              $ref: '#/components/schemas/sweetspot.api.v1.L3SnapshotEvent'
          title: l3
          required:
            - l3
      title: GetBookResponse
      additionalProperties: false
    sweetspot.api.v1.GetCandlesRequest:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        interval:
          title: interval
          $ref: '#/components/schemas/sweetspot.api.v1.CandleInterval'
        start:
          title: start
          description: Inclusive lower bound.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        end:
          title: end
          description: Exclusive upper bound. Unset / zero-micros = now.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: GetCandlesRequest
      additionalProperties: false
    sweetspot.api.v1.GetCandlesResponse:
      type: object
      properties:
        candles:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Candle'
          title: candles
          description: Ordered oldest-first. Hard cap of 10_000 candles per response.
      title: GetCandlesResponse
      additionalProperties: false
    sweetspot.api.v1.GetMakerStatsRequest:
      type: object
      title: GetMakerStatsRequest
      additionalProperties: false
    sweetspot.api.v1.GetMakerStatsResponse:
      type: object
      properties:
        makerId:
          title: maker_id
          description: Echoed from the bearer token so the client can sanity-check the scope.
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        fills:
          title: fills
          description: Match events where this maker provided liquidity.
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
        transactionsSent:
          title: transactions_sent
          description: |-
            Transactions accepted from this maker by the server's TxService
             (counts every TX whose initial outcome was `Submitted`).
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
        transactionsLanded:
          title: transactions_landed
          description: Transactions confirmed on-chain (TxOutcome::Confirmed).
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
        transactionsFailed:
          title: transactions_failed
          description: |-
            Transactions that failed — rejected pre-submit, expired before landing,
             or landed with an error.
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
        oracleUpdates:
          title: oracle_updates
          description: |-
            Venue-wide oracle-fair update rate. Same value every maker observes —
             included so MMs can compare their request rate against oracle volatility.
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
      title: GetMakerStatsResponse
      additionalProperties: false
    sweetspot.api.v1.GetMakerVolumeBreakdownRequest:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Pair'
          title: pairs
          description: |-
            Optional pair filter. Empty = every pair the maker has fills in
             across the largest window (30d).
      title: GetMakerVolumeBreakdownRequest
      additionalProperties: false
      description: |-
        Per-maker volume breakdown. The authenticated maker_id is taken from
         the bearer token; clients only optionally narrow the pair set.
    sweetspot.api.v1.GetMakerVolumeBreakdownResponse:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.PairVolume'
          title: pairs
          description: Ordered by 24h volume descending.
      title: GetMakerVolumeBreakdownResponse
      additionalProperties: false
    sweetspot.api.v1.GetMakerVolumeSeriesRequest:
      type: object
      properties:
        pair:
          title: pair
          description: |-
            Optional pair filter. Absent = aggregate across every pair the maker
             has fills in.
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        window:
          title: window
          $ref: '#/components/schemas/sweetspot.api.v1.StatsWindow'
      title: GetMakerVolumeSeriesRequest
      additionalProperties: false
      description: |-
        Per-maker volume series. The authenticated maker_id is taken from the
         bearer token. Window selects both horizon and bucket width identically
         to `StatsService.GetVolumeSeries`.
    sweetspot.api.v1.GetMakerVolumeSeriesResponse:
      type: object
      properties:
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.VolumeBucket'
          title: buckets
          description: Ordered oldest-first.
        bucketSeconds:
          type: integer
          title: bucket_seconds
      title: GetMakerVolumeSeriesResponse
      additionalProperties: false
    sweetspot.api.v1.GetNavHistoryRequest:
      type: object
      properties:
        window:
          title: window
          $ref: '#/components/schemas/sweetspot.api.v1.StatsWindow'
      title: GetNavHistoryRequest
      additionalProperties: false
      description: |-
        Per-maker historical NAV (net asset value, USD). The authenticated
         maker_id is taken from the bearer token. Window selects both horizon and
         bucket width identically to `GetVolumeSeries`.
    sweetspot.api.v1.GetNavHistoryResponse:
      type: object
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.NavPoint'
          title: points
          description: Ordered oldest-first.
        bucketSeconds:
          type: integer
          title: bucket_seconds
      title: GetNavHistoryResponse
      additionalProperties: false
    sweetspot.api.v1.GetSponsoredPayersRequest:
      type: object
      title: GetSponsoredPayersRequest
      additionalProperties: false
      description: |-
        Retrieve the set of fee-payer pubkeys the server will pay tx fees for.
         Clients may use any returned pubkey as the `feePayer` of a submitted tx;
         the server then covers the SOL cost on landing.
    sweetspot.api.v1.GetSponsoredPayersResponse:
      type: object
      properties:
        payers:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Pubkey'
          title: payers
      title: GetSponsoredPayersResponse
      additionalProperties: false
    sweetspot.api.v1.GetSummaryRequest:
      type: object
      title: GetSummaryRequest
      additionalProperties: false
    sweetspot.api.v1.GetSummaryResponse:
      type: object
      properties:
        activePairs:
          type: integer
          title: active_pairs
          description: How many pairs the indexer has discovered and is streaming books for.
        activeMakers:
          type: integer
          title: active_makers
          description: How many makers are registered on-chain.
        oneHour:
          title: one_hour
          description: |-
            Cross-venue aggregates over each window — quote volume + fill count
             totalled across every pair.
          $ref: '#/components/schemas/sweetspot.api.v1.CrossVenueWindowStats'
        twentyFourHour:
          title: twenty_four_hour
          $ref: '#/components/schemas/sweetspot.api.v1.CrossVenueWindowStats'
        thirtyDay:
          title: thirty_day
          $ref: '#/components/schemas/sweetspot.api.v1.CrossVenueWindowStats'
        volumeQuoteAllTime:
          title: volume_quote_all_time
          description: |-
            All-time totals, computed from the events table since the archiver
             started recording.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        fillCountAllTime:
          type:
            - integer
            - string
          title: fill_count_all_time
          format: int64
        uniqueTraders24h:
          type: integer
          title: unique_traders_24h
          description: |-
            Distinct taker accounts seen in the last 24h. A rough proxy for active
             users.
        largestTrade24h:
          title: largest_trade_24h
          description: |-
            Largest single USDC-quoted trade in the last 24h by notional value
             (`size * price`). Absent if no USDC-quoted fills have happened.
          $ref: '#/components/schemas/sweetspot.api.v1.LargestTrade'
        updateRate:
          title: update_rate
          description: |-
            Cross-venue order-update rate — every observed change to a pair's
             virtual book (maker cancel/replace plus oracle moves).
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
        oracleUpdateRate:
          title: oracle_update_rate
          description: |-
            Cross-venue oracle-update rate — counts observed oracle fair changes
             across every spot market.
          $ref: '#/components/schemas/sweetspot.api.v1.UpdateRate'
      title: GetSummaryResponse
      additionalProperties: false
    sweetspot.api.v1.GetTradesRequest:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        start:
          title: start
          description: |-
            Inclusive lower bound. Unset / zero-micros = unbounded (server uses
             its retention window).
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        end:
          title: end
          description: Exclusive upper bound. Unset / zero-micros = now.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        limit:
          type: integer
          title: limit
          description: Max rows to return. Zero = server default (50). Hard cap 1000.
      title: GetTradesRequest
      additionalProperties: false
    sweetspot.api.v1.GetTradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Trade'
          title: trades
          description: Ordered newest-first.
      title: GetTradesResponse
      additionalProperties: false
    sweetspot.api.v1.GetVolumeBreakdownRequest:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Pair'
          title: pairs
          description: |-
            Optional pair filter. Empty = every pair the venue has fills for in
             the largest window (30d).
      title: GetVolumeBreakdownRequest
      additionalProperties: false
    sweetspot.api.v1.GetVolumeBreakdownResponse:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.PairVolume'
          title: pairs
          description: Ordered by 24h volume descending.
      title: GetVolumeBreakdownResponse
      additionalProperties: false
    sweetspot.api.v1.GetVolumeSeriesRequest:
      type: object
      properties:
        pair:
          title: pair
          description: Optional pair filter. Absent = cross-venue aggregate.
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        window:
          title: window
          description: |-
            Window selects both the time horizon and the bucket size:
               1H  → 60 × 1m buckets
               24H → 288 × 5m buckets
               30D → 720 × 1h buckets
          $ref: '#/components/schemas/sweetspot.api.v1.StatsWindow'
      title: GetVolumeSeriesRequest
      additionalProperties: false
    sweetspot.api.v1.GetVolumeSeriesResponse:
      type: object
      properties:
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.VolumeBucket'
          title: buckets
          description: Ordered oldest-first.
        bucketSeconds:
          type: integer
          title: bucket_seconds
          description: |-
            Width of each bucket in seconds — clients can label the X axis
             without having to repeat the server's window→interval mapping.
      title: GetVolumeSeriesResponse
      additionalProperties: false
    sweetspot.api.v1.HealthState:
      type: string
      title: HealthState
      enum:
        - HEALTH_STATE_UNSPECIFIED
        - HEALTH_STATE_HEALTHY
        - HEALTH_STATE_DEGRADED
        - HEALTH_STATE_HALTED
    sweetspot.api.v1.L1Event:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        metadata:
          title: metadata
          $ref: '#/components/schemas/sweetspot.api.v1.PairMetadata'
        bid:
          title: bid
          $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
        ask:
          title: ask
          $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
      title: L1Event
      additionalProperties: false
    sweetspot.api.v1.L2Level:
      type: object
      properties:
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: L2Level
      additionalProperties: false
    sweetspot.api.v1.L2SnapshotEvent:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        metadata:
          title: metadata
          $ref: '#/components/schemas/sweetspot.api.v1.PairMetadata'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: bids
        asks:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: asks
      title: L2SnapshotEvent
      additionalProperties: false
    sweetspot.api.v1.L2UpdateEvent:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        metadata:
          title: metadata
          $ref: '#/components/schemas/sweetspot.api.v1.PairMetadata'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: bids
        asks:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: asks
      title: L2UpdateEvent
      additionalProperties: false
    sweetspot.api.v1.L3Entry:
      type: object
      properties:
        makerId:
          title: maker_id
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: L3Entry
      additionalProperties: false
    sweetspot.api.v1.L3SnapshotEvent:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        metadata:
          title: metadata
          $ref: '#/components/schemas/sweetspot.api.v1.PairMetadata'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L3Entry'
          title: bids
        asks:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L3Entry'
          title: asks
      title: L3SnapshotEvent
      additionalProperties: false
    sweetspot.api.v1.L3UpdateEvent:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        metadata:
          title: metadata
          $ref: '#/components/schemas/sweetspot.api.v1.PairMetadata'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L3Entry'
          title: bids
        asks:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L3Entry'
          title: asks
      title: L3UpdateEvent
      additionalProperties: false
    sweetspot.api.v1.LargestTrade:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        notional:
          title: notional
          description: '`size * price`, in USDC for summary responses.'
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: LargestTrade
      additionalProperties: false
    sweetspot.api.v1.ListPairsRequest:
      type: object
      title: ListPairsRequest
      additionalProperties: false
    sweetspot.api.v1.ListPairsResponse:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.ListedPair'
          title: pairs
      title: ListPairsResponse
      additionalProperties: false
    sweetspot.api.v1.ListedPair:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        base:
          title: base
          $ref: '#/components/schemas/sweetspot.api.v1.SpotMetadata'
        lastPrice:
          title: last_price
          description: Last landed fill price for this pair. Absent until the server observes a fill.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        quote:
          title: quote
          $ref: '#/components/schemas/sweetspot.api.v1.SpotMetadata'
      title: ListedPair
      additionalProperties: false
    sweetspot.api.v1.MakerBalanceEvent:
      type: object
      properties:
        makerId:
          title: maker_id
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        spotId:
          title: spot_id
          $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
        balance:
          title: balance
          description: Token units (e.g. "1.5" SOL); server scales by SpotMetadata.decimals.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        notional:
          title: notional
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        softMaxBalance:
          title: soft_max_balance
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: MakerBalanceEvent
      additionalProperties: false
      description: |-
        Streaming form of a per-maker balance observation. Emitted whenever the
         underlying on-chain account updates. Always scoped to the authenticated
         maker — servers filter by the token's maker_id before fan-out, so a
         client never sees another maker's balances.
    sweetspot.api.v1.MakerFillEvent:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        makerId:
          title: maker_id
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        side:
          title: side
          $ref: '#/components/schemas/sweetspot.api.v1.Side'
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: MakerFillEvent
      additionalProperties: false
      description: |-
        Fill where the authenticated maker provided the liquidity. The `side`
         here is the maker's side (BUY = maker bought, SELL = maker sold) —
         the inverse of `FillEvent.side` on the public market-data stream,
         which carries the taker's side.
    sweetspot.api.v1.MakerId:
      type: object
      properties:
        id:
          type:
            - integer
            - string
          title: id
          format: int64
      title: MakerId
      additionalProperties: false
    sweetspot.api.v1.MakerMarketSnapshot:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        bestBid:
          title: best_bid
          $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
        bestAsk:
          title: best_ask
          $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
        bidDepthLevels:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: bid_depth_levels
        askDepthLevels:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: ask_depth_levels
        lastPrice:
          title: last_price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        makerBid:
          title: maker_bid
          description: Absent when the maker has no order on this side of this pair.
          $ref: '#/components/schemas/sweetspot.api.v1.MakerQuote'
        makerAsk:
          title: maker_ask
          $ref: '#/components/schemas/sweetspot.api.v1.MakerQuote'
      title: MakerMarketSnapshot
      additionalProperties: false
      description: |-
        Per-pair view that augments `MarketSnapshot` with the authenticated
         maker's own best bid / best ask + depth level.
    sweetspot.api.v1.MakerMarketState:
      type: object
      properties:
        spotId:
          title: spot_id
          $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
        orderSequence:
          type:
            - integer
            - string
          title: order_sequence
          format: int64
      title: MakerMarketState
      additionalProperties: false
    sweetspot.api.v1.MakerMarketsSnapshotEvent:
      type: object
      properties:
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        markets:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.MakerMarketSnapshot'
          title: markets
      title: MakerMarketsSnapshotEvent
      additionalProperties: false
    sweetspot.api.v1.MakerQuote:
      type: object
      properties:
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        level:
          type: integer
          title: level
      title: MakerQuote
      additionalProperties: false
      description: |-
        The authenticated maker's resting quote on one side of a pair plus
         its 0-indexed L2 depth level (0 = top of book). Aggregates across the
         maker's individual orders at their best price for that side.
    sweetspot.api.v1.MarketDataEvent:
      type: object
      oneOf:
        - type: object
          properties:
            l1:
              title: l1
              $ref: '#/components/schemas/sweetspot.api.v1.L1Event'
          title: l1
          required:
            - l1
        - type: object
          properties:
            l2Snapshot:
              title: l2_snapshot
              $ref: '#/components/schemas/sweetspot.api.v1.L2SnapshotEvent'
          title: l2_snapshot
          required:
            - l2Snapshot
        - type: object
          properties:
            l2Update:
              title: l2_update
              $ref: '#/components/schemas/sweetspot.api.v1.L2UpdateEvent'
          title: l2_update
          required:
            - l2Update
        - type: object
          properties:
            l3Snapshot:
              title: l3_snapshot
              $ref: '#/components/schemas/sweetspot.api.v1.L3SnapshotEvent'
          title: l3_snapshot
          required:
            - l3Snapshot
        - type: object
          properties:
            l3Update:
              title: l3_update
              $ref: '#/components/schemas/sweetspot.api.v1.L3UpdateEvent'
          title: l3_update
          required:
            - l3Update
        - type: object
          properties:
            status:
              title: status
              $ref: '#/components/schemas/sweetspot.api.v1.StatusEvent'
          title: status
          required:
            - status
      title: MarketDataEvent
      additionalProperties: false
    sweetspot.api.v1.MarketSnapshot:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        bestBid:
          title: best_bid
          $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
        bestAsk:
          title: best_ask
          $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
        bidDepthLevels:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: bid_depth_levels
        askDepthLevels:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.L2Level'
          title: ask_depth_levels
        lastPrice:
          title: last_price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: MarketSnapshot
      additionalProperties: false
      description: |-
        `slot` is per-market: different entries may carry different slots when
         only a subset of markets updated in the most recent envelope.
    sweetspot.api.v1.MarketsSnapshotEvent:
      type: object
      properties:
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        markets:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.MarketSnapshot'
          title: markets
      title: MarketsSnapshotEvent
      additionalProperties: false
    sweetspot.api.v1.NavPoint:
      type: object
      properties:
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        navUsd:
          title: nav_usd
          description: |-
            Total USD value of the maker's holdings in this bucket. Held assets with
             no available price are valued at 0; `unpriced_assets` flags when that
             makes the total a partial valuation.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        priceAsOf:
          title: price_as_of
          description: |-
            Freshness of the prices the NAV was computed from. Lets clients spot a
             valuation taken against carried-forward (stale) prices.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        pricedAssets:
          type: integer
          title: priced_assets
          description: Held assets that were priced into `nav_usd`.
        unpricedAssets:
          type: integer
          title: unpriced_assets
          description: |-
            Held assets with no price, counted as 0 in `nav_usd`. Non-zero means the
             total understates true NAV.
      title: NavPoint
      additionalProperties: false
    sweetspot.api.v1.Pair:
      type: object
      properties:
        base:
          title: base
          $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
        quote:
          title: quote
          $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
      title: Pair
      additionalProperties: false
    sweetspot.api.v1.PairMetadata:
      type: object
      properties:
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        updateId:
          type:
            - integer
            - string
          title: update_id
          format: int64
      title: PairMetadata
      additionalProperties: false
    sweetspot.api.v1.PairSubscription:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        level:
          title: level
          $ref: '#/components/schemas/sweetspot.api.v1.FeedLevel'
        snapshotOnly:
          type: boolean
          title: snapshot_only
          description: |-
            When true, the server emits a full snapshot on every book update and
             never sends deltas. When false (default), one snapshot on subscribe
             followed by incremental deltas.
      title: PairSubscription
      additionalProperties: false
    sweetspot.api.v1.PairVolume:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        oneHour:
          title: one_hour
          $ref: '#/components/schemas/sweetspot.api.v1.WindowStats'
        twentyFourHour:
          title: twenty_four_hour
          $ref: '#/components/schemas/sweetspot.api.v1.WindowStats'
        thirtyDay:
          title: thirty_day
          $ref: '#/components/schemas/sweetspot.api.v1.WindowStats'
        lastPrice:
          title: last_price
          description: Most recent landed fill price. Absent if no fills observed yet.
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
      title: PairVolume
      additionalProperties: false
      description: |-
        1h / 24h / 30d bundled together. All three are always populated even
         if a pair has no fills in the smaller windows (zero is meaningful).
    sweetspot.api.v1.Pubkey:
      type: object
      properties:
        key:
          type: string
          title: key
          format: byte
      title: Pubkey
      additionalProperties: false
    sweetspot.api.v1.RequestLoginCodeRequest:
      type: object
      properties:
        email:
          type: string
          title: email
      title: RequestLoginCodeRequest
      additionalProperties: false
    sweetspot.api.v1.RequestLoginCodeResponse:
      type: object
      title: RequestLoginCodeResponse
      additionalProperties: false
    sweetspot.api.v1.RevokeRequest:
      type: object
      properties:
        sessionToken:
          type: string
          title: session_token
      title: RevokeRequest
      additionalProperties: false
    sweetspot.api.v1.RevokeResponse:
      type: object
      title: RevokeResponse
      additionalProperties: false
    sweetspot.api.v1.Side:
      type: string
      title: Side
      enum:
        - SIDE_UNSPECIFIED
        - SIDE_BUY
        - SIDE_SELL
    sweetspot.api.v1.Signature:
      type: object
      properties:
        signature:
          type: string
          title: signature
          format: byte
      title: Signature
      additionalProperties: false
    sweetspot.api.v1.SlotEvent:
      type: object
      properties:
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: SlotEvent
      additionalProperties: false
    sweetspot.api.v1.SpotAssets:
      type: object
      properties:
        assets:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.SpotMetadata'
          title: assets
      title: SpotAssets
      additionalProperties: false
    sweetspot.api.v1.SpotId:
      type: object
      properties:
        id:
          type:
            - integer
            - string
          title: id
          format: int64
      title: SpotId
      additionalProperties: false
    sweetspot.api.v1.SpotMetadata:
      type: object
      properties:
        id:
          title: id
          $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
        name:
          type: string
          title: name
        mint:
          title: mint
          $ref: '#/components/schemas/sweetspot.api.v1.Pubkey'
        programId:
          title: program_id
          $ref: '#/components/schemas/sweetspot.api.v1.Pubkey'
        decimals:
          type: integer
          title: decimals
        atomsPerLots:
          type: integer
          title: atoms_per_lots
      title: SpotMetadata
      additionalProperties: false
    sweetspot.api.v1.StatsWindow:
      type: string
      title: StatsWindow
      enum:
        - STATS_WINDOW_UNSPECIFIED
        - STATS_WINDOW_1H
        - STATS_WINDOW_24H
        - STATS_WINDOW_30D
    sweetspot.api.v1.StatusEvent:
      type: object
      properties:
        state:
          title: state
          $ref: '#/components/schemas/sweetspot.api.v1.HealthState'
        pair:
          title: pair
          description: Absent = global scope, present = per-pair.
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        reason:
          type: string
          title: reason
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: StatusEvent
      additionalProperties: false
    sweetspot.api.v1.SubmitTxRequest:
      type: object
      properties:
        transaction:
          type: string
          title: transaction
          format: byte
          description: |-
            Serialized signed transaction bytes — legacy or v0. The server does
             not modify the tx; fee payer, recent blockhash, compute budget, and
             priority fee are all the client's choices.
      title: SubmitTxRequest
      additionalProperties: false
      description: |-
        Submit a fully signed Solana transaction. The server forwards the tx
         to its upstream RPC/jito paths; lifecycle events (ack/confirmed/failed)
         arrive on `SubscribeTxStatus`.
    sweetspot.api.v1.SubmitTxResponse:
      type: object
      properties:
        signature:
          title: signature
          description: |-
            Parsed signature from the submitted tx. Use this to correlate with
             subsequent TxAckEvent / TxConfirmedEvent / TxFailedEvent received
             on `SubscribeTxStatus`.
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
        ts:
          title: ts
          description: Server wall-clock timestamp the submission was accepted.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: SubmitTxResponse
      additionalProperties: false
    sweetspot.api.v1.SubscribeBalanceRequest:
      type: object
      properties:
        spotIds:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
          title: spot_ids
          description: |-
            Optional per-spot filter. Empty = every spot the authenticated maker
             has a balance in (base + quote of every pair they quote on).
      title: SubscribeBalanceRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeBlockhashRequest:
      type: object
      title: SubscribeBlockhashRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeFillsRequest:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Pair'
          title: pairs
          description: Per-pair filter. Empty = fills from every pair.
      title: SubscribeFillsRequest
      additionalProperties: false
      description: |-
        Separate stream so book subscribers don't have to pay to deserialize
         fills and vice versa.
    sweetspot.api.v1.SubscribeMakerFillsRequest:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Pair'
          title: pairs
          description: |-
            Optional per-pair filter. Empty = every pair the authenticated maker
             gets a fill on.
      title: SubscribeMakerFillsRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeMakerMarketSnapshotsRequest:
      type: object
      title: SubscribeMakerMarketSnapshotsRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeMarketSnapshotsRequest:
      type: object
      title: SubscribeMarketSnapshotsRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeRequest:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.PairSubscription'
          title: pairs
          description: Pairs to subscribe to with their desired feed level.
      title: SubscribeRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeSlotsRequest:
      type: object
      title: SubscribeSlotsRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeTxStatusRequest:
      type: object
      title: SubscribeTxStatusRequest
      additionalProperties: false
      description: |-
        Server streams status transitions for any tx submitted under the
         authenticated maker's session. No client-side filter — the maker_id
         on the session token scopes the stream.
    sweetspot.api.v1.Timestamp:
      type: object
      properties:
        micros:
          type:
            - integer
            - string
          title: micros
          format: int64
      title: Timestamp
      additionalProperties: false
      description: |-
        Unix microseconds since epoch. The single canonical timestamp unit
         across the entire API — events, responses, range queries. Field value
         `0` means "unspecified" (used on optional bounds in range queries and
         on absent event timestamps).
    sweetspot.api.v1.Trade:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        side:
          title: side
          $ref: '#/components/schemas/sweetspot.api.v1.Side'
        price:
          title: price
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        size:
          title: size
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: Trade
      additionalProperties: false
      description: Historical trade row. Same shape as the live `FillEvent`.
    sweetspot.api.v1.TxAckEvent:
      type: object
      properties:
        signature:
          title: signature
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: TxAckEvent
      additionalProperties: false
      description: Server has accepted the tx for submission (pre-confirmation).
    sweetspot.api.v1.TxConfirmedEvent:
      type: object
      properties:
        signature:
          title: signature
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: TxConfirmedEvent
      additionalProperties: false
      description: Tx landed and did not error.
    sweetspot.api.v1.TxFailedEvent:
      type: object
      properties:
        signature:
          title: signature
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
        reason:
          type: string
          title: reason
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: TxFailedEvent
      additionalProperties: false
      description: Tx landed but reverted, or timed out before landing.
    sweetspot.api.v1.TxStatusEvent:
      type: object
      oneOf:
        - type: object
          properties:
            ack:
              title: ack
              $ref: '#/components/schemas/sweetspot.api.v1.TxAckEvent'
          title: ack
          required:
            - ack
        - type: object
          properties:
            confirmed:
              title: confirmed
              $ref: '#/components/schemas/sweetspot.api.v1.TxConfirmedEvent'
          title: confirmed
          required:
            - confirmed
        - type: object
          properties:
            failed:
              title: failed
              $ref: '#/components/schemas/sweetspot.api.v1.TxFailedEvent'
          title: failed
          required:
            - failed
      title: TxStatusEvent
      additionalProperties: false
      description: Multiplexed tx-status stream envelope.
    sweetspot.api.v1.UpdateRate:
      type: object
      properties:
        perSecond1s:
          type: number
          title: per_second_1s
          format: double
          description: Updates within the trailing 1 second.
        perSecond1m:
          type: number
          title: per_second_1m
          format: double
          description: Average updates / second over the trailing 1 minute.
        perSecond5m:
          type: number
          title: per_second_5m
          format: double
          description: Average updates / second over the trailing 5 minutes.
      title: UpdateRate
      additionalProperties: false
      description: |-
        Rolling event rate. Used for both order updates and oracle updates on
         `GetSummaryResponse`.
    sweetspot.api.v1.VerifyLoginCodeRequest:
      type: object
      properties:
        email:
          type: string
          title: email
        code:
          type: string
          title: code
      title: VerifyLoginCodeRequest
      additionalProperties: false
    sweetspot.api.v1.VerifyLoginCodeResponse:
      type: object
      properties:
        sessionToken:
          type: string
          title: session_token
          description: |-
            Opaque bearer token. Clients pass this back as
             `authorization: Bearer <session_token>` metadata on MarketDataService.
        makerId:
          title: maker_id
          description: Resolved maker identity associated with the user's organization.
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        expiresAt:
          title: expires_at
          description: Absolute session expiration.
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        organizationName:
          type: string
          title: organization_name
      title: VerifyLoginCodeResponse
      additionalProperties: false
    sweetspot.api.v1.VolumeBucket:
      type: object
      properties:
        ts:
          title: ts
          description: Bucket start (inclusive).
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        volumeBase:
          title: volume_base
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        volumeQuote:
          title: volume_quote
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        fillCount:
          type:
            - integer
            - string
          title: fill_count
          format: int64
      title: VolumeBucket
      additionalProperties: false
    sweetspot.api.v1.WindowStats:
      type: object
      properties:
        window:
          title: window
          $ref: '#/components/schemas/sweetspot.api.v1.StatsWindow'
        volumeBase:
          title: volume_base
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        volumeQuote:
          title: volume_quote
          $ref: '#/components/schemas/sweetspot.api.v1.Decimal'
        fillCount:
          type:
            - integer
            - string
          title: fill_count
          format: int64
      title: WindowStats
      additionalProperties: false
      description: |-
        Per-pair volume + fill count over a single rolling window.
         `volume_quote = sum(size * price)` in the pair's quote asset.
security: []
tags:
  - name: sweetspot.api.v1.AuthService
    description: |-
      Issues session tokens. Keypair-auth tokens from Authenticate last 6 hours;
       passwordless organization tokens from VerifyLoginCode last 7 days.
       All RPCs are unauthenticated.
  - name: sweetspot.api.v1.MarketDataService
    description: Public market data.
  - name: sweetspot.api.v1.TxService
    description: |-
      Transaction support: chain-tip feeds (blockhash, slot), transaction
       submission, and per-tx lifecycle status.

       Every RPC on this service requires a keypair-auth session token via
       `authorization: Bearer <token>` metadata. The token's maker_id is used
       for rate limiting on the public streams and to scope which signatures
       show up on the status stream.
  - name: sweetspot.api.v1.HistoricalService
    description: |-
      Historical (ClickHouse-backed) queries. Every RPC requires a session
       token via `authorization: Bearer <token>` metadata.

       Hard constraints enforced by the server:
         - Maximum time window: 30 days.
         - `GetTrades.limit` capped at 1000.
         - `GetCandles` returns at most 10_000 rows per call.

       If the backing ClickHouse is not configured, every RPC returns
       FAILED_PRECONDITION.
  - name: sweetspot.api.v1.MakerService
    description: |-
      Per-maker queries + streaming. Every RPC requires organization-oriented
       auth: either a session token via `authorization: Bearer <token>` metadata
       whose maker_id exists in the organizations table (see AuthService), or an
       `x-api-key` organization API key. The resolved maker_id scopes all responses.
  - name: sweetspot.api.v1.StatsService
    description: Public (unauthenticated) aggregate stats about the exchange.
