openapi: 3.1.0
info:
  title: API
  description: API documentation for API
  version: 1.0.0
paths:
  /flint.margin.user.v1.AccountService/BatchGetAccounts:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: BatchGetAccounts
      operationId: flint.margin.user.v1.AccountService.BatchGetAccounts
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.BatchGetAccountsRequest'
        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/flint.margin.user.v1.BatchGetAccountsResponse'
  /flint.margin.user.v1.AccountService/GetAccount:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetAccount
      operationId: flint.margin.user.v1.AccountService.GetAccount
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetAccountRequest'
        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/flint.margin.user.v1.GetAccountResponse'
  /flint.margin.user.v1.AccountService/GetAccountHistory:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetAccountHistory
      operationId: flint.margin.user.v1.AccountService.GetAccountHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetAccountHistoryRequest'
        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/flint.margin.user.v1.GetAccountHistoryResponse'
  /flint.margin.user.v1.AccountService/GetActionLimits:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetActionLimits
      operationId: flint.margin.user.v1.AccountService.GetActionLimits
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetActionLimitsRequest'
        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/flint.margin.user.v1.GetActionLimitsResponse'
  /flint.margin.user.v1.AccountService/GetActivity:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetActivity
      operationId: flint.margin.user.v1.AccountService.GetActivity
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetActivityRequest'
        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/flint.margin.user.v1.GetActivityResponse'
  /flint.margin.user.v1.AccountService/GetFills:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetFills
      operationId: flint.margin.user.v1.AccountService.GetFills
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetFillsRequest'
        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/flint.margin.user.v1.GetFillsResponse'
  /flint.margin.user.v1.AccountService/GetInterestHistory:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetInterestHistory
      operationId: flint.margin.user.v1.AccountService.GetInterestHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetInterestHistoryRequest'
        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/flint.margin.user.v1.GetInterestHistoryResponse'
  /flint.margin.user.v1.AccountService/GetPositionHistory:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetPositionHistory
      operationId: flint.margin.user.v1.AccountService.GetPositionHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetPositionHistoryRequest'
        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/flint.margin.user.v1.GetPositionHistoryResponse'
  /flint.margin.user.v1.AccountService/GetRankedAccounts:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetRankedAccounts
      operationId: flint.margin.user.v1.AccountService.GetRankedAccounts
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetRankedAccountsRequest'
        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/flint.margin.user.v1.GetRankedAccountsResponse'
  /flint.margin.user.v1.AccountService/GetTradingFees:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetTradingFees
      operationId: flint.margin.user.v1.AccountService.GetTradingFees
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetTradingFeesRequest'
        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/flint.margin.user.v1.GetTradingFeesResponse'
  /flint.margin.user.v1.AccountService/GetTradingLimits:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: GetTradingLimits
      operationId: flint.margin.user.v1.AccountService.GetTradingLimits
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetTradingLimitsRequest'
        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/flint.margin.user.v1.GetTradingLimitsResponse'
  /flint.margin.user.v1.AccountService/ListAccounts:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: ListAccounts
      operationId: flint.margin.user.v1.AccountService.ListAccounts
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListAccountsRequest'
        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/flint.margin.user.v1.ListAccountsResponse'
  /flint.margin.user.v1.AccountService/ListDelegates:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: ListDelegates
      operationId: flint.margin.user.v1.AccountService.ListDelegates
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListDelegatesRequest'
        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/flint.margin.user.v1.ListDelegatesResponse'
  /flint.margin.user.v1.AccountService/RenameAccount:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: RenameAccount
      operationId: flint.margin.user.v1.AccountService.RenameAccount
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.RenameAccountRequest'
        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/flint.margin.user.v1.RenameAccountResponse'
  /flint.margin.user.v1.AccountService/SimulateAction:
    post:
      tags:
        - flint.margin.user.v1.AccountService
      summary: SimulateAction
      operationId: flint.margin.user.v1.AccountService.SimulateAction
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.SimulateActionRequest'
        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/flint.margin.user.v1.SimulateActionResponse'
  /flint.margin.user.v1.AccountService/SubscribeAccount: {}
  /flint.margin.user.v1.AccountService/SubscribeAccounts: {}
  /flint.margin.user.v1.AccountService/SubscribeActivity: {}
  /flint.margin.user.v1.AccountService/SubscribeFills: {}
  /flint.margin.user.v1.ActionService/PreviewActions:
    post:
      tags:
        - flint.margin.user.v1.ActionService
      summary: |-
        Checks a batch of trader actions (orders, closes, cancels, settles,
         deposits, withdrawals, transfers, lending) for one margin account and
         returns a link to the trading app's review page, where the account owner
         reviews, excludes and signs them. Builds, signs, and sends nothing: the
         link carries intent only and grants nothing, and the app checks
         everything again before signing.
      description: |-
        Each action is checked alone against the account as it stands now;
         balances and positions are not chained through the batch. A deposit that
         funds an order, or two withdrawals that together overdraw, can each come
         back READY. Actions run in steps, keeping the request's order within one:
         1 deposits; 2 cancels, settles, lends, repays and borrows; 3 orders and
         closes; 4 withdrawals, transfers and redeems.

         Malformed input is INVALID_ARGUMENT, naming `actions[i].field`; problems
         with live state are BLOCKED rows. If any row is BLOCKED there is no link:
         fix or drop those actions and preview again. The link is also empty, with
         a warning, when no trading app is deployed for this cluster.
      operationId: flint.margin.user.v1.ActionService.PreviewActions
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.PreviewActionsRequest'
        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/flint.margin.user.v1.PreviewActionsResponse'
  /flint.margin.user.v1.FundingService/GetFundingPayments:
    post:
      tags:
        - flint.margin.user.v1.FundingService
      summary: GetFundingPayments
      operationId: flint.margin.user.v1.FundingService.GetFundingPayments
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetFundingPaymentsRequest'
        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/flint.margin.user.v1.GetFundingPaymentsResponse'
  /flint.margin.user.v1.FundingService/GetFundingRateHistory:
    post:
      tags:
        - flint.margin.user.v1.FundingService
      summary: GetFundingRateHistory
      operationId: flint.margin.user.v1.FundingService.GetFundingRateHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetFundingRateHistoryRequest'
        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/flint.margin.user.v1.GetFundingRateHistoryResponse'
  /flint.margin.user.v1.FundingService/GetFundingRates:
    post:
      tags:
        - flint.margin.user.v1.FundingService
      summary: GetFundingRates
      operationId: flint.margin.user.v1.FundingService.GetFundingRates
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetFundingRatesRequest'
        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/flint.margin.user.v1.GetFundingRatesResponse'
  /flint.margin.user.v1.FundingService/SubscribeFundingPayments: {}
  /flint.margin.user.v1.FundingService/SubscribeFundingRates: {}
  /flint.margin.user.v1.MarketDataService/GetCandles:
    post:
      tags:
        - flint.margin.user.v1.MarketDataService
      summary: GetCandles
      operationId: flint.margin.user.v1.MarketDataService.GetCandles
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.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/flint.margin.user.v1.GetCandlesResponse'
  /flint.margin.user.v1.MarketDataService/GetOrderBook:
    post:
      tags:
        - flint.margin.user.v1.MarketDataService
      summary: GetOrderBook
      operationId: flint.margin.user.v1.MarketDataService.GetOrderBook
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetOrderBookRequest'
        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/flint.margin.user.v1.GetOrderBookResponse'
  /flint.margin.user.v1.MarketDataService/GetTrades:
    post:
      tags:
        - flint.margin.user.v1.MarketDataService
      summary: GetTrades
      operationId: flint.margin.user.v1.MarketDataService.GetTrades
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.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/flint.margin.user.v1.GetTradesResponse'
  /flint.margin.user.v1.MarketDataService/SubscribeCandles: {}
  /flint.margin.user.v1.MarketDataService/SubscribeOrderBook: {}
  /flint.margin.user.v1.MarketDataService/SubscribeTrades: {}
  /flint.margin.user.v1.MarketService/GetMarket:
    post:
      tags:
        - flint.margin.user.v1.MarketService
      summary: GetMarket
      operationId: flint.margin.user.v1.MarketService.GetMarket
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetMarketRequest'
        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/flint.margin.user.v1.GetMarketResponse'
  /flint.margin.user.v1.MarketService/GetMarketHistory:
    post:
      tags:
        - flint.margin.user.v1.MarketService
      summary: GetMarketHistory
      operationId: flint.margin.user.v1.MarketService.GetMarketHistory
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetMarketHistoryRequest'
        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/flint.margin.user.v1.GetMarketHistoryResponse'
  /flint.margin.user.v1.MarketService/ListMarkets:
    post:
      tags:
        - flint.margin.user.v1.MarketService
      summary: ListMarkets
      operationId: flint.margin.user.v1.MarketService.ListMarkets
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListMarketsRequest'
        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/flint.margin.user.v1.ListMarketsResponse'
  /flint.margin.user.v1.MarketService/SubscribeMarkets: {}
  /flint.margin.user.v1.OrderService/GetOrder:
    post:
      tags:
        - flint.margin.user.v1.OrderService
      summary: GetOrder
      operationId: flint.margin.user.v1.OrderService.GetOrder
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetOrderRequest'
        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/flint.margin.user.v1.GetOrderResponse'
  /flint.margin.user.v1.OrderService/ListOrders:
    post:
      tags:
        - flint.margin.user.v1.OrderService
      summary: ListOrders
      operationId: flint.margin.user.v1.OrderService.ListOrders
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListOrdersRequest'
        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/flint.margin.user.v1.ListOrdersResponse'
  /flint.margin.user.v1.OrderService/PreviewOrder:
    post:
      tags:
        - flint.margin.user.v1.OrderService
      summary: PreviewOrder
      operationId: flint.margin.user.v1.OrderService.PreviewOrder
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.PreviewOrderRequest'
        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/flint.margin.user.v1.PreviewOrderResponse'
  /flint.margin.user.v1.OrderService/SubscribeOrders: {}
  /flint.margin.user.v1.PerpMarketService/GetMarketHistoryStats:
    post:
      tags:
        - flint.margin.user.v1.PerpMarketService
      summary: GetMarketHistoryStats
      operationId: flint.margin.user.v1.PerpMarketService.GetMarketHistoryStats
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetMarketHistoryStatsRequest'
        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/flint.margin.user.v1.GetMarketHistoryStatsResponse'
  /flint.margin.user.v1.PerpMarketService/GetMarketStats:
    post:
      tags:
        - flint.margin.user.v1.PerpMarketService
      summary: GetMarketStats
      operationId: flint.margin.user.v1.PerpMarketService.GetMarketStats
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetMarketStatsRequest'
        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/flint.margin.user.v1.GetMarketStatsResponse'
  /flint.margin.user.v1.PerpMarketService/GetPerpMarket:
    post:
      tags:
        - flint.margin.user.v1.PerpMarketService
      summary: GetPerpMarket
      operationId: flint.margin.user.v1.PerpMarketService.GetPerpMarket
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetPerpMarketRequest'
        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/flint.margin.user.v1.GetPerpMarketResponse'
  /flint.margin.user.v1.PerpMarketService/GetVolumeBreakdown:
    post:
      tags:
        - flint.margin.user.v1.PerpMarketService
      summary: GetVolumeBreakdown
      operationId: flint.margin.user.v1.PerpMarketService.GetVolumeBreakdown
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.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/flint.margin.user.v1.GetVolumeBreakdownResponse'
  /flint.margin.user.v1.PerpMarketService/GetVolumeSeries:
    post:
      tags:
        - flint.margin.user.v1.PerpMarketService
      summary: GetVolumeSeries
      operationId: flint.margin.user.v1.PerpMarketService.GetVolumeSeries
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.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/flint.margin.user.v1.GetVolumeSeriesResponse'
  /flint.margin.user.v1.PerpMarketService/ListPerpMarkets:
    post:
      tags:
        - flint.margin.user.v1.PerpMarketService
      summary: ListPerpMarkets
      operationId: flint.margin.user.v1.PerpMarketService.ListPerpMarkets
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListPerpMarketsRequest'
        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/flint.margin.user.v1.ListPerpMarketsResponse'
  /flint.margin.user.v1.PerpMarketService/SubscribeMarketStats: {}
  /flint.margin.user.v1.RiskService/GetInsuranceFund:
    post:
      tags:
        - flint.margin.user.v1.RiskService
      summary: GetInsuranceFund
      operationId: flint.margin.user.v1.RiskService.GetInsuranceFund
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetInsuranceFundRequest'
        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/flint.margin.user.v1.GetInsuranceFundResponse'
  /flint.margin.user.v1.RiskService/GetMarketOverview:
    post:
      tags:
        - flint.margin.user.v1.RiskService
      summary: GetMarketOverview
      operationId: flint.margin.user.v1.RiskService.GetMarketOverview
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetMarketOverviewRequest'
        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/flint.margin.user.v1.GetMarketOverviewResponse'
  /flint.margin.user.v1.RiskService/ListAccountsAtRisk:
    post:
      tags:
        - flint.margin.user.v1.RiskService
      summary: ListAccountsAtRisk
      operationId: flint.margin.user.v1.RiskService.ListAccountsAtRisk
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListAccountsAtRiskRequest'
        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/flint.margin.user.v1.ListAccountsAtRiskResponse'
  /flint.margin.user.v1.RiskService/ListLargestAccounts:
    post:
      tags:
        - flint.margin.user.v1.RiskService
      summary: ListLargestAccounts
      operationId: flint.margin.user.v1.RiskService.ListLargestAccounts
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.ListLargestAccountsRequest'
        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/flint.margin.user.v1.ListLargestAccountsResponse'
  /flint.margin.user.v1.RiskService/SimulateAccountRisk:
    post:
      tags:
        - flint.margin.user.v1.RiskService
      summary: SimulateAccountRisk
      operationId: flint.margin.user.v1.RiskService.SimulateAccountRisk
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.SimulateAccountRiskRequest'
        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/flint.margin.user.v1.SimulateAccountRiskResponse'
  /flint.margin.user.v1.RiskService/SubscribeAccountsAtRisk: {}
  /flint.margin.user.v1.SponsorshipService/GetSponsorshipPubkey:
    post:
      tags:
        - flint.margin.user.v1.SponsorshipService
      summary: GetSponsorshipPubkey
      operationId: flint.margin.user.v1.SponsorshipService.GetSponsorshipPubkey
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.GetSponsorshipPubkeyRequest'
        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/flint.margin.user.v1.GetSponsorshipPubkeyResponse'
  /flint.margin.user.v1.SponsorshipService/SponsorTransaction:
    post:
      tags:
        - flint.margin.user.v1.SponsorshipService
      summary: SponsorTransaction
      operationId: flint.margin.user.v1.SponsorshipService.SponsorTransaction
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.SponsorTransactionRequest'
        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/flint.margin.user.v1.SponsorTransactionResponse'
  /flint.margin.user.v1.notifications.NotificationService/DisableEmail:
    post:
      tags:
        - flint.margin.user.v1.notifications.NotificationService
      summary: DisableEmail
      description: |-
        Disables email and cancels pending verification for this account.
         Re-enabling email requires fresh verification.
      operationId: flint.margin.user.v1.notifications.NotificationService.DisableEmail
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/google.protobuf.Empty'
        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/flint.margin.user.v1.notifications.Settings'
  /flint.margin.user.v1.notifications.NotificationService/GetSettings:
    post:
      tags:
        - flint.margin.user.v1.notifications.NotificationService
      summary: GetSettings
      description: Returns current settings without enabling email delivery.
      operationId: flint.margin.user.v1.notifications.NotificationService.GetSettings
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/google.protobuf.Empty'
        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/flint.margin.user.v1.notifications.Settings'
  /flint.margin.user.v1.notifications.NotificationService/RequestEmailVerification:
    post:
      tags:
        - flint.margin.user.v1.notifications.NotificationService
      summary: RequestEmailVerification
      description: |-
        Sends a verification code. Requesting a code does not enable email or change
         the currently verified destination when requesting a replacement.
      operationId: flint.margin.user.v1.notifications.NotificationService.RequestEmailVerification
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.notifications.RequestEmailVerificationRequest'
        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/flint.margin.user.v1.notifications.RequestEmailVerificationResponse'
  /flint.margin.user.v1.notifications.NotificationService/VerifyEmail:
    post:
      tags:
        - flint.margin.user.v1.notifications.NotificationService
      summary: VerifyEmail
      description: |-
        Verifies a single-use code and enables the destination for new fills from
         verification onward, replacing any previous destination without a backlog.
      operationId: flint.margin.user.v1.notifications.NotificationService.VerifyEmail
      parameters:
        - name: Connect-Protocol-Version
          in: header
          description: Define the version of the Connect protocol
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
          example: 1
        - name: Connect-Timeout-Ms
          in: header
          description: Define the timeout, in ms
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
          example: 1000
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flint.margin.user.v1.notifications.VerifyEmailRequest'
        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/flint.margin.user.v1.notifications.Settings'
