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

# Positions

> Use this when the user asks about their DeFi positions (lending, liquidity, staking, vaults), open perpetual futures, or prediction market shares. Returns for DeFi the protocol, supplied and borrowed tokens, APY, health factor and unclaimed rewards; for perps the market, side, size, entry, mark and liquidation prices, leverage, unrealised PnL and distance to liquidation; for predictions the market, outcome held, shares, average and current price, value, PnL and when it resolves.



## OpenAPI

````yaml /openapi.json get /positions
openapi: 3.1.0
info:
  title: Burokku API
  version: '1'
  description: >-
    Read your Burokku portfolio: net worth, holdings, DeFi, perp and prediction
    market positions, liquidation risk, profit and loss, activity and alerts.
    Two writes only notify or watch: a price alert, and a watched address.
    Nothing in this API can trade, swap, send or sign. The same nine operations
    are the Burokku connector’s tools for AI apps.
servers:
  - url: https://api.burokku.app/v1
    description: Production
security:
  - oauth2:
      - portfolio.read
  - apiKey: []
tags:
  - name: Portfolio
    description: Net worth, holdings, positions, liquidation risk and profit and loss.
  - name: Activity
    description: Transactions and trades, newest first.
  - name: Alerts
    description: The account’s alerts, and price alerts that only notify.
  - name: Accounts
    description: Public addresses added watch-only.
paths:
  /positions:
    get:
      tags:
        - Portfolio
      summary: Positions
      description: >-
        Use this when the user asks about their DeFi positions (lending,
        liquidity, staking, vaults), open perpetual futures, or prediction
        market shares. Returns for DeFi the protocol, supplied and borrowed
        tokens, APY, health factor and unclaimed rewards; for perps the market,
        side, size, entry, mark and liquidation prices, leverage, unrealised PnL
        and distance to liquidation; for predictions the market, outcome held,
        shares, average and current price, value, PnL and when it resolves.
      operationId: positions
      parameters:
        - name: kind
          in: query
          required: false
          schema:
            default: all
            type: string
            enum:
              - defi
              - perps
              - predictions
              - all
        - name: account
          in: query
          required: false
          description: >-
            One account, by its name as Burokku shows it (over REST, its id also
            works). Leave out for every account.
          schema:
            type: string
            minLength: 1
            maxLength: 100
        - name: protocol
          in: query
          required: false
          description: One protocol or venue, by name (Aave, Hyperliquid, Polymarket…).
          schema:
            type: string
            minLength: 1
            maxLength: 60
      responses:
        '200':
          description: OK
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Positions'
        '400':
          description: A value is missing, of the wrong type or out of range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: bad-input
                  message: >-
                    Some of what was asked isn’t valid: limit: Too big: expected
                    number to be <=100
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No account or bundle by that name or id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not-found
                  message: >-
                    There’s no account named “Ledger”. Your accounts: Main
                    wallet, Binance.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '423':
          $ref: '#/components/responses/Locked'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/Off'
      security:
        - oauth2:
            - portfolio.read
        - apiKey: []
