openapi: 3.1.0
info: {}
paths:
  /sweetspot.api.v1.AuthService/Authenticate:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: Authenticate
      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
      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/Revoke:
    post:
      tags:
        - sweetspot.api.v1.AuthService
      summary: Revoke
      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.BalanceService/Get:
    post:
      tags:
        - sweetspot.api.v1.BalanceService
      summary: Get
      operationId: sweetspot.api.v1.BalanceService.Get
      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.BalanceService/Subscribe: {}
  /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.MarketDataService/GetBook:
    post:
      tags:
        - sweetspot.api.v1.MarketDataService
      summary: GetBook
      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
      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.TxService/GetSponsoredPayers:
    post:
      tags:
        - sweetspot.api.v1.TxService
      summary: GetSponsoredPayers
      operationId: sweetspot.api.v1.TxService.GetSponsoredPayers
      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.GetSponsoredPayersRequest'
        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.GetSponsoredPayersResponse'
  /sweetspot.api.v1.TxService/SubmitTx:
    post:
      tags:
        - sweetspot.api.v1.TxService
      summary: SubmitTx
      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.AuthenticateRequest:
      type: object
      properties:
        pubkey:
          title: pubkey
          $ref: '#/components/schemas/sweetspot.api.v1.Pubkey'
        signature:
          title: signature
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
      title: AuthenticateRequest
      additionalProperties: false
    sweetspot.api.v1.AuthenticateResponse:
      type: object
      properties:
        sessionToken:
          type: string
          title: session_token
        makerId:
          title: maker_id
          $ref: '#/components/schemas/sweetspot.api.v1.MakerId'
        expiresAt:
          title: expires_at
          $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'
        atoms:
          type:
            - integer
            - string
          title: atoms
          format: int64
        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
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: BlockhashEvent
      additionalProperties: false
    sweetspot.api.v1.Candle:
      type: object
      properties:
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        open:
          type: number
          title: open
          format: double
        high:
          type: number
          title: high
          format: double
        low:
          type: number
          title: low
          format: double
        close:
          type: number
          title: close
          format: double
        volume:
          type: number
          title: volume
          format: double
      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
          $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
        expiresAt:
          title: expires_at
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: ChallengeResponse
      additionalProperties: false
    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.GetBalanceRequest:
      type: object
      properties:
        spotIds:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.SpotId'
          title: spot_ids
      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
          description: Only FEED_LEVEL_L2 and FEED_LEVEL_L3 are valid.
          $ref: '#/components/schemas/sweetspot.api.v1.FeedLevel'
      title: GetBookRequest
      additionalProperties: false
    sweetspot.api.v1.GetBookResponse:
      type: object
      oneOf:
        - 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
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        end:
          title: end
          $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
      title: GetCandlesResponse
      additionalProperties: false
    sweetspot.api.v1.GetSponsoredPayersRequest:
      type: object
      title: GetSponsoredPayersRequest
      additionalProperties: false
    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.GetTradesRequest:
      type: object
      properties:
        pair:
          title: pair
          $ref: '#/components/schemas/sweetspot.api.v1.Pair'
        start:
          title: start
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        end:
          title: end
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
        limit:
          type: integer
          title: limit
      title: GetTradesRequest
      additionalProperties: false
    sweetspot.api.v1.GetTradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Trade'
          title: trades
      title: GetTradesResponse
      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.ListPairsRequest:
      type: object
      title: ListPairsRequest
      additionalProperties: false
    sweetspot.api.v1.ListPairsResponse:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.Pair'
          title: pairs
        spots:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.SpotMetadata'
          title: spots
      title: ListPairsResponse
      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:
          type:
            - integer
            - string
          title: balance
          format: int64
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: MakerBalanceEvent
      additionalProperties: false
      description: |-
        Streaming form of a per-maker balance observation. Always scoped to the
         authenticated maker — the server filters by the token's maker_id before
         fan-out.
    sweetspot.api.v1.MakerId:
      type: object
      properties:
        id:
          type:
            - integer
            - string
          title: id
          format: int64
      title: MakerId
      additionalProperties: false
    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.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.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.Pubkey:
      type: object
      properties:
        key:
          type: string
          title: key
          format: byte
      title: Pubkey
      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.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
      title: SubmitTxRequest
      additionalProperties: false
    sweetspot.api.v1.SubmitTxResponse:
      type: object
      properties:
        signature:
          title: signature
          $ref: '#/components/schemas/sweetspot.api.v1.Signature'
        ts:
          title: ts
          $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.
      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
      title: SubscribeFillsRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeRequest:
      type: object
      properties:
        pairs:
          type: array
          items:
            $ref: '#/components/schemas/sweetspot.api.v1.PairSubscription'
          title: pairs
      title: SubscribeRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeSlotsRequest:
      type: object
      title: SubscribeSlotsRequest
      additionalProperties: false
    sweetspot.api.v1.SubscribeTxStatusRequest:
      type: object
      title: SubscribeTxStatusRequest
      additionalProperties: false
    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:
          type: number
          title: price
          format: double
        size:
          type: number
          title: size
          format: double
        slot:
          type:
            - integer
            - string
          title: slot
          format: int64
        ts:
          title: ts
          $ref: '#/components/schemas/sweetspot.api.v1.Timestamp'
      title: Trade
      additionalProperties: false
    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
    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
    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
    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
security: []
tags:
  - name: sweetspot.api.v1.AuthService
  - name: sweetspot.api.v1.BalanceService
    description: |-
      Per-maker balance queries + streaming. Every RPC requires a session token
       via `authorization: Bearer <token>` metadata.
  - name: sweetspot.api.v1.HistoricalService
    description: |-
      Historical (ClickHouse-backed) queries. Every RPC requires a session token
       via `authorization: Bearer <token>` metadata. Hard limits: 30-day window;
       `GetTrades.limit` capped at 1000; `GetCandles` capped at 10_000 rows.
       FAILED_PRECONDITION when the archiver is not configured.
  - name: sweetspot.api.v1.MarketDataService
    description: |-
      Public (unauthenticated) market data. Streaming RPCs are also exposed via
       the websocket feed for browser clients where gRPC streaming is awkward.
  - name: sweetspot.api.v1.TxService
