---
title: "Get defi positions"
method: POST
path: "/v1/tools/betteroff_get_defi_positions"
tags: ["tools"]
---

# Get defi positions

`POST /v1/tools/betteroff_get_defi_positions`

## Request

- Base URL: `https://api.betteroff.finance`
- URL: `https://api.betteroff.finance/v1/tools/betteroff_get_defi_positions`
- Auth: one of:
  - OpenID Connect (`https://app.betteroff.finance/api/auth/.well-known/openid-configuration`, scopes: `investments:read`)
  - HTTP bearer

Use this when the user asks about DeFi, lending, staking, or LP positions, or protocol exposure. DeFi exposure by protocol across chains: total value, position count, per-asset breakdown.

## Request body

- object
  - `protocol` string, nullable, required: Filter to a specific protocol name (case-insensitive substring match, e.g. 'aave', 'uniswap'). Use null for all protocols.
  - `chain` string, nullable, required: Filter to a specific chain slug (e.g. 'ethereum', 'base', 'arbitrum'). Use null for all chains.

## Response `200`

Tool result

- union
  - object
    - `ok` false, required
    - `requestId` string
    - `error` string, required
    - `code` string, required
    - `retryable` boolean, required
    - `nextStep` string, required
    - `field` string
    - `missingInputs` object[]
      - `id` string, required
      - `name` string, required
      - `balanceMissing` boolean, required
      - `interestRateMissing` boolean, required
      - `minimumPaymentMissing` boolean, required
  - object
    - `ok` true, required
    - `requestId` string
    - `schemaVersion` '4', required
    - `data` object, required
      - `dataSource` 'canonical_wallet_positions' | 'legacy_holdings_projection', required
      - `totalValueUsd` string, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
      - `grossAssetValueUsd` string, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
      - `grossLiabilityValueUsd` string, nullable, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
      - `netValueUsd` string, nullable, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
      - `positionCount` integer, required
      - `protocolCount` integer, required
      - `protocols` union[], required
        - union
          - object
            - `protocol` string, required
            - `chains` string[], required
            - `positionCount` integer, required
            - `grossAssetValueUsd` string, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
            - `grossLiabilityValueUsd` string, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
            - `netValueUsd` string, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
            - `positions` object[], required
              - …
          - object
            - `protocol` string, required
            - `chains` string[], required
            - `positionCount` integer, required
            - `totalValueUsd` string, required: Decimal text, e.g. "-12.50". Read the currency beside it or on the result.
            - `byPositionType` object[], required
              - …
            - `topAssets` object[], required
              - …
      - `coverage` object, required
      - `filters` object, required
    - `currency` string, nullable, required
    - `timezone` string, required
    - `asOf` string, nullable, required
    - `revision` integer, required
    - `householdRevision` integer, required
    - `quality` object, required
      - `state` 'complete' | 'partial' | 'unavailable', required
      - `reasons` string[], required
    - `evidence` object[], required
      - `source` string, required
      - `id` string
      - `observedAt` string, nullable, required
    - `page` object, required
      - `returnedCount` integer, required
      - `totalCount` integer, nullable, required
      - `truncated` boolean, required
      - `nextCursor` Schema3, required (unresolved $ref)
    - `warnings` string[], required
    - `notes` string

## Other responses

- `400`: INVALID_INPUT (a missing, unknown, or invalid argument, named in `fields`), TOOL_CALL_REJECTED, or a body that is not JSON.
- `401`: AGENT_TOKEN_INVALID: the token is missing, expired, or revoked.
- `402`: AGENT_SUBSCRIPTION_INACTIVE or FEATURE_NOT_INCLUDED: needs BetterOff Core.
- `403`: INSUFFICIENT_SCOPE, ACCESS_DENIED, or AGENT_GRANT_REVOKED.
- `404`: TOOL_NOT_FOUND, or NOT_FOUND for a record the org does not have.
- `409`: CONFLICT: the record's state rules this call out. Read it again.
- `422`: INCOMPLETE_DATA or RESULT_TOO_LARGE. Narrow the request; don't retry as is.
- `429`: RATE_LIMITED. Retry after Retry-After seconds.
- `503`: DATA_UNAVAILABLE, DEPENDENCY_UNAVAILABLE (including the 25-second tool deadline), or AGENT_AUTHZ_UNAVAILABLE. Retryable.
- `default`: Problem details

---

[API](https://skmtc.dev/betteroff/apis/betteroff-api.md) · [All operations](https://skmtc.dev/betteroff/apis/betteroff-api/llms.txt) · [OpenAPI document](https://skmtc.dev/betteroff/apis/betteroff-api/revisions/bc858c8d428d?raw)
