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

# List application margin accounts

> List application margin accounts.

 Returns a paginated list of the application's margin accounts, one row per
 margin account with sub-accounts listed beside their parent. An
 application that funds its users through margin reads their collateral
 here: margin collateral is not a wallet balance, so `ListAppBalances` does
 not show it.

 Figures are a persisted baseline repriced at the latest risk marks. They
 can briefly lag the matching engine, which this read never calls.
 Copy-trading accounts are not listed, so the rows need not add up to all
 of a wallet's margin collateral.
 Public: the application is selected by `client_id`.



## OpenAPI

````yaml /proto-openapi/api/openapi.yaml get /api/v1/applications/margin-accounts
openapi: 3.0.3
info:
  title: Monaco Protocol API
  description: REST API for the Monaco Protocol hybrid CLOB exchange.
  version: 1.0.0
servers:
  - url: https://apimonaco.xyz
    description: Production (Sei mainnet)
security: []
tags:
  - name: AccountsService
  - name: AnalyticsService
  - name: ApplicationsService
  - name: AuthService
  - name: BuildercodeRewardsService
  - name: ComplianceService
  - name: CopyTradingService
  - name: DelegatedAgentsService
  - name: FaucetService
  - name: FeesService
  - name: HealthService
  - name: ManagedMarketsService
    description: |-
      Wallet-authenticated maker assignments. The signed session must match both
       configured maker user and application. Owner IDs are process fences, never auth.
       Only wallet sessions are supported; delegated-agent sessions receive 403.
  - name: MarginAccountsService
    description: |-
      Current public isolated-margin semantics:
       - a user has one parent margin account per application scope
       - opening orders create or reuse isolated position buckets under that parent
       - parent account creation is handled internally by margin workflows
  - name: MarketService
  - name: OrderbookService
  - name: OrdersService
  - name: PositionsService
    description: |-
      Current public isolated-margin semantics:
       - positions link to a parent margin account and, when applicable, a bucket id
       - opening orders create or reuse isolated position buckets under the parent
       - users can open another isolated position by reusing the parent account with a different market bucket
  - name: PulseService
  - name: RfqService
  - name: SweeperService
  - name: TraderCodeService
  - name: TradesService
  - name: WithdrawalsService
paths:
  /api/v1/applications/margin-accounts:
    get:
      tags:
        - ApplicationsService
        - Applications
      summary: List application margin accounts
      description: |-
        List application margin accounts.

         Returns a paginated list of the application's margin accounts, one row per
         margin account with sub-accounts listed beside their parent. An
         application that funds its users through margin reads their collateral
         here: margin collateral is not a wallet balance, so `ListAppBalances` does
         not show it.

         Figures are a persisted baseline repriced at the latest risk marks. They
         can briefly lag the matching engine, which this read never calls.
         Copy-trading accounts are not listed, so the rows need not add up to all
         of a wallet's margin collateral.
         Public: the application is selected by `client_id`.
      operationId: list_application_margin_accounts
      parameters:
        - name: clientId
          in: query
          description: Application client ID
          schema:
            type: string
            minLength: 1
          required: true
        - name: address
          in: query
          description: >-
            Filter by wallet address. A wallet with no margin account in the
            application returns an empty page.
          schema:
            type: string
            minLength: 1
        - name: pageSize
          in: query
          schema:
            type: integer
            format: uint32
            minimum: 1
            maximum: 1000
            default: 20
          description: Items per page (max 1000)
        - name: pageToken
          in: query
          description: |-
            Pagination cursor with two states:
              - Omitted or empty string (""): start a cursor walk with no prior
                position.
              - Non-empty: an opaque cursor from a previous response's
                `nextPageToken`; results resume immediately after that position.

             Ordered by margin account id ascending.

             Filters must match the request that produced the token, or the request
             is rejected 400.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAppMarginAccountsResponse'
        '400':
          description: >-
            Bad request (missing client_id, invalid address, page size or page
            token)
        '404':
          description: >-
            No active, displayed application has this client_id (unknown,
            inactive and hidden builders read alike)
        '429':
          description: >-
            Public read rate limit exceeded for this client IP; retry after the
            interval in details.retryAfter
        '500':
          description: Internal server error
components:
  schemas:
    ListAppMarginAccountsResponse:
      type: object
      properties:
        marginAccounts:
          type: array
          items:
            $ref: '#/components/schemas/ApplicationMarginAccount'
          nullable: true
        total:
          example: 50
          type: integer
          description: >-
            Number of margin accounts matching the filter, bounded by the server
            ceiling — a lower bound when totalCapped is true.
          format: uint32
          nullable: true
        pageSize:
          example: 20
          type: integer
          description: Items per page
          format: uint32
          nullable: true
        totalPages:
          example: 3
          type: integer
          description: >-
            Number of pages at this pageSize, bounded by the server ceiling — a
            lower bound when totalCapped is true.
          format: uint32
          nullable: true
        nextPageToken:
          type: string
          description: >-
            Cursor for the next page, minted from the last row of an
            over-fetched
             page: this listing is one ordered read, so a page shorter than
             `pageSize` proves the walk is exhausted and this is empty.
          nullable: true
        totalCapped:
          example: false
          type: boolean
          description: >-
            True when more than the server ceiling of margin accounts matched,
            so the count stopped at the ceiling and total/totalPages are a lower
            bound.
          nullable: true
    ApplicationMarginAccount:
      type: object
      properties:
        marginAccountId:
          type: string
          description: Margin account UUID
          format: uuid
          nullable: true
        userId:
          type: string
          description: UUID of the user who owns this margin account
          format: uuid
          nullable: true
        address:
          type: string
          description: Wallet address of the owning user
          nullable: true
          pattern: ^0x[0-9a-fA-F]{40}$
          minLength: 42
          maxLength: 42
        subaccountKey:
          example: default
          type: string
          description: Sub-account key; default is the parent margin account
          nullable: true
        marginAccountState:
          example: ACTIVE
          type: string
          description: 'Margin account state: ACTIVE or CLOSED (a closed sub-account)'
          nullable: true
        collateral:
          example: '1000'
          type: string
          description: >-
            Deposited collateral in USD, before any PnL. A persisted baseline:
            it can briefly lag the matching engine.
          nullable: true
        equity:
          example: '1012.5'
          type: string
          description: >-
            Account equity in USD: settled collateral, unrealized PnL at the
            latest risk marks, and realized PnL held by open risk buckets. A
            persisted baseline repriced at the latest risk marks: it can briefly
            lag the matching engine.
          nullable: true
        freeCollateral:
          example: '800'
          type: string
          description: >-
            Collateral available for new margin, in USD. Not the withdrawal
            bound. A persisted baseline: it can briefly lag the matching engine.
          nullable: true
        withdrawableCollateral:
          example: '750'
          type: string
          description: >-
            Collateral a transfer out of this margin account can take, in USD. A
            persisted baseline: the matching engine enforces the transfer and
            can accept less.
          nullable: true
        updatedAt:
          type: string
          description: >-
            When this margin account was last persisted (RFC 3339). Repricing at
            newer marks does not move it.
          format: date-time
          nullable: true
      description: |-
        One margin account of an application.

         A public row, so it is deliberately smaller than `MarginAccountSummary`: it
         carries no free-text label, no risk bucket or position data, and no margin
         requirement. Risk buckets are not rows: their allocated collateral and held
         realized PnL are already inside the account's figures.

         Every figure is a persisted baseline repriced at the latest risk marks, so
         it can briefly lag the matching engine.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.