components:
  headers:
    X-RateLimit-Limit:
      description: >-
        The plan’s calls a day, shared by the REST API and the connector. Always
        the daily quota, never the per-minute limit or the read budget. On every
        answer from an operation, successes and errors alike, both 429s
        included; not on a 401, or an answer about the request itself (an
        unknown path, 405, 413, `bad-json`, a 403 for scope).
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: >-
        Calls left today, after this call if it counted. Only calls that run are
        counted, and it never says more than is left.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: >-
        When the count starts again: the end of the UTC day, in Unix epoch
        seconds.
      schema:
        type: integer
    Retry-After:
      description: >-
        Seconds to wait: until the UTC day ends for `daily-limit`, 60 for
        `rate-limited`.
      schema:
        type: integer
  schemas:
    Positions:
      type: object
      properties:
        defi:
          type: array
          items:
            type: object
            properties:
              id:
                description: 'REST only: a stable opaque id.'
                type: string
              protocol:
                type: string
              type:
                type: string
                description: Lending, Liquidity, Staking, Yield or Vault.
              label:
                type: string
              chain:
                type: string
              account:
                type: string
              account_id:
                description: 'REST only: a stable opaque id.'
                type: string
              value_usd:
                type: number
                description: Net of debt.
              pnl_usd:
                type: number
              apy_pct:
                type: number
                description: Percent (12.5 is 12.5%).
              supplied:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                    amount:
                      type: number
                    usd:
                      type: number
                  required:
                    - symbol
                    - amount
                    - usd
                  additionalProperties: false
              borrowed:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                    amount:
                      type: number
                    usd:
                      type: number
                  required:
                    - symbol
                    - amount
                    - usd
                  additionalProperties: false
              health_factor:
                type: number
              unclaimed_rewards_usd:
                type: number
            required:
              - protocol
              - type
              - label
              - chain
              - account
              - value_usd
            additionalProperties: false
        perps:
          type: array
          items:
            type: object
            properties:
              market:
                type: string
              ticker:
                description: A builder-deployed market’s ticker on its venue.
                type: string
              dex:
                description: The builder-deployed exchange it trades on.
                type: string
              side:
                type: string
                enum:
                  - Long
                  - Short
              venue:
                type: string
              account:
                type: string
              account_id:
                description: 'REST only: a stable opaque id.'
                type: string
              size:
                type: number
              entry:
                type: number
              mark:
                type: number
              liquidation:
                type:
                  - number
                  - 'null'
              leverage:
                type: number
              notional_usd:
                type: number
              pnl_usd:
                type: number
                description: Unrealised, since the position opened.
              distance_to_liquidation_pct:
                type: number
                description: Percent (12.5 is 12.5%).
            required:
              - market
              - side
              - venue
              - size
              - entry
              - mark
              - liquidation
              - leverage
              - notional_usd
              - pnl_usd
            additionalProperties: false
        predictions:
          type: array
          items:
            type: object
            properties:
              id:
                description: 'REST only: a stable opaque id.'
                type: string
              venue:
                type: string
              market:
                type: string
                description: What the market asks.
              outcome:
                type: string
                description: The answer and side the shares back.
              account:
                type: string
              account_id:
                description: 'REST only: a stable opaque id.'
                type: string
              shares:
                type: number
              average_price_usd:
                description: What each share cost on average, when the venue says.
                type:
                  - number
                  - 'null'
              price_usd:
                type: number
              value_usd:
                type: number
              pnl_usd:
                type:
                  - number
                  - 'null'
              resolves_at:
                anyOf:
                  - type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  - type: 'null'
              claimable:
                type: boolean
                description: Won, waiting to be claimed on the venue.
            required:
              - venue
              - market
              - outcome
              - account
              - shares
              - average_price_usd
              - price_usd
              - value_usd
              - pnl_usd
              - resolves_at
              - claimable
            additionalProperties: false
        more:
          description: How many more of each were left out (at most 40 of each are listed).
          type: object
          properties:
            defi:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            perps:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            predictions:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - defi
            - perps
            - predictions
          additionalProperties: false
        read_at:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
          description: When these figures were read (ISO 8601, UTC).
        refreshing:
          type: boolean
          description: >-
            True while Burokku reads the accounts again behind this answer; a
            later call has newer figures.
        currency:
          type: object
          properties:
            code:
              type: string
              description: The currency the account shows money in (USD, EUR, JPY…).
            per_usd:
              type: number
              exclusiveMinimum: 0
              description: >-
                Units of that currency per US dollar, to convert the *_usd
                figures.
          required:
            - code
            - per_usd
          additionalProperties: false
      required:
        - read_at
        - refreshing
        - currency
      additionalProperties: false
    Error:
      type: object
      description: >-
        Burokku’s errors: a code to branch on and a sentence that says what
        happened and what to do, in the language of the request’s
        Accept-Language (English when it names none Burokku speaks).
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                What went wrong, for code to branch on: bad-input, bad-json,
                bad-cursor, unknown-asset, not-address, secret,
                account-required, plan-limit, insufficient-scope, not-found,
                LOCKED, method-not-allowed, too-large, rate-limited,
                daily-limit, off or server-error; a 400 or 403 without its own
                code comes as bad-request or forbidden. New codes may be added.
            message:
              type: string
              description: >-
                What happened and what to do, for a person to read. Don’t parse
                it.
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  responses:
    Unauthorized:
      description: >-
        No token (`unauthorized`), or a key or token that isn’t valid: made up,
        expired, revoked or issued for the MCP server (`invalid-token`). The
        `WWW-Authenticate` header says the same (`error="invalid_token"` when a
        token was sent) and names this API’s protected resource metadata. No
        rate headers: the account isn’t known.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              value:
                error:
                  code: unauthorized
                  message: >-
                    Send an API key or an access token as a Bearer token in the
                    Authorization header.
            invalid-token:
              value:
                error:
                  code: invalid-token
                  message: >-
                    This API key or access token isn’t valid. It may have
                    expired or been revoked.
      headers:
        WWW-Authenticate:
          description: >-
            For example: Bearer realm="OAuth",
            resource_metadata="https://api.burokku.app/.well-known/oauth-protected-resource/v1",
            error="invalid_token", scope="portfolio.read portfolio.write
            offline_access"
          schema:
            type: string
    Locked:
      description: >-
        The account is locked (Settings → Security). Every call is refused until
        it’s unlocked, before anything is counted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: LOCKED
              message: >-
                Your account is locked. Security changes are on hold for 24
                hours from when it was locked.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
    RateLimited:
      description: >-
        Over a limit: 30 calls a minute per account (`rate-limited`,
        `Retry-After: 60`), or the plan’s calls for the UTC day, shared with the
        connector (`daily-limit`, which links only the pricing page;
        `Retry-After` is the seconds until the UTC day ends). Reads also count
        against the account’s read budget, which answers `rate-limited` with
        `Retry-After: 60`. A refused call isn’t counted, and the `X-RateLimit-*`
        headers still describe the day.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate-limited:
              value:
                error:
                  code: rate-limited
                  message: Too many calls in a minute. Try again in a minute.
            daily-limit:
              value:
                error:
                  code: daily-limit
                  message: >-
                    This account has used today’s 100 calls from AI apps and the
                    API; they start again at midnight UTC. Plans with more are
                    at https://burokku.app/pricing
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
    ServerError:
      description: Something failed on Burokku’s side. Try again in a minute.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: server-error
              message: Something went wrong on Burokku’s side. Try again in a minute.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
    'Off':
      description: Burokku for AI apps and the API is switched off for now.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: 'off'
              message: >-
                Burokku for AI apps and the API isn’t available right now. Try
                again later.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.1 for apps that act for a Burokku user: the authorization code
        grant with PKCE (S256) required of every client. Clients use a Client ID
        Metadata Document, or register at /oauth/register (at most 20
        registrations an hour from one network). Set `resource` to
        https://api.burokku.app/v1: a token issued for the MCP server (the
        default without `resource`) is refused here with a 401
        (`invalid-token`); a token is for one resource, so authorize once for
        each and refresh with the same `resource` (another gets
        `invalid_target`). Every grant includes portfolio.read. Authorization
        server metadata:
        https://app.burokku.app/.well-known/oauth-authorization-server; this
        API’s protected resource metadata:
        https://api.burokku.app/.well-known/oauth-protected-resource/v1. Access
        tokens last 1 hour; each refresh returns a new refresh token (use the
        newest), and one unused for 30 days lapses. OAuth errors are JSON, `{
        error, error_description }`.
      flows:
        authorizationCode:
          authorizationUrl: https://app.burokku.app/oauth/authorize
          tokenUrl: https://app.burokku.app/oauth/token
          refreshUrl: https://app.burokku.app/oauth/token
          scopes:
            portfolio.read: Read balances, positions, activity and alerts. Every grant has it.
            portfolio.write: Create price alerts and add watched addresses.
            offline_access: >-
              Get a refresh token, to stay connected past the access token’s
              hour.
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: bk_live_…
      description: >-
        A personal API key (`bk_live_` and 43 more characters), sent as
        `Authorization: Bearer bk_live_…`. A key reads only, unless it was made
        with write. Never put a key in a URL.

````

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