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

# Vault deposit capacity

> The vault's GLOBAL (vault-wide) deposit capacity: `remainingUsdc` is how much USDC it can still absorb, and `fits` says whether a prospective batch would deposit without reverting. With no params it returns just the headroom. Pass a deposit batch (`conditionIds` + aligned `yesAmounts`/`noAmounts`) to also get `fits` — capacity is global, so submit the WHOLE batch for a correct answer. Wallet-agnostic; mirrors RobinLens.checkBatchDepositCapacity.




## OpenAPI

````yaml /openapi/v1.yaml get /capacity
openapi: 3.1.0
info:
  title: Robin Markets Integration API
  version: 1.0.0
  description: >
    Public API for surfacing Robin staking inside a third-party frontend. You
    already have the Polymarket market data; this returns **what Robin computes
    on top**: a market's live staking APY, a personalized projected APY for a
    stake a user is about to make, and the state of a wallet's existing
    positions (shares, value, accrued-yield breakdown, live APY).


    Data endpoints are **read-only**. Two `POST` helpers cover actions a read
    can't: `POST /markets` indexes a market from Polymarket, and `POST /twap`
    returns a signed oracle update you must submit on-chain before depositing or
    withdrawing.


    ### Conventions

    - **Token / USD amounts** are 6-decimal integer strings (`"1500000"` = 1.5).
    Both outcome tokens
      and USDC use 6 decimals. Divide by `1e6` to display.

    - **APY values** are plain numbers in **percent** (`6.0` means 6.00% APY).

    - **`conditionId`** is the Polymarket condition id (bytes32 hex).

    - **`wallet`** is the user's resolved Robin staking wallet (a Polymarket
    DepositWallet or Gnosis
      Safe proxy), **not** the user's EOA.

    - Outcome / side values are `"yes"` / `"no"` (and `"both"` for a
    fully-resolved market).


    ### Auth, CORS & rate limiting

    No authentication. CORS is wide-open (`Access-Control-Allow-Origin: *`), so
    endpoints can be called directly from the browser; each path also answers
    `OPTIONS` preflight. Requests are rate-limited per IP (shared global budget)
    — back off on `429`.


    ### The APY formula

    Every APY is built from three layers: `total = max(nativeApy ×
    matchedFraction, guaranteeFloor) + matchingBonus + pointsBoost`. Base =
    socialized native yield, floored at the guarantee; matching = +1% for the
    pool-balancing (minority) side, scaled by the matchable portion; points = a
    personalized Robin Points boost (never handled directly — it appears as the
    `points` line and is folded into totals).
  license:
    name: See repository
servers:
  - url: https://app.robin.markets/api/v1
    description: Production
security: []
tags:
  - name: Markets
    description: Market-level staking APY and per-wallet quotes/positions.
  - name: Positions
    description: A wallet's existing Robin positions.
  - name: TWAP
    description: Signed oracle price updates required before depositing or withdrawing.
  - name: Capacity
    description: >-
      Two-tier vault deposit capacity (internal guard + external ERC-4626
      headroom).
  - name: Meta
    description: Static integration metadata.
paths:
  /capacity:
    get:
      tags:
        - Capacity
      summary: Vault deposit capacity
      description: >
        The vault's GLOBAL (vault-wide) deposit capacity: `remainingUsdc` is how
        much USDC it can still absorb, and `fits` says whether a prospective
        batch would deposit without reverting. With no params it returns just
        the headroom. Pass a deposit batch (`conditionIds` + aligned
        `yesAmounts`/`noAmounts`) to also get `fits` — capacity is global, so
        submit the WHOLE batch for a correct answer. Wallet-agnostic; mirrors
        RobinLens.checkBatchDepositCapacity.
      operationId: getCapacity
      parameters:
        - name: conditionIds
          in: query
          required: false
          description: >-
            Comma-separated condition ids of the prospective batch (max 25,
            unique). Omit for headroom only.
          schema:
            type: string
        - name: yesAmounts
          in: query
          required: false
          description: >-
            Comma-separated YES amounts (6-dec micro-units), aligned 1:1 with
            conditionIds.
          schema:
            type: string
        - name: noAmounts
          in: query
          required: false
          description: >-
            Comma-separated NO amounts (6-dec micro-units), aligned 1:1 with
            conditionIds.
          schema:
            type: string
      responses:
        '200':
          description: Capacity headroom (and `fits` when a batch was supplied).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Capacity'
        '400':
          $ref: '#/components/responses/BadRequest'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/CapacityUnavailable'
components:
  schemas:
    Capacity:
      type: object
      description: >
        Global (vault-wide) deposit capacity. `fits` is whether the supplied
        batch would deposit without reverting; `remainingUsdc` is the USDC the
        vault can still absorb (already accounts for a disabled internal guard).
      required:
        - fits
        - remainingUsdc
      properties:
        fits:
          type: boolean
          description: >-
            Whether a deposit of the supplied amounts fits right now (true if no
            amounts were supplied).
        remainingUsdc:
          type:
            - string
            - 'null'
          description: USDC the vault can still absorb now (6-dec string); null = uncapped.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - bad_request
                - not_found
                - rate_limited
                - internal
                - twap_unavailable
                - twap_timeout
                - capacity_unavailable
            message:
              type: string
  responses:
    BadRequest:
      description: Invalid parameters (e.g. missing `wallet`, or a non-integer amount).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: bad_request
              message: wallet is required
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Too many requests
    InternalError:
      description: Internal error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: internal
              message: Internal error
    CapacityUnavailable:
      description: Vault capacity could not be read (RPC unavailable). Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: capacity_unavailable
              message: Could not read vault capacity

````