components:
  schemas:
    connect-protocol-version:
      type: number
      examples:
        - 1
      title: Connect-Protocol-Version
      description: Define the version of the Connect protocol
      const: 1
    connect-timeout-header:
      type: number
      examples:
        - 1000
      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`.'
        value:
          type: string
          format: byte
          description: The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.
        debug:
          type: object
          title: Debug
          additionalProperties: true
          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.
    flint.margin.user.v1.AccountAtRisk:
      type: object
      properties:
        account:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: account
        totalDepositedUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_deposited_usd
        totalBorrowedUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_borrowed_usd
        netAssetsUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: net_assets_usd
        maintenanceBufferUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_buffer_usd
          description: net_equity - maintenance_margin; negative means liquidatable.
        healthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: health_ratio
          description: Below 1 means liquidatable.
      title: AccountAtRisk
      additionalProperties: false
    flint.margin.user.v1.AccountHealth:
      type: object
      properties:
        netEquity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: net_equity
        initialMargin:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: initial_margin
          description: Required to borrow or withdraw collateral.
        maintenanceMargin:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_margin
        netExposure:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: net_exposure
        meetsInitialMargin:
          type: boolean
          title: meets_initial_margin
        meetsMaintenanceMargin:
          type: boolean
          title: meets_maintenance_margin
        freeCollateral:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: free_collateral
          description: net_equity minus initial_margin, floored at zero.
        deficit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deficit
          description: maintenance_margin minus net_equity, floored at zero.
        healthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: health_ratio
          description: net_equity / maintenance_margin; unset when maintenance margin is zero.
        canOpenPosition:
          type: boolean
          title: can_open_position
          description: Requires initial margin and positive equity.
        canBeBackstopped:
          type: boolean
          title: can_be_backstopped
          description: Whether a backstopper may take over the account's legs.
      title: AccountHealth
      additionalProperties: false
      description: Cross-margin account health in USD.
    flint.margin.user.v1.AccountHistoryPoint:
      type: object
      properties:
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
          description: Bucket start; uses its newest sample.
        observedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: observed_at
          description: Server observation time, not block time.
        slot:
          type: string
          title: slot
          format: int64
          description: Highest observed tip; may not increase between points.
        navUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: nav_usd
          description: Unweighted signed account value.
        pnlUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: pnl_usd
          description: nav_usd minus deposits; estimated and unset without complete ledger coverage.
        netExposure:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: net_exposure
        debtUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: debt_usd
        healthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: health_ratio
          description: net_equity / maintenance_margin; unset when maintenance margin is zero.
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: AccountHistoryPoint
      additionalProperties: false
      description: One archived account-value sample.
    flint.margin.user.v1.AccountRankingMetric:
      type: string
      title: AccountRankingMetric
      enum:
        - ACCOUNT_RANKING_METRIC_UNSPECIFIED
        - ACCOUNT_RANKING_METRIC_PNL
        - ACCOUNT_RANKING_METRIC_PNL_PERCENT
        - ACCOUNT_RANKING_METRIC_VOLUME
        - ACCOUNT_RANKING_METRIC_ACCOUNT_VALUE
        - ACCOUNT_RANKING_METRIC_OPEN_INTEREST
        - ACCOUNT_RANKING_METRIC_CLOSEST_TO_LIQUIDATION
        - ACCOUNT_RANKING_METRIC_LARGEST_LIQUIDATION
        - ACCOUNT_RANKING_METRIC_SHARPE_RATIO
    flint.margin.user.v1.AccountRankingSize:
      type: string
      title: AccountRankingSize
      enum:
        - ACCOUNT_RANKING_SIZE_UNSPECIFIED
        - ACCOUNT_RANKING_SIZE_USD_100
        - ACCOUNT_RANKING_SIZE_USD_1000
        - ACCOUNT_RANKING_SIZE_USD_10000
        - ACCOUNT_RANKING_SIZE_USD_100000
        - ACCOUNT_RANKING_SIZE_USD_1000000
    flint.margin.user.v1.AccountRankingTimeframe:
      type: string
      title: AccountRankingTimeframe
      enum:
        - ACCOUNT_RANKING_TIMEFRAME_UNSPECIFIED
        - ACCOUNT_RANKING_TIMEFRAME_DAY
        - ACCOUNT_RANKING_TIMEFRAME_WEEK
        - ACCOUNT_RANKING_TIMEFRAME_MONTH
        - ACCOUNT_RANKING_TIMEFRAME_ALL_TIME
    flint.margin.user.v1.AccountRef:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        owner:
          type: string
          title: owner
        isDelegate:
          type: boolean
          title: is_delegate
          description: True when the requested authority is a delegate rather than the owner.
        address:
          type: string
          title: address
        name:
          type: string
          title: name
          description: World-readable display label, including when is_name_public is false; empty when unset.
        isNamePublic:
          type: boolean
          title: is_name_public
          description: Whether the label is shown on rankings; defaults to false, not an access-control flag.
      title: AccountRef
      additionalProperties: false
    flint.margin.user.v1.AccountSnapshot:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        owner:
          type: string
          title: owner
        positions:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.SpotPosition'
          title: positions
        health:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountHealth'
          title: health
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        address:
          type: string
          title: address
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        perpPositions:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpPosition'
          title: perp_positions
        perpPositionsSupported:
          type: boolean
          title: perp_positions_supported
          description: False when combined spot/perp health is unavailable.
      title: AccountSnapshot
      additionalProperties: false
    flint.margin.user.v1.ActionDetail:
      type: object
      properties:
        label:
          type: string
          title: label
          description: For example "Est. fill".
        value:
          type: string
          title: value
          description: For example "102.31".
      title: ActionDetail
      additionalProperties: false
    flint.margin.user.v1.ActionLimit:
      type: object
      properties:
        amount:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: amount
          description: Token units; zero when unavailable.
        constraint:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.LimitConstraint'
          title: constraint
      title: ActionLimit
      additionalProperties: false
    flint.margin.user.v1.ActionOrderSide:
      type: string
      title: ActionOrderSide
      enum:
        - ACTION_ORDER_SIDE_UNSPECIFIED
        - ACTION_ORDER_SIDE_LONG
        - ACTION_ORDER_SIDE_SHORT
      description: UNSPECIFIED is INVALID_ARGUMENT.
    flint.margin.user.v1.ActionOrderType:
      type: string
      title: ActionOrderType
      enum:
        - ACTION_ORDER_TYPE_UNSPECIFIED
        - ACTION_ORDER_TYPE_MARKET
        - ACTION_ORDER_TYPE_LIMIT
      description: UNSPECIFIED is INVALID_ARGUMENT.
    flint.margin.user.v1.ActionPreviewRow:
      type: object
      properties:
        index:
          type: integer
          title: index
          description: The action's index in the request.
        step:
          type: integer
          title: step
          description: |-
            When it runs: 1 deposits; 2 cancels, settles, lends, repays and borrows;
             3 orders and closes; 4 withdrawals, transfers and redeems. Within a step
             the request's order is kept.
        title:
          type: string
          title: title
          description: The sentence the trading app shows for this action.
        status:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionPreviewStatus'
          title: status
        details:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.ActionDetail'
          title: details
        warnings:
          type: array
          items:
            type: string
          title: warnings
        blockedReason:
          type: string
          title: blocked_reason
      title: ActionPreviewRow
      additionalProperties: false
    flint.margin.user.v1.ActionPreviewStatus:
      type: string
      title: ActionPreviewStatus
      enum:
        - ACTION_PREVIEW_STATUS_UNSPECIFIED
        - ACTION_PREVIEW_STATUS_READY
        - ACTION_PREVIEW_STATUS_WARNING
        - ACTION_PREVIEW_STATUS_BLOCKED
    flint.margin.user.v1.ActionTimeInForce:
      type: string
      title: ActionTimeInForce
      enum:
        - ACTION_TIME_IN_FORCE_UNSPECIFIED
        - ACTION_TIME_IN_FORCE_GTC
        - ACTION_TIME_IN_FORCE_IOC
        - ACTION_TIME_IN_FORCE_FOK
    flint.margin.user.v1.ActivityEntry:
      type: object
      properties:
        kind:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActivityKind'
          title: kind
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
          description: Server observation time, not block time.
        signature:
          type: string
          title: signature
        amount:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: amount
          description: Unsigned token units moved; unset when unknown.
        valueUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: value_usd
          description: Estimated USD value at ingestion; unset without a usable price.
        liquidation:
          type: boolean
          title: liquidation
          description: True when this account was the liquidator.
        eventId:
          type: string
          title: event_id
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        perpSettlement:
          type: boolean
          title: perp_settlement
      title: ActivityEntry
      additionalProperties: false
    flint.margin.user.v1.ActivityKind:
      type: string
      title: ActivityKind
      enum:
        - ACTIVITY_KIND_UNSPECIFIED
        - ACTIVITY_KIND_DEPOSIT
        - ACTIVITY_KIND_WITHDRAW
        - ACTIVITY_KIND_LEND
        - ACTIVITY_KIND_REDEEM
        - ACTIVITY_KIND_BORROW
        - ACTIVITY_KIND_REPAY
        - ACTIVITY_KIND_SOCIALIZE_LOSS
    flint.margin.user.v1.AssetAction:
      type: object
      properties:
        asset:
          type: string
          title: asset
        amount:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: amount
      title: AssetAction
      additionalProperties: false
    flint.margin.user.v1.AssetPriceShock:
      type: object
      properties:
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        priceChange:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price_change
          description: Signed fractional price change in [-1, 10]; at most 20 unique spot IDs.
      title: AssetPriceShock
      additionalProperties: false
    flint.margin.user.v1.BatchGetAccountsRequest:
      type: object
      properties:
        traderIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_ids
          description: Required; at most 100 unique IDs. Results preserve request order.
      title: BatchGetAccountsRequest
      additionalProperties: false
    flint.margin.user.v1.BatchGetAccountsResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: accounts
        missingTraderIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: missing_trader_ids
          description: No local valued snapshot; does not prove on-chain absence.
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: BatchGetAccountsResponse
      additionalProperties: false
    flint.margin.user.v1.CancelOrderAction:
      type: object
      anyOf:
        - type: object
          properties:
            all:
              type: boolean
              title: all
              description: |-
                Every resting order on the market. Must be true; false is
                 INVALID_ARGUMENT. Resting orders aren't indexed by the server: whether
                 a single order still rests is checked by the app when the link opens.
          title: all
        - type: object
          properties:
            orderId:
              type: string
              title: order_id
              description: |-
                `<perpId>:<buy|sell>:<priceTicks>`, as the trading app names resting
                 orders.
          title: order_id
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - all
              - required:
                  - orderId
          - not:
              oneOf:
                - required:
                    - all
                - required:
                    - orderId
      properties:
        market:
          type: string
          title: market
      title: CancelOrderAction
      description: 'Set target: unset is INVALID_ARGUMENT.'
    flint.margin.user.v1.Candle:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        interval:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.CandleInterval'
          title: interval
        priceSource:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.CandlePriceSource'
          title: price_source
        openedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: opened_at
        closedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: closed_at
        open:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: open
        high:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: high
        low:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: low
        close:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: close
        volume:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: volume
        tradeCount:
          type: string
          title: trade_count
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: Candle
      additionalProperties: false
    flint.margin.user.v1.CandleInterval:
      type: string
      title: CandleInterval
      enum:
        - CANDLE_INTERVAL_UNSPECIFIED
        - CANDLE_INTERVAL_1_MINUTE
        - CANDLE_INTERVAL_5_MINUTES
        - CANDLE_INTERVAL_15_MINUTES
        - CANDLE_INTERVAL_1_HOUR
        - CANDLE_INTERVAL_4_HOURS
        - CANDLE_INTERVAL_1_DAY
    flint.margin.user.v1.CandlePriceSource:
      type: string
      title: CandlePriceSource
      enum:
        - CANDLE_PRICE_SOURCE_UNSPECIFIED
        - CANDLE_PRICE_SOURCE_TRADES
        - CANDLE_PRICE_SOURCE_MARK
        - CANDLE_PRICE_SOURCE_INDEX
    flint.margin.user.v1.ClosePositionAction:
      type: object
      properties:
        market:
          type: string
          title: market
        fraction:
          type: integer
          title: fraction
          description: |-
            Percent of the position to close at market: 25, 50, 75 or 100, else
             INVALID_ARGUMENT.
        maxSlippageBps:
          type:
            - integer
            - "null"
          title: max_slippage_bps
          description: 1 to 1000, as for a market order. Absent is 500, written into the link.
      title: ClosePositionAction
      additionalProperties: false
    flint.margin.user.v1.Commitment:
      type: string
      title: Commitment
      enum:
        - COMMITMENT_UNSPECIFIED
        - COMMITMENT_PROCESSED
        - COMMITMENT_CONFIRMED
        - COMMITMENT_FINALIZED
    flint.margin.user.v1.DataProvenance:
      type: object
      properties:
        commitment:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Commitment'
          title: commitment
        observedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: observed_at
        slot:
          type: string
          title: slot
          format: int64
        revision:
          type:
            - string
            - "null"
          title: revision
          format: int64
        forkReconciled:
          type: boolean
          title: fork_reconciled
      title: DataProvenance
      additionalProperties: false
      description: Observation metadata, not a claim that the node is caught up with the chain.
    flint.margin.user.v1.Decimal:
      type: object
      properties:
        value:
          type: string
          title: value
      title: Decimal
      additionalProperties: false
      description: Decimal string (e.g. "155.14"), parsed with rust_decimal-compatible semantics.
    flint.margin.user.v1.DelegateCredentialKind:
      type: string
      title: DelegateCredentialKind
      enum:
        - DELEGATE_CREDENTIAL_KIND_UNSPECIFIED
        - DELEGATE_CREDENTIAL_KIND_ED25519
        - DELEGATE_CREDENTIAL_KIND_PASSKEY
    flint.margin.user.v1.DelegateInfo:
      type: object
      properties:
        address:
          type: string
          title: address
        credentialKind:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DelegateCredentialKind'
          title: credential_kind
        authority:
          type: string
          title: authority
        scopeBits:
          type: integer
          title: scope_bits
        expiresAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: expires_at
        active:
          type: boolean
          title: active
      title: DelegateInfo
      additionalProperties: false
    flint.margin.user.v1.Fill:
      type: object
      properties:
        fillId:
          type: string
          title: fill_id
        orderId:
          type: string
          title: order_id
        clientOrderId:
          type: string
          title: client_order_id
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        side:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TradeSide'
          title: side
        price:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price
        quantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: quantity
        feeUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: fee_usd
        rebateUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: rebate_usd
        maker:
          type: boolean
          title: maker
        executedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: executed_at
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        realizedPnlUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: realized_pnl_usd
      title: Fill
      additionalProperties: false
    flint.margin.user.v1.FlowCap:
      type: object
      properties:
        depositCapped:
          type: boolean
          title: deposit_capped
        withdrawCapped:
          type: boolean
          title: withdraw_capped
        maxDeposit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_deposit
          description: Net-inflow ceiling in token units; unset when uncapped.
        maxWithdraw:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_withdraw
          description: Net-outflow ceiling, token units. Unset when uncapped.
        depositHeadroom:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_headroom
          description: Current token-unit headroom; unset when uncapped.
        withdrawHeadroom:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: withdraw_headroom
      title: FlowCap
      additionalProperties: false
      description: Per-market net-flow limiter.
    flint.margin.user.v1.FundingPayment:
      type: object
      properties:
        paymentId:
          type: string
          title: payment_id
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        amountUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: amount_usd
          description: Positive is a credit to the account; negative is a debit.
        positionQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: position_quantity
        fundingRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: funding_rate
        fundedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: funded_at
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: FundingPayment
      additionalProperties: false
    flint.margin.user.v1.FundingRate:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        rate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: rate
          description: Fraction per interval_seconds; positive means longs pay shorts.
        fundingAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: funding_at
        nextFundingAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: next_funding_at
        intervalSeconds:
          type: string
          title: interval_seconds
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: FundingRate
      additionalProperties: false
    flint.margin.user.v1.GetAccountHistoryRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
          description: Inclusive; unset selects 24 hours before end.
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
          description: Exclusive; unset selects now.
        resolutionSeconds:
          type: integer
          title: resolution_seconds
          description: Zero lets the server choose; non-zero is exact or INVALID_ARGUMENT.
        includePerpPnl:
          type: boolean
          title: include_perp_pnl
      title: GetAccountHistoryRequest
      additionalProperties: false
    flint.margin.user.v1.GetAccountHistoryResponse:
      type: object
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AccountHistoryPoint'
          title: points
          description: Oldest first; empty buckets are omitted.
        resolutionSeconds:
          type: integer
          title: resolution_seconds
          description: Actual bucket width.
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
        perpPnl:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpPnlHistory'
          title: perp_pnl
      title: GetAccountHistoryResponse
      additionalProperties: false
    flint.margin.user.v1.GetAccountRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
      title: GetAccountRequest
      additionalProperties: false
    flint.margin.user.v1.GetAccountResponse:
      type: object
      properties:
        account:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: account
      title: GetAccountResponse
      additionalProperties: false
    flint.margin.user.v1.GetActionLimitsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        spotIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_ids
          description: Empty selects every listed market.
      title: GetActionLimitsRequest
      additionalProperties: false
    flint.margin.user.v1.GetActionLimitsResponse:
      type: object
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarketActionLimits'
          title: markets
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetActionLimitsResponse
      additionalProperties: false
    flint.margin.user.v1.GetActivityRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
          description: Inclusive; unset selects the whole ledger.
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
          description: Exclusive; unset selects now.
        limit:
          type: integer
          title: limit
          description: Zero uses the default (50); maximum 1000.
        kinds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.ActivityKind'
          title: kinds
          description: Empty selects every kind; UNSPECIFIED values are ignored.
        pageToken:
          type: string
          title: page_token
      title: GetActivityRequest
      additionalProperties: false
    flint.margin.user.v1.GetActivityResponse:
      type: object
      properties:
        activities:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.ActivityEntry'
          title: activities
          description: |-
            Descending by slot, signature, instruction index, then event index;
             pagination is not a snapshot.
        nextPageToken:
          type: string
          title: next_page_token
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetActivityResponse
      additionalProperties: false
    flint.margin.user.v1.GetCandlesRequest:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        interval:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.CandleInterval'
          title: interval
        priceSource:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.CandlePriceSource'
          title: price_source
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: GetCandlesRequest
      additionalProperties: false
    flint.margin.user.v1.GetCandlesResponse:
      type: object
      properties:
        candles:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.Candle'
          title: candles
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetCandlesResponse
      additionalProperties: false
    flint.margin.user.v1.GetFillsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: GetFillsRequest
      additionalProperties: false
    flint.margin.user.v1.GetFillsResponse:
      type: object
      properties:
        fills:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.Fill'
          title: fills
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetFillsResponse
      additionalProperties: false
    flint.margin.user.v1.GetFundingPaymentsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: GetFundingPaymentsRequest
      additionalProperties: false
    flint.margin.user.v1.GetFundingPaymentsResponse:
      type: object
      properties:
        payments:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.FundingPayment'
          title: payments
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetFundingPaymentsResponse
      additionalProperties: false
    flint.margin.user.v1.GetFundingRateHistoryRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
        bucketSeconds:
          type: integer
          title: bucket_seconds
          description: |-
            0 returns every sample. Otherwise returns only each perp's last sample in every
             epoch-aligned bucket_seconds window of funding_at.
      title: GetFundingRateHistoryRequest
      additionalProperties: false
    flint.margin.user.v1.GetFundingRateHistoryResponse:
      type: object
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.FundingRate'
          title: rates
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetFundingRateHistoryResponse
      additionalProperties: false
    flint.margin.user.v1.GetFundingRatesRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: GetFundingRatesRequest
      additionalProperties: false
    flint.margin.user.v1.GetFundingRatesResponse:
      type: object
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.FundingRate'
          title: rates
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetFundingRatesResponse
      additionalProperties: false
    flint.margin.user.v1.GetInsuranceFundRequest:
      type: object
      title: GetInsuranceFundRequest
      additionalProperties: false
    flint.margin.user.v1.GetInsuranceFundResponse:
      type: object
      properties:
        fund:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.InsuranceFund'
          title: fund
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetInsuranceFundResponse
      additionalProperties: false
    flint.margin.user.v1.GetInterestHistoryRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        spotIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_ids
          description: Empty selects every observed spot asset.
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
          description: Inclusive. Unset / zero-micros selects 24 hours before end.
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
          description: Exclusive. Unset / zero-micros selects now.
        resolutionSeconds:
          type: integer
          title: resolution_seconds
          description: Zero lets the server choose a bucket width that fits its point limit.
      title: GetInterestHistoryRequest
      additionalProperties: false
    flint.margin.user.v1.GetInterestHistoryResponse:
      type: object
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.InterestHistoryPoint'
          title: points
        resolutionSeconds:
          type: integer
          title: resolution_seconds
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetInterestHistoryResponse
      additionalProperties: false
    flint.margin.user.v1.GetMarketHistoryRequest:
      type: object
      properties:
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
          description: Inclusive. Unset / zero-micros selects 24 hours before end.
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
          description: Exclusive. Unset / zero-micros selects now.
        resolutionSeconds:
          type: integer
          title: resolution_seconds
          description: Zero lets the server choose a bucket width that fits its point limit.
      title: GetMarketHistoryRequest
      additionalProperties: false
    flint.margin.user.v1.GetMarketHistoryResponse:
      type: object
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarketHistoryPoint'
          title: points
        resolutionSeconds:
          type: integer
          title: resolution_seconds
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetMarketHistoryResponse
      additionalProperties: false
    flint.margin.user.v1.GetMarketHistoryStatsRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
          description: Empty selects every perpetual market; servers accept at most 100 IDs.
      title: GetMarketHistoryStatsRequest
      additionalProperties: false
    flint.margin.user.v1.GetMarketHistoryStatsResponse:
      type: object
      properties:
        stats:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpMarketHistoryStats'
          title: stats
        asOf:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: as_of
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetMarketHistoryStatsResponse
      additionalProperties: false
    flint.margin.user.v1.GetMarketOverviewRequest:
      type: object
      properties:
        nonStablePriceChanges:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: non_stable_price_changes
          description: Simultaneous signed fractional non-stable oracle changes in [-1, 0]; empty uses defaults.
      title: GetMarketOverviewRequest
      additionalProperties: false
    flint.margin.user.v1.GetMarketOverviewResponse:
      type: object
      properties:
        overview:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ProtocolRiskOverview'
          title: overview
        markets:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarketRiskOverview'
          title: markets
        liquidationShocks:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.LiquidationShockRow'
          title: liquidation_shocks
          description: Request order, or ascending price fall when using defaults.
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetMarketOverviewResponse
      additionalProperties: false
    flint.margin.user.v1.GetMarketRequest:
      type: object
      properties:
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
      title: GetMarketRequest
      additionalProperties: false
    flint.margin.user.v1.GetMarketResponse:
      type: object
      properties:
        market:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.MarketInfo'
          title: market
      title: GetMarketResponse
      additionalProperties: false
    flint.margin.user.v1.GetMarketStatsRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: GetMarketStatsRequest
      additionalProperties: false
    flint.margin.user.v1.GetMarketStatsResponse:
      type: object
      properties:
        stats:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarketStats'
          title: stats
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetMarketStatsResponse
      additionalProperties: false
    flint.margin.user.v1.GetOrderBookRequest:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        depth:
          type: integer
          title: depth
      title: GetOrderBookRequest
      additionalProperties: false
    flint.margin.user.v1.GetOrderBookResponse:
      type: object
      properties:
        orderBook:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OrderBookSnapshot'
          title: order_book
      title: GetOrderBookResponse
      additionalProperties: false
    flint.margin.user.v1.GetOrderRequest:
      type: object
      anyOf:
        - type: object
          properties:
            clientOrderId:
              type: string
              title: client_order_id
          title: client_order_id
        - type: object
          properties:
            orderId:
              type: string
              title: order_id
          title: order_id
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - clientOrderId
              - required:
                  - orderId
          - not:
              oneOf:
                - required:
                    - clientOrderId
                - required:
                    - orderId
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
      title: GetOrderRequest
    flint.margin.user.v1.GetOrderResponse:
      type: object
      properties:
        order:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Order'
          title: order
      title: GetOrderResponse
      additionalProperties: false
    flint.margin.user.v1.GetPerpMarketRequest:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
      title: GetPerpMarketRequest
      additionalProperties: false
    flint.margin.user.v1.GetPerpMarketResponse:
      type: object
      properties:
        market:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpMarket'
          title: market
      title: GetPerpMarketResponse
      additionalProperties: false
    flint.margin.user.v1.GetPositionHistoryRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: GetPositionHistoryRequest
      additionalProperties: false
    flint.margin.user.v1.GetPositionHistoryResponse:
      type: object
      properties:
        positions:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PositionHistoryEntry'
          title: positions
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetPositionHistoryResponse
      additionalProperties: false
    flint.margin.user.v1.GetRankedAccountsRequest:
      type: object
      properties:
        metric:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountRankingMetric'
          title: metric
          description: All metrics sort descending except CLOSEST_TO_LIQUIDATION.
        timeframe:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountRankingTimeframe'
          title: timeframe
          description: |-
            Historical windows are rolling 24h, 7d, or 30d completed hours.
             Current-state rankings ignore this field and leave response windows unset.
        minimumAccountValue:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountRankingSize'
          title: minimum_account_value
          description: Minimum unweighted USD economic NAV.
        limit:
          type: integer
          title: limit
          description: Zero uses the default (20); maximum 100. Results are not paginated.
      title: GetRankedAccountsRequest
      additionalProperties: false
    flint.margin.user.v1.GetRankedAccountsResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.RankedAccount'
          title: accounts
        asOf:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: as_of
          description: Timestamp at which the ranking was built.
        windowStart:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: window_start
        windowEnd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: window_end
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        historyComplete:
          type: boolean
          title: history_complete
          description: Always false while processed archive history may have gaps.
      title: GetRankedAccountsResponse
      additionalProperties: false
    flint.margin.user.v1.GetSponsorshipPubkeyRequest:
      type: object
      title: GetSponsorshipPubkeyRequest
      additionalProperties: false
    flint.margin.user.v1.GetSponsorshipPubkeyResponse:
      type: object
      properties:
        pubkey:
          type: string
          title: pubkey
          description: Base58 fee payer; leave its signature slot empty for the server.
      title: GetSponsorshipPubkeyResponse
      additionalProperties: false
    flint.margin.user.v1.GetTradesRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: GetTradesRequest
      additionalProperties: false
    flint.margin.user.v1.GetTradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PublicTrade'
          title: trades
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetTradesResponse
      additionalProperties: false
    flint.margin.user.v1.GetTradingFeesRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: GetTradingFeesRequest
      additionalProperties: false
    flint.margin.user.v1.GetTradingFeesResponse:
      type: object
      properties:
        fees:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TradingFees'
          title: fees
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetTradingFeesResponse
      additionalProperties: false
    flint.margin.user.v1.GetTradingLimitsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: GetTradingLimitsRequest
      additionalProperties: false
    flint.margin.user.v1.GetTradingLimitsResponse:
      type: object
      properties:
        limits:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TradingLimits'
          title: limits
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: GetTradingLimitsResponse
      additionalProperties: false
    flint.margin.user.v1.GetVolumeBreakdownRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
          description: Empty selects every perpetual market.
      title: GetVolumeBreakdownRequest
      additionalProperties: false
    flint.margin.user.v1.GetVolumeBreakdownResponse:
      type: object
      properties:
        perps:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpVolume'
          title: perps
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetVolumeBreakdownResponse
      additionalProperties: false
    flint.margin.user.v1.GetVolumeSeriesRequest:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
          description: Unset aggregates every perpetual market.
        window:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.StatsWindow'
          title: window
      title: GetVolumeSeriesRequest
      additionalProperties: false
    flint.margin.user.v1.GetVolumeSeriesResponse:
      type: object
      properties:
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.VolumeBucket'
          title: buckets
          description: Ordered oldest first, including empty buckets.
        bucketSeconds:
          type: integer
          title: bucket_seconds
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: GetVolumeSeriesResponse
      additionalProperties: false
    flint.margin.user.v1.HistoryCoverage:
      type: object
      properties:
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        complete:
          type: boolean
          title: complete
        reason:
          type: string
          title: reason
      title: HistoryCoverage
      additionalProperties: false
      description: Effective query window [start, end). Complete only when coverage is proven.
    flint.margin.user.v1.InsuranceFund:
      type: object
      properties:
        address:
          type: string
          title: address
        borrowLendSocializeLossMaxDraw:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_lend_socialize_loss_max_draw
          description: Maximum fraction one socialize-loss instruction may draw; 1 permits all.
        balances:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.InsuranceFundBalance'
          title: balances
        complete:
          type: boolean
          title: complete
          description: False when the fund or a listed market vault was not observed.
        unavailableReason:
          type: string
          title: unavailable_reason
      title: InsuranceFund
      additionalProperties: false
    flint.margin.user.v1.InsuranceFundBalance:
      type: object
      properties:
        asset:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotMetadata'
          title: asset
        vault:
          type: string
          title: vault
        balance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: balance
      title: InsuranceFundBalance
      additionalProperties: false
    flint.margin.user.v1.InterestHistoryPoint:
      type: object
      properties:
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
          description: Start of the requested bucket.
        earned:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: earned
          description: Token interest earned; unset when the ledger cannot establish it.
        paid:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: paid
          description: Token interest paid; unset when the ledger cannot establish it.
        unavailableReason:
          type: string
          title: unavailable_reason
          description: Why one or both values are absent. Empty only when both are known.
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: InterestHistoryPoint
      additionalProperties: false
    flint.margin.user.v1.InterestRateCurve:
      type: object
      properties:
        targetUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: target_utilisation
          description: Curve kink; bounded on-chain to [0.05, 0.95].
        aprAtZero:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: apr_at_zero
        aprAtTarget:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: apr_at_target
        aprAtFull:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: apr_at_full
      title: InterestRateCurve
      additionalProperties: false
      description: Live piecewise-linear borrow-rate curve in utilisation.
    flint.margin.user.v1.LimitConstraint:
      type: string
      title: LimitConstraint
      enum:
        - LIMIT_CONSTRAINT_UNSPECIFIED
        - LIMIT_CONSTRAINT_BALANCE
        - LIMIT_CONSTRAINT_INITIAL_MARGIN
        - LIMIT_CONSTRAINT_POOL_LIQUIDITY
        - LIMIT_CONSTRAINT_UTILISATION_THROTTLE
        - LIMIT_CONSTRAINT_MARKET_CAP
        - LIMIT_CONSTRAINT_FLOW_CAP
        - LIMIT_CONSTRAINT_OPERATION_DISABLED
        - LIMIT_CONSTRAINT_POSITION_LIMIT
      description: Constraint on an action amount.
    flint.margin.user.v1.LiquidationShockRow:
      type: object
      properties:
        nonStablePriceChange:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: non_stable_price_change
        liquidatableAccountCount:
          type: string
          title: liquidatable_account_count
          format: int64
        badDebtAccountCount:
          type:
            - string
            - "null"
          title: bad_debt_account_count
          format: int64
          description: Unset when unavailable; liquidation_usd and bad_debt_usd are then unset too.
        liquidationUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: liquidation_usd
          description: Debt value a liquidation would transfer, including its buffer.
        badDebtUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: bad_debt_usd
        deficitUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deficit_usd
      title: LiquidationShockRow
      additionalProperties: false
    flint.margin.user.v1.ListAccountsAtRiskRequest:
      type: object
      properties:
        minAccountSizeUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: min_account_size_usd
          description: Gross unweighted deposits in USD; unset bounds are open.
        maxAccountSizeUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_account_size_usd
        maxHealthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_health_ratio
          description: Maximum health ratio; unset uses the configured threshold. Accounts without one are excluded.
        liquidatableOnly:
          type:
            - boolean
            - "null"
          title: liquidatable_only
          description: True restricts results to liquidatable accounts.
        pageSize:
          type: integer
          title: page_size
          description: Zero uses the server default.
        pageToken:
          type: string
          title: page_token
          description: Opaque token anchoring pagination to one risk snapshot.
      title: ListAccountsAtRiskRequest
      additionalProperties: false
    flint.margin.user.v1.ListAccountsAtRiskResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AccountAtRisk'
          title: accounts
          description: Ordered by health ratio ascending, account size descending, then trader ID ascending.
        totalCount:
          type: string
          title: total_count
          format: int64
          description: Total matching accounts across all pages.
        nextPageToken:
          type: string
          title: next_page_token
        maxHealthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_health_ratio
          description: Effective health-ratio cutoff.
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: ListAccountsAtRiskResponse
      additionalProperties: false
    flint.margin.user.v1.ListAccountsRequest:
      type: object
      properties:
        authority:
          type: string
          title: authority
          description: Base58 owner or delegate pubkey.
      title: ListAccountsRequest
      additionalProperties: false
    flint.margin.user.v1.ListAccountsResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AccountRef'
          title: accounts
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: ListAccountsResponse
      additionalProperties: false
    flint.margin.user.v1.ListDelegatesRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        includeInactive:
          type: boolean
          title: include_inactive
      title: ListDelegatesRequest
      additionalProperties: false
    flint.margin.user.v1.ListDelegatesResponse:
      type: object
      properties:
        delegates:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.DelegateInfo'
          title: delegates
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: ListDelegatesResponse
      additionalProperties: false
    flint.margin.user.v1.ListLargestAccountsRequest:
      type: object
      properties:
        pageSize:
          type: integer
          title: page_size
          description: Zero uses the server default.
        pageToken:
          type: string
          title: page_token
          description: Opaque token anchoring pagination to one risk snapshot.
      title: ListLargestAccountsRequest
      additionalProperties: false
    flint.margin.user.v1.ListLargestAccountsResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AccountAtRisk'
          title: accounts
          description: |-
            Ordered by gross supplied assets descending, then trader ID ascending.
             Accounts without maintenance margin remain included with no health ratio.
        totalCount:
          type: string
          title: total_count
          format: int64
          description: Total accounts across all pages.
        nextPageToken:
          type: string
          title: next_page_token
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: ListLargestAccountsResponse
      additionalProperties: false
    flint.margin.user.v1.ListMarketsRequest:
      type: object
      title: ListMarketsRequest
      additionalProperties: false
    flint.margin.user.v1.ListMarketsResponse:
      type: object
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarketInfo'
          title: markets
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: ListMarketsResponse
      additionalProperties: false
    flint.margin.user.v1.ListOrdersRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.OrderStatus'
          title: statuses
        start:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: start
        end:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: end
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: ListOrdersRequest
      additionalProperties: false
    flint.margin.user.v1.ListOrdersResponse:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.Order'
          title: orders
        nextPageToken:
          type: string
          title: next_page_token
        coverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.HistoryCoverage'
          title: coverage
      title: ListOrdersResponse
      additionalProperties: false
    flint.margin.user.v1.ListPerpMarketsRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpMarketStatus'
          title: statuses
        pageSize:
          type: integer
          title: page_size
        pageToken:
          type: string
          title: page_token
      title: ListPerpMarketsRequest
      additionalProperties: false
    flint.margin.user.v1.ListPerpMarketsResponse:
      type: object
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpMarket'
          title: markets
        nextPageToken:
          type: string
          title: next_page_token
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: ListPerpMarketsResponse
      additionalProperties: false
    flint.margin.user.v1.MarginTier:
      type: object
      properties:
        minPositionNotionalUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: min_position_notional_usd
        initialMarginRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: initial_margin_rate
        maintenanceMarginRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_margin_rate
      title: MarginTier
      additionalProperties: false
    flint.margin.user.v1.MarketActionLimits:
      type: object
      properties:
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        deposit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionLimit'
          title: deposit
        withdraw:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionLimit'
          title: withdraw
        lend:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionLimit'
          title: lend
        redeem:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionLimit'
          title: redeem
        borrow:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionLimit'
          title: borrow
        repay:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionLimit'
          title: repay
      title: MarketActionLimits
      additionalProperties: false
      description: Per-market action limits at the response state; they may change before submission.
    flint.margin.user.v1.MarketFlags:
      type: object
      properties:
        depositEnabled:
          type: boolean
          title: deposit_enabled
        withdrawEnabled:
          type: boolean
          title: withdraw_enabled
        lendEnabled:
          type: boolean
          title: lend_enabled
        borrowEnabled:
          type: boolean
          title: borrow_enabled
        redeemEnabled:
          type: boolean
          title: redeem_enabled
      title: MarketFlags
      additionalProperties: false
      description: Operations currently accepted by the market.
    flint.margin.user.v1.MarketHistoryPoint:
      type: object
      properties:
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
          description: Start of the requested bucket. Empty buckets are omitted.
        observedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: observed_at
          description: Newest coherent observation in the bucket.
        slot:
          type: string
          title: slot
          format: int64
        depositApr:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_apr
        borrowApr:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_apr
        utilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: utilisation
        vaultUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: vault_utilisation
        totalDeposits:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_deposits
        totalBorrows:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_borrows
        totalIsolatedDeposit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_isolated_deposit
        depositSharePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_share_price
        borrowSharePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_share_price
        oraclePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: oracle_price
        protocolFee:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: protocol_fee
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        availableLiquidity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: available_liquidity
      title: MarketHistoryPoint
      additionalProperties: false
    flint.margin.user.v1.MarketInfo:
      type: object
      properties:
        asset:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotMetadata'
          title: asset
        depositWeight:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_weight
          description: Deposit-value haircut for collateral.
        borrowImf:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_imf
        borrowMmf:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_mmf
        oraclePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: oracle_price
          description: USD per token unit.
        depositSharePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_share_price
          description: Token units per pool share.
        borrowSharePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_share_price
        totalDeposits:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_deposits
          description: Total supplied token units, including isolated deposits.
        totalBorrows:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_borrows
        utilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: utilisation
          description: total_borrows / total_deposits; distinct from vault_utilisation.
        depositApr:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_apr
          description: Nominal annual rates at current utilisation.
        borrowApr:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_apr
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        liquidationBonus:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: liquidation_bonus
          description: Collateral bonus per unit of debt repaid by a liquidator.
        lendingRateFee:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: lending_rate_fee
          description: Protocol share of interest, already reflected in deposit_apr.
        protocolFee:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: protocol_fee
          description: Unpaid protocol interest in token units.
        throttleBorrowUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: throttle_borrow_utilisation
          description: Vault utilisation at or above which the chain rejects a new borrow.
        throttleRedeemUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: throttle_redeem_utilisation
          description: Vault utilisation at which the chain rejects redeeming lent deposits.
        depositLimit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_limit
          description: Total-asset ceiling in token units; unset when uncapped.
        borrowLimit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_limit
          description: Pool-borrow ceiling in token units; unset when uncapped.
        flags:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.MarketFlags'
          title: flags
        flowCap:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.FlowCap'
          title: flow_cap
        totalIsolatedDeposit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_isolated_deposit
          description: Idle, unlent deposits in token units.
        vaultUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: vault_utilisation
          description: total_borrows / lent pool; capped at 1.
        availableLiquidity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: available_liquidity
          description: Current borrow/redeem headroom in token units.
        totalDepositShares:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_deposit_shares
          description: Raw pool-share totals.
        totalBorrowShares:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_borrow_shares
        lastAccrualAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: last_accrual_at
          description: Interest-accrual time; share prices and APRs are as of this time.
        rateCurve:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.InterestRateCurve'
          title: rate_curve
        address:
          type: string
          title: address
        vault:
          type: string
          title: vault
        oracle:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OracleInfo'
          title: oracle
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: MarketInfo
      additionalProperties: false
      description: Lending-market state. Token amounts are token units.
    flint.margin.user.v1.MarketRiskOverview:
      type: object
      properties:
        market:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.MarketInfo'
          title: market
        isStable:
          type: boolean
          title: is_stable
          description: Held fixed in liquidation-shock scenarios.
        totalDepositedUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_deposited_usd
        totalBorrowedUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_borrowed_usd
        availableLiquidityUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: available_liquidity_usd
        netDepositsUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: net_deposits_usd
        depositLimitUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_limit_usd
          description: USD market caps; unset when uncapped.
        borrowLimitUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_limit_usd
        depositLimitHeadroomUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_limit_headroom_usd
          description: Remaining cap headroom, floored at zero; unset when uncapped.
        borrowLimitHeadroomUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_limit_headroom_usd
        initialBorrowWeight:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: initial_borrow_weight
          description: 'Debt-value factors: 1 + borrow_imf and 1 + borrow_mmf.'
        maintenanceBorrowWeight:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_borrow_weight
        depositLimitUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_limit_utilisation
          description: Cap usage; may exceed 1 after a cap reduction and is unset when uncapped.
        borrowLimitUtilisation:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_limit_utilisation
      title: MarketRiskOverview
      additionalProperties: false
    flint.margin.user.v1.MarketStats:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        markPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: mark_price
        indexPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: index_price
        oraclePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: oracle_price
        lastTradePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: last_trade_price
        bestBidPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: best_bid_price
        bestAskPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: best_ask_price
        volume24h:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: volume_24h
        priceChange24h:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price_change_24h
          description: Fractional price change over the trailing 24 hours.
        openInterest:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: open_interest
          description: Base units, counted once per matched long/short pair.
        fundingRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: funding_rate
        nextFundingAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: next_funding_at
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        fundingIntervalSeconds:
          type: string
          title: funding_interval_seconds
          format: int64
        bestBidQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: best_bid_quantity
          description: Base quantity available at the best quoted price.
        bestAskQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: best_ask_quantity
      title: MarketStats
      additionalProperties: false
    flint.margin.user.v1.MonitoredAccountAtRisk:
      type: object
      properties:
        account:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: account
        status:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.MonitoredAccountStatus'
          title: status
      title: MonitoredAccountAtRisk
      additionalProperties: false
    flint.margin.user.v1.MonitoredAccountStatus:
      type: string
      title: MonitoredAccountStatus
      enum:
        - MONITORED_ACCOUNT_STATUS_UNSPECIFIED
        - MONITORED_ACCOUNT_STATUS_WATCHING
        - MONITORED_ACCOUNT_STATUS_LIQUIDATABLE
        - MONITORED_ACCOUNT_STATUS_UNAVAILABLE
    flint.margin.user.v1.OracleInfo:
      type: object
      properties:
        lastSyncedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: last_synced_at
        validUntil:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: valid_until
          description: On-chain reads after this time are rejected.
        oracleId:
          type: integer
          title: oracle_id
          description: Registry oracle ID; markets with the same ID share a price.
        sources:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.OracleSource'
          title: sources
          description: Configured slots in order; empty until indexed.
      title: OracleInfo
      additionalProperties: false
      description: Market oracle source and cache freshness.
    flint.margin.user.v1.OracleProvider:
      type: string
      title: OracleProvider
      enum:
        - ORACLE_PROVIDER_UNSPECIFIED
        - ORACLE_PROVIDER_DEV
        - ORACLE_PROVIDER_PYTH
        - ORACLE_PROVIDER_CHAINLINK
    flint.margin.user.v1.OracleSource:
      type: object
      properties:
        provider:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OracleProvider'
          title: provider
        feed:
          type: string
          title: feed
          description: Base58 source account.
      title: OracleSource
      additionalProperties: false
      description: One oracle source slot.
    flint.margin.user.v1.Order:
      type: object
      properties:
        orderId:
          type: string
          title: order_id
        clientOrderId:
          type: string
          title: client_order_id
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        side:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TradeSide'
          title: side
        orderType:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OrderType'
          title: order_type
        timeInForce:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TimeInForce'
          title: time_in_force
        status:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OrderStatus'
          title: status
        quantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: quantity
        filledQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: filled_quantity
        remainingQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: remaining_quantity
        limitPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: limit_price
        triggerPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: trigger_price
        reduceOnly:
          type: boolean
          title: reduce_only
        postOnly:
          type: boolean
          title: post_only
        createdAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: created_at
        updatedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: updated_at
        expiresAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: expires_at
        rejectionReason:
          type: string
          title: rejection_reason
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: Order
      additionalProperties: false
    flint.margin.user.v1.OrderBookLevel:
      type: object
      properties:
        price:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price
        quantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: quantity
        orderCount:
          type: string
          title: order_count
          format: int64
      title: OrderBookLevel
      additionalProperties: false
    flint.margin.user.v1.OrderBookSnapshot:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        bids:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.OrderBookLevel'
          title: bids
        asks:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.OrderBookLevel'
          title: asks
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: OrderBookSnapshot
      additionalProperties: false
    flint.margin.user.v1.OrderStatus:
      type: string
      title: OrderStatus
      enum:
        - ORDER_STATUS_UNSPECIFIED
        - ORDER_STATUS_OPEN
        - ORDER_STATUS_PARTIALLY_FILLED
        - ORDER_STATUS_FILLED
        - ORDER_STATUS_CANCELLED
        - ORDER_STATUS_REJECTED
        - ORDER_STATUS_EXPIRED
        - ORDER_STATUS_TRIGGERED
    flint.margin.user.v1.OrderType:
      type: string
      title: OrderType
      enum:
        - ORDER_TYPE_UNSPECIFIED
        - ORDER_TYPE_LIMIT
        - ORDER_TYPE_MARKET
        - ORDER_TYPE_STOP_MARKET
        - ORDER_TYPE_STOP_LIMIT
        - ORDER_TYPE_TAKE_PROFIT_MARKET
        - ORDER_TYPE_TAKE_PROFIT_LIMIT
    flint.margin.user.v1.PerpId:
      type: object
      properties:
        id:
          type: integer
          title: id
      title: PerpId
      additionalProperties: false
    flint.margin.user.v1.PerpMarket:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        symbol:
          type: string
          title: symbol
        baseAsset:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotMetadata'
          title: base_asset
        quoteAsset:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotMetadata'
          title: quote_asset
        settlementAsset:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotMetadata'
          title: settlement_asset
        tickSize:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: tick_size
        lotSize:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: lot_size
        minOrderQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: min_order_quantity
        maxOrderQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_order_quantity
        maxPositionNotionalUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_position_notional_usd
        initialMarginRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: initial_margin_rate
        maintenanceMarginRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_margin_rate
        status:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpMarketStatus'
          title: status
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
        marginTiers:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarginTier'
          title: margin_tiers
        maxOpenInterest:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_open_interest
      title: PerpMarket
      additionalProperties: false
    flint.margin.user.v1.PerpMarketHistoryStats:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        volume24hUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: volume_24h_usd
          description: Trailing 24-hour USD volume; absent if unknown or unpriced.
        priceChange24hFraction:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price_change_24h_fraction
          description: 'Fractional price change: current / reference - 1.'
        priceChangeReferenceAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: price_change_reference_at
          description: Candle end for the exact minute [minute(as_of) - 24h - 1m, minute(as_of) - 24h).
        priceChangeAsOf:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: price_change_as_of
          description: Candle end for the latest traded minute in [minute(as_of) - 4m, as_of), capped at as_of.
      title: PerpMarketHistoryStats
      additionalProperties: false
    flint.margin.user.v1.PerpMarketStatus:
      type: string
      title: PerpMarketStatus
      enum:
        - PERP_MARKET_STATUS_UNSPECIFIED
        - PERP_MARKET_STATUS_ACTIVE
        - PERP_MARKET_STATUS_PAUSED
        - PERP_MARKET_STATUS_REDUCE_ONLY
        - PERP_MARKET_STATUS_SETTLING
        - PERP_MARKET_STATUS_CLOSED
    flint.margin.user.v1.PerpPnlHistory:
      type: object
      properties:
        points:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpPnlHistoryPoint'
          title: points
      title: PerpPnlHistory
      additionalProperties: false
    flint.margin.user.v1.PerpPnlHistoryPoint:
      type: object
      properties:
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        totalPnlUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_pnl_usd
        realizedTradingPnlUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: realized_trading_pnl_usd
        feesUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: fees_usd
          description: '- fees; + rebates/rewards.'
        fundingUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: funding_usd
          description: + credit; - debit.
      title: PerpPnlHistoryPoint
      additionalProperties: false
    flint.margin.user.v1.PerpPosition:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        quantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: quantity
          description: 'Signed base units: positive long, negative short.'
        entryPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: entry_price
        markPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: mark_price
        notionalUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: notional_usd
        unrealizedPnlUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: unrealized_pnl_usd
        realizedPnlUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: realized_pnl_usd
        accruedFundingUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: accrued_funding_usd
          description: Positive is an estimated credit to the account, negative a debit.
        initialMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: initial_margin_usd
        maintenanceMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_margin_usd
        liquidationPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: liquidation_price
        status:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpPositionStatus'
          title: status
        openedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: opened_at
        updatedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: updated_at
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: PerpPosition
      additionalProperties: false
    flint.margin.user.v1.PerpPositionStatus:
      type: string
      title: PerpPositionStatus
      enum:
        - PERP_POSITION_STATUS_UNSPECIFIED
        - PERP_POSITION_STATUS_OPEN
        - PERP_POSITION_STATUS_CLOSED
        - PERP_POSITION_STATUS_LIQUIDATED
    flint.margin.user.v1.PerpVolume:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        oneHour:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.VolumeWindow'
          title: one_hour
        twentyFourHour:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.VolumeWindow'
          title: twenty_four_hour
        thirtyDay:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.VolumeWindow'
          title: thirty_day
        lastPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: last_price
      title: PerpVolume
      additionalProperties: false
    flint.margin.user.v1.PlaceOrderAction:
      type: object
      properties:
        market:
          type: string
          title: market
        side:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionOrderSide'
          title: side
        size:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: size
          description: A multiple of the market's lot size; never rounded.
        orderType:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionOrderType'
          title: order_type
        limitPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: limit_price
          description: Limit orders only, and required for them. A multiple of the market's tick.
        maxSlippageBps:
          type:
            - integer
            - "null"
          title: max_slippage_bps
          description: |-
            Market orders only: 1 to 1000, else INVALID_ARGUMENT. Absent is 500. The
             link always carries the value, so the app enforces the band checked here.
        timeInForce:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.ActionTimeInForce'
          title: time_in_force
          description: |-
            Limit orders only; on a market order, anything but UNSPECIFIED is
             INVALID_ARGUMENT.
        reduceOnly:
          type: boolean
          title: reduce_only
        postOnly:
          type: boolean
          title: post_only
          description: Limit GTC orders only, else INVALID_ARGUMENT.
      title: PlaceOrderAction
      additionalProperties: false
    flint.margin.user.v1.PositionHistoryEntry:
      type: object
      properties:
        positionId:
          type: string
          title: position_id
        position:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpPosition'
          title: position
        closedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: closed_at
        totalFeesUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_fees_usd
        totalFundingUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_funding_usd
      title: PositionHistoryEntry
      additionalProperties: false
    flint.margin.user.v1.PreviewActionsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
          description: The account the actions are for. Its owner reviews and signs them.
        actions:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TraderAction'
          title: actions
          description: 1 to 10 actions.
        expiresInSecs:
          type:
            - integer
            - "null"
          title: expires_in_secs
          description: |-
            How long the link stays valid. Absent is 600; 1 to 900, else
             INVALID_ARGUMENT.
      title: PreviewActionsRequest
      additionalProperties: false
    flint.margin.user.v1.PreviewActionsResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.ActionPreviewRow'
          title: rows
          description: One per action, in the order they run.
        link:
          type: string
          title: link
          description: |-
            The trading app's review page with every action. Empty when any action is
             BLOCKED, or when no trading app is deployed for this cluster; warnings say
             which.
        expiresAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: expires_at
        slot:
          type: string
          title: slot
          format: int64
          description: The slot the checks read.
        warnings:
          type: array
          items:
            type: string
          title: warnings
          description: |-
            About the batch as a whole: why there is no link, and that actions were
             checked alone.
      title: PreviewActionsResponse
      additionalProperties: false
    flint.margin.user.v1.PreviewOrder:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        side:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TradeSide'
          title: side
        requestedQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: requested_quantity
        executableQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: executable_quantity
        averagePrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: average_price
        worstPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: worst_price
        priceImpact:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price_impact
        estimatedFeeUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: estimated_fee_usd
        resultingPositionQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: resulting_position_quantity
        resultingInitialMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: resulting_initial_margin_usd
        resultingMaintenanceMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: resulting_maintenance_margin_usd
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: PreviewOrder
      additionalProperties: false
    flint.margin.user.v1.PreviewOrderRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        side:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TradeSide'
          title: side
        quantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: quantity
        orderType:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OrderType'
          title: order_type
        limitPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: limit_price
        reduceOnly:
          type: boolean
          title: reduce_only
      title: PreviewOrderRequest
      additionalProperties: false
    flint.margin.user.v1.PreviewOrderResponse:
      type: object
      properties:
        preview:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PreviewOrder'
          title: preview
      title: PreviewOrderResponse
      additionalProperties: false
    flint.margin.user.v1.ProtocolRiskOverview:
      type: object
      properties:
        accountCount:
          type: string
          title: account_count
          format: int64
        depositorCount:
          type: string
          title: depositor_count
          format: int64
        borrowerCount:
          type: string
          title: borrower_count
          format: int64
        loanCount:
          type: string
          title: loan_count
          format: int64
          description: Number of non-zero borrow positions.
        accountsAtRisk:
          type: string
          title: accounts_at_risk
          format: int64
        liquidatableAccounts:
          type: string
          title: liquidatable_accounts
          format: int64
        totalDepositedUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_deposited_usd
        totalBorrowedUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: total_borrowed_usd
        availableLiquidityUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: available_liquidity_usd
        netDepositsUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: net_deposits_usd
        protocolFeesUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: protocol_fees_usd
        atRiskHealthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: at_risk_health_ratio
      title: ProtocolRiskOverview
      additionalProperties: false
    flint.margin.user.v1.PublicTrade:
      type: object
      properties:
        tradeId:
          type: string
          title: trade_id
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        aggressorSide:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TradeSide'
          title: aggressor_side
        price:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: price
        quantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: quantity
        executedAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: executed_at
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: PublicTrade
      additionalProperties: false
    flint.margin.user.v1.RankedAccount:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        owner:
          type: string
          title: owner
          description: Live identity and statistics may be absent for historical-only accounts.
        address:
          type: string
          title: address
        accountValueUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: account_value_usd
          description: Unweighted USD economic NAV.
        metricValue:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: metric_value
        rank:
          type: integer
          title: rank
        openInterestUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: open_interest_usd
          description: Current statistics are independent of the historical ranking window.
        leverage:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: leverage
          description: Gross perp notional / positive economic NAV; absent otherwise.
        healthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: health_ratio
        openPositionCount:
          type:
            - integer
            - "null"
          title: open_position_count
          description: Number of perp positions with nonzero quantity.
        accountEquityUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: account_equity_usd
          description: Net equity from current account health, including collateral weights.
        performanceStart:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: performance_start
          description: First observation used for performance; all-time begins with eligible NAV history.
        name:
          type: string
          title: name
          description: Only public labels are returned; empty when unset or private.
      title: RankedAccount
      additionalProperties: false
    flint.margin.user.v1.RenameAccountRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        authority:
          type: string
          title: authority
          description: Base58 signing owner or delegate pubkey.
        name:
          type: string
          title: name
          description: Empty clears the label. Trimmed; maximum 32 characters. Sign the trimmed value.
        expiresAt:
          type: string
          title: expires_at
          format: int64
          description: Unix seconds, at most 120 seconds ahead.
        signature:
          type: string
          title: signature
          format: byte
        isPublic:
          type:
            - boolean
            - "null"
          title: is_public
          description: Omission resets leaderboard visibility to false, including for an already-public label.
      title: RenameAccountRequest
      additionalProperties: false
      description: |-
        The signed bytes are UTF-8, no trailing newline, fields in this order.
         Insert the is_public line only when the field is present, using lowercase true or false.
         Explicit false signs the line; omission leaves it out. The server verifies only that layout.

             flint:rename-account\n
             expires_at=<expires_at>\n
             trader_id=<trader_id>\n
             is_public=<true|false>\n
             name=<name>
    flint.margin.user.v1.RenameAccountResponse:
      type: object
      properties:
        name:
          type: string
          title: name
        isPublic:
          type: boolean
          title: is_public
      title: RenameAccountResponse
      additionalProperties: false
    flint.margin.user.v1.SettlePnlAction:
      type: object
      anyOf:
        - type: object
          properties:
            all:
              type: boolean
              title: all
              description: Every market with pending PnL. Must be true; false is INVALID_ARGUMENT.
          title: all
        - type: object
          properties:
            market:
              type: string
              title: market
          title: market
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - all
              - required:
                  - market
          - not:
              oneOf:
                - required:
                    - all
                - required:
                    - market
      title: SettlePnlAction
      description: 'Set target: unset is INVALID_ARGUMENT.'
    flint.margin.user.v1.SimulateAccountRiskRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        priceShocks:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AssetPriceShock'
          title: price_shocks
          description: Applied simultaneously by oracle; conflicting oracle changes are rejected.
      title: SimulateAccountRiskRequest
      additionalProperties: false
    flint.margin.user.v1.SimulateAccountRiskResponse:
      type: object
      properties:
        current:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: current
        stressed:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: stressed
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SimulateAccountRiskResponse
      additionalProperties: false
    flint.margin.user.v1.SimulateActionRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        action:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotAction'
          title: action
        amount:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: amount
          description: Token units; excess asset precision is rejected.
        authority:
          type: string
          title: authority
          description: Base58 owner or registered delegate pubkey used for simulation.
        createTokenAccount:
          type: boolean
          title: create_token_account
          description: Creates the signer's token account; rejected for actions that move no tokens.
        wrapLamports:
          type: string
          title: wrap_lamports
          format: int64
          description: Lamports to wrap before a wrapped-SOL deposit; zero disables wrapping.
      title: SimulateActionRequest
      additionalProperties: false
      description: Simulates an action without signing or submitting it.
    flint.margin.user.v1.SimulateActionResponse:
      type: object
      properties:
        error:
          type: string
          title: error
          description: Empty on success; otherwise the node's transaction error.
        logs:
          type: array
          items:
            type: string
          title: logs
        computeUnits:
          type: string
          title: compute_units
          format: int64
          description: Minimum compute-unit limit for the simulated transaction.
        account:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: account
          description: Simulated post-state; unset on error.
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        programError:
          type: string
          title: program_error
          description: Stable margin-program error name; empty for failures from other programs.
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SimulateActionResponse
      additionalProperties: false
      description: Simulation result and post-state.
    flint.margin.user.v1.SponsorTransactionRequest:
      type: object
      properties:
        transaction:
          type: string
          title: transaction
          format: byte
          description: Wire-format VersionedTransaction with only the empty sponsor signature.
      title: SponsorTransactionRequest
      additionalProperties: false
    flint.margin.user.v1.SponsorTransactionResponse:
      type: object
      properties:
        signature:
          type: string
          title: signature
          description: Base58 confirmed transaction signature.
      title: SponsorTransactionResponse
      additionalProperties: false
    flint.margin.user.v1.SpotAction:
      type: string
      title: SpotAction
      enum:
        - SPOT_ACTION_UNSPECIFIED
        - SPOT_ACTION_DEPOSIT
        - SPOT_ACTION_WITHDRAW
        - SPOT_ACTION_LEND
        - SPOT_ACTION_REDEEM
        - SPOT_ACTION_BORROW
        - SPOT_ACTION_REPAY
    flint.margin.user.v1.SpotId:
      type: object
      properties:
        id:
          type: integer
          title: id
      title: SpotId
      additionalProperties: false
      description: On-chain spot-asset id (u32 on-chain, unlike flint.spot.v1's u64).
    flint.margin.user.v1.SpotMetadata:
      type: object
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: id
        name:
          type: string
          title: name
        mint:
          type: string
          title: mint
        decimals:
          type: integer
          title: decimals
        tokenProgram:
          type: string
          title: token_program
          description: Base58 mint owner program (SPL Token or Token-2022).
        icon:
          type: string
          title: icon
        productId:
          type:
            - string
            - "null"
          title: product_id
          format: int64
          description: On-chain catalog product ID; separate from `id` and unset on older servers.
      title: SpotMetadata
      additionalProperties: false
    flint.margin.user.v1.SpotPosition:
      type: object
      properties:
        spotId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_id
        rawDeposit:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: raw_deposit
          description: Idle collateral that earns no interest.
        lent:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: lent
        borrowed:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrowed
        valueUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: value_usd
          description: Unweighted USD value.
        depositShares:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: deposit_shares
          description: Raw pool share counts.
        borrowShares:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: borrow_shares
        weightedCollateralUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: weighted_collateral_usd
          description: USD collateral after the deposit-weight haircut; zero for a net borrow.
        debtUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: debt_usd
          description: USD debt; zero for a net deposit.
        initialMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: initial_margin_usd
        maintenanceMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maintenance_margin_usd
        liquidationPrice:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: liquidation_price
          description: USD token price at maintenance margin; unset when no single-asset move can reach it.
      title: SpotPosition
      additionalProperties: false
      description: One spot leg. Amounts are token units.
    flint.margin.user.v1.StatsWindow:
      type: string
      title: StatsWindow
      enum:
        - STATS_WINDOW_UNSPECIFIED
        - STATS_WINDOW_1H
        - STATS_WINDOW_24H
        - STATS_WINDOW_30D
    flint.margin.user.v1.SubscribeAccountRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
      title: SubscribeAccountRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeAccountsAtRiskRequest:
      type: object
      title: SubscribeAccountsAtRiskRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeAccountsAtRiskResponse:
      type: object
      properties:
        upserts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MonitoredAccountAtRisk'
          title: upserts
          description: Upserts ordered by trader ID; complete replacement when snapshot is true.
        removedTraderIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: removed_trader_ids
          description: IDs to remove; empty for snapshots.
        snapshot:
          type: boolean
          title: snapshot
        entryHealthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: entry_health_ratio
          description: Admission and release thresholds; their gap provides hysteresis.
        exitHealthRatio:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: exit_health_ratio
        slot:
          type: string
          title: slot
          format: int64
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        revision:
          type: string
          title: revision
          format: int64
          description: Monotonically non-decreasing valuation revision.
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeAccountsAtRiskResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeAccountsRequest:
      type: object
      properties:
        traderIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_ids
      title: SubscribeAccountsRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeAccountsResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.AccountSnapshot'
          title: accounts
        missingTraderIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: missing_trader_ids
          description: No local valued snapshot; does not prove on-chain absence.
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeAccountsResponse
      additionalProperties: false
      description: Each message replaces the selected account set; intermediate states may coalesce.
    flint.margin.user.v1.SubscribeActivityRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        kinds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.ActivityKind'
          title: kinds
      title: SubscribeActivityRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeCandlesRequest:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        interval:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.CandleInterval'
          title: interval
        priceSource:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.CandlePriceSource'
          title: price_source
      title: SubscribeCandlesRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeCandlesResponse:
      type: object
      properties:
        candle:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Candle'
          title: candle
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeCandlesResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeFillsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: SubscribeFillsRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeFundingPaymentsRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: SubscribeFundingPaymentsRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeFundingPaymentsResponse:
      type: object
      properties:
        payments:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.FundingPayment'
          title: payments
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeFundingPaymentsResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeFundingRatesRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: SubscribeFundingRatesRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeFundingRatesResponse:
      type: object
      properties:
        rates:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.FundingRate'
          title: rates
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeFundingRatesResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeMarketStatsRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: SubscribeMarketStatsRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeMarketStatsResponse:
      type: object
      properties:
        stats:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.MarketStats'
          title: stats
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeMarketStatsResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeMarketsRequest:
      type: object
      properties:
        spotIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.SpotId'
          title: spot_ids
          description: Empty selects every listed market.
      title: SubscribeMarketsRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeOrderBookRequest:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        depth:
          type: integer
          title: depth
      title: SubscribeOrderBookRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeOrderBookResponse:
      type: object
      properties:
        orderBook:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.OrderBookSnapshot'
          title: order_book
          description: Snapshot replaces the book. Deltas replace sizes by price; zero deletes.
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        previousSequence:
          type: string
          title: previous_sequence
          format: int64
      title: SubscribeOrderBookResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeOrdersRequest:
      type: object
      properties:
        traderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: trader_id
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: SubscribeOrdersRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeOrdersResponse:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.Order'
          title: orders
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeOrdersResponse
      additionalProperties: false
    flint.margin.user.v1.SubscribeTradesRequest:
      type: object
      properties:
        perpIds:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_ids
      title: SubscribeTradesRequest
      additionalProperties: false
    flint.margin.user.v1.SubscribeTradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            $ref: '#/components/schemas/flint.margin.user.v1.PublicTrade'
          title: trades
        snapshot:
          type: boolean
          title: snapshot
        sequence:
          type: string
          title: sequence
          format: int64
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: SubscribeTradesResponse
      additionalProperties: false
    flint.margin.user.v1.TimeInForce:
      type: string
      title: TimeInForce
      enum:
        - TIME_IN_FORCE_UNSPECIFIED
        - TIME_IN_FORCE_GOOD_TIL_CANCELLED
        - TIME_IN_FORCE_IMMEDIATE_OR_CANCEL
        - TIME_IN_FORCE_FILL_OR_KILL
        - TIME_IN_FORCE_POST_ONLY
    flint.margin.user.v1.Timestamp:
      type: object
      properties:
        micros:
          type: string
          title: micros
          format: int64
      title: Timestamp
      additionalProperties: false
      description: Unix microseconds since epoch. Zero means unspecified.
    flint.margin.user.v1.TradeSide:
      type: string
      title: TradeSide
      enum:
        - TRADE_SIDE_UNSPECIFIED
        - TRADE_SIDE_BUY
        - TRADE_SIDE_SELL
    flint.margin.user.v1.TraderAction:
      type: object
      anyOf:
        - type: object
          properties:
            borrow:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.AssetAction'
              title: borrow
          title: borrow
        - type: object
          properties:
            cancelOrder:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.CancelOrderAction'
              title: cancel_order
          title: cancel_order
        - type: object
          properties:
            closePosition:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.ClosePositionAction'
              title: close_position
          title: close_position
        - type: object
          properties:
            deposit:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.AssetAction'
              title: deposit
          title: deposit
        - type: object
          properties:
            lend:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.AssetAction'
              title: lend
          title: lend
        - type: object
          properties:
            placeOrder:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.PlaceOrderAction'
              title: place_order
          title: place_order
        - type: object
          properties:
            redeem:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.AssetAction'
              title: redeem
          title: redeem
        - type: object
          properties:
            repay:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.AssetAction'
              title: repay
          title: repay
        - type: object
          properties:
            settlePnl:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.SettlePnlAction'
              title: settle_pnl
          title: settle_pnl
        - type: object
          properties:
            transfer:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.TransferAction'
              title: transfer
          title: transfer
        - type: object
          properties:
            withdraw:
              allOf:
                - $ref: '#/components/schemas/flint.margin.user.v1.AssetAction'
              title: withdraw
              description: Pays only the account owner's wallet.
          title: withdraw
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - borrow
              - required:
                  - cancelOrder
              - required:
                  - closePosition
              - required:
                  - deposit
              - required:
                  - lend
              - required:
                  - placeOrder
              - required:
                  - redeem
              - required:
                  - repay
              - required:
                  - settlePnl
              - required:
                  - transfer
              - required:
                  - withdraw
          - not:
              oneOf:
                - required:
                    - borrow
                - required:
                    - cancelOrder
                - required:
                    - closePosition
                - required:
                    - deposit
                - required:
                    - lend
                - required:
                    - placeOrder
                - required:
                    - redeem
                - required:
                    - repay
                - required:
                    - settlePnl
                - required:
                    - transfer
                - required:
                    - withdraw
      title: TraderAction
      description: |-
        One trader action. Markets are perp symbols as the trading app shows them
         ("SOL-USDC-PERP"), or a base ("SOL") when only one market trades it. Assets
         are token names ("USDC"); mints are also accepted. Sizes are base units,
         amounts token units, and prices quote prices, all as decimal strings.
    flint.margin.user.v1.TraderId:
      type: object
      properties:
        id:
          type: string
          title: id
          format: int64
      title: TraderId
      additionalProperties: false
      description: On-chain margin-account ID chosen by its creator.
    flint.margin.user.v1.TradingFees:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        makerFeeRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maker_fee_rate
        takerFeeRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: taker_fee_rate
        makerRebateRate:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: maker_rebate_rate
        tier:
          type: string
          title: tier
        effectiveAt:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: effective_at
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: TradingFees
      additionalProperties: false
    flint.margin.user.v1.TradingLimits:
      type: object
      properties:
        perpId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.PerpId'
          title: perp_id
        maxBuyQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_buy_quantity
        maxSellQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: max_sell_quantity
        reduceOnlyBuyQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: reduce_only_buy_quantity
        reduceOnlySellQuantity:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: reduce_only_sell_quantity
        availableMarginUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: available_margin_usd
        provenance:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.DataProvenance'
          title: provenance
      title: TradingLimits
      additionalProperties: false
    flint.margin.user.v1.TransferAction:
      type: object
      properties:
        asset:
          type: string
          title: asset
        amount:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: amount
        toTraderId:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.TraderId'
          title: to_trader_id
          description: Another account with the same owner.
      title: TransferAction
      additionalProperties: false
    flint.margin.user.v1.VolumeBucket:
      type: object
      properties:
        ts:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Timestamp'
          title: ts
        volumeUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: volume_usd
          description: Absent if any fills in the bucket cannot be valued in USD.
        fillCount:
          type: string
          title: fill_count
          format: int64
      title: VolumeBucket
      additionalProperties: false
    flint.margin.user.v1.VolumeWindow:
      type: object
      properties:
        volumeUsd:
          allOf:
            - $ref: '#/components/schemas/flint.margin.user.v1.Decimal'
          title: volume_usd
          description: USD notional counted once per trade; absent if any fills cannot be valued.
        fillCount:
          type: string
          title: fill_count
          format: int64
      title: VolumeWindow
      additionalProperties: false
    flint.margin.user.v1.notifications.RequestEmailVerificationRequest:
      type: object
      properties:
        email:
          type: string
          title: email
      title: RequestEmailVerificationRequest
      additionalProperties: false
    flint.margin.user.v1.notifications.RequestEmailVerificationResponse:
      type: object
      properties:
        challengeId:
          type: string
          title: challenge_id
        expiresAtMs:
          type: string
          title: expires_at_ms
          format: int64
          description: Unix epoch milliseconds.
        retryAfterMs:
          type: string
          title: retry_after_ms
          format: int64
          description: Milliseconds before another verification email may be requested.
      title: RequestEmailVerificationResponse
      additionalProperties: false
    flint.margin.user.v1.notifications.Settings:
      type: object
      properties:
        deliveryAvailable:
          type: boolean
          title: delivery_available
          description: False when this server cannot send verification or fill emails.
        emailAddress:
          type: string
          title: email_address
          description: Verified destination only; empty when no email destination is enabled.
        emailEnabled:
          type: boolean
          title: email_enabled
      title: Settings
      additionalProperties: false
      description: |-
        Settings belong to the owner and selected trader account in the authenticated
         margin session. Delegates cannot read or change notification settings.
    flint.margin.user.v1.notifications.VerifyEmailRequest:
      type: object
      properties:
        challengeId:
          type: string
          title: challenge_id
        code:
          type: string
          title: code
      title: VerifyEmailRequest
      additionalProperties: false
    google.protobuf.Empty:
      type: object
      description: An empty JSON object.
security: []
tags:
  - name: flint.margin.user.v1.AccountService
  - name: flint.margin.user.v1.ActionService
  - name: flint.margin.user.v1.FundingService
  - name: flint.margin.user.v1.MarketService
    description: Public catalog and live state of lending markets.
  - name: flint.margin.user.v1.MarketDataService
  - name: flint.margin.user.v1.notifications.NotificationService
    description: |-
      Manages email delivery preferences. Every method requires a margin-session
       bearer token for the selected trader account's current owner.
       Public fill history is available through AccountService.GetFills. Reading or
       dismissing fills in a client never suppresses email delivery.
  - name: flint.margin.user.v1.OrderService
  - name: flint.margin.user.v1.PerpMarketService
  - name: flint.margin.user.v1.RiskService
    description: Public read-only margin-risk views.
  - name: flint.margin.user.v1.SponsorshipService
    description: |-
      Pays fees for pre-authorized margin transactions; the sponsor is fee payer only.
       Transactions may invoke only the margin, compute-budget, and secp256r1 programs.
