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

# Get a wallet's earnings across all vaults on one chain

> Returns the wallet's earnings across every yield-vault position it holds on the given chain, as a per-vault breakdown plus USD totals. `chainName` selects the chain family — `EVM` covers Morpho and Aave vaults, `SOL` covers Kamino vaults — and defaults to `EVM`; `chainId` selects the chain within it. Providers only aggregate within a single chain, so `chainId` is required. Totals are USD-denominated because each vault's earnings are expressed in its own underlying asset and are therefore not additive. Positions in vaults this environment does not offer are still included, with a null `vaultId`. Aave reports no earnings, so its positions carry null `pnl`, `pnlUsd` and `roe`; Kamino reports no time-weighted return, so its positions carry a null `roe`.




## OpenAPI

````yaml https://app.dynamic.xyz/api-docs/public-api.yaml get /sdk/{environmentId}/yield/earnings
openapi: 3.0.1
info:
  title: Dashboard API
  description: Dashboard API documentation
  version: 1.0.0
servers:
  - url: https://app.dynamicauth.com/api/v0
  - url: https://app.dynamic.xyz/api/v0
  - url: http://localhost:3333/api/v0
security: []
tags:
  - name: Analytics
    description: Query usage analytics and event counts for your environment.
  - name: SDK
    description: SDK-facing endpoints consumed by embedded Dynamic clients.
  - name: Server
    description: Server-side SDK endpoints authenticated by environment API tokens.
  - name: Organizations
    description: >-
      Manage organizations — the top-level container for all environments and
      projects.
  - name: Projects
    description: Manage projects that group related environments under an organization.
  - name: Environments
    description: >-
      Manage environments (live and sandbox) where your authentication
      configuration lives.
  - name: Users
    description: List, search, and manage authenticated users within an environment.
  - name: Invites
    description: >-
      Manage invitation links that grant specific external users access to your
      environment.
  - name: Tokens
    description: >-
      Create and manage API tokens used to authenticate requests to the Dynamic
      API.
  - name: Origins
    description: >-
      Configure allowed origins (CORS) for SDK and API access to your
      environment.
  - name: Allowlists
    description: >-
      Manage allowlists to control which wallet addresses or email addresses can
      access your environment.
  - name: Wallets
    description: View and manage wallets linked to users in your environment.
  - name: Members
    description: Manage team members and their roles within an organization.
  - name: Sessions
    description: View and revoke active user sessions within an environment.
  - name: Settings
    description: Read and update environment-level configuration settings.
  - name: Exchanges
    description: >-
      Configure exchange integrations (Coinbase, Binance, etc.) for fiat on-ramp
      within your environment.
  - name: Yield
    description: List yield vaults registered for your environment.
  - name: Providers
    description: >-
      List, enable, disable, and configure authentication providers (OAuth,
      email, wallet, SMS, etc.) for your environment.
  - name: Captcha
    description: >-
      Configure captcha verification (provider, site key, secret key) for your
      environment.
  - name: Gates
    description: >-
      Define access gates that restrict environment entry to users who meet
      specific criteria.
  - name: Chains
    description: >-
      Manage the blockchain networks available for wallet connection in your
      environment.
  - name: Exports
    description: Export user and wallet data from your environment as downloadable files.
  - name: Events
    description: Browse the event log of actions performed within your environment.
  - name: Webhooks
    description: >-
      Create and manage webhooks to receive real-time events (user.created,
      wallet.linked, etc.) at your endpoint.
  - name: Custom Fields
    description: >-
      Define and manage custom metadata fields collected from users at sign-up
      or login.
  - name: MfaSettings
    description: >-
      Configure multi-factor authentication (MFA) policies for your
      organization.
  - name: Mfa
    description: Manage MFA enrollment and verification for individual users.
  - name: CustomHostnames
    description: >-
      Configure custom hostnames for white-labeling the Dynamic authentication
      experience.
  - name: TestAccount
    description: >-
      Manage test accounts used for automated testing and QA within an
      environment.
  - name: NameServices
    description: >-
      Configure name service integrations (ENS, Unstoppable Domains, etc.) for
      human-readable wallet addresses.
  - name: GlobalWallets
    description: >-
      Manage global wallets shared across multiple environments in an
      organization.
  - name: GlobalWalletConnections
    description: Configure which environments can access and use global wallets.
  - name: GlobalWalletAccessControl
    description: Control which users and roles can access and operate global wallets.
  - name: UserApiTokens
    description: >-
      Create and manage user-scoped API tokens for programmatic access on behalf
      of a user.
  - name: Waas
    description: Wallet-as-a-Service endpoints for creating and managing embedded wallets.
  - name: WalletConnect
    description: Configure WalletConnect integration settings for your environment.
  - name: Checkout
    description: >-
      Accept crypto payments and deposits from any wallet. Settle in any token
      you choose.
  - name: Flow
    description: >-
      Accept crypto payments, deposits, and withdrawals. Amount and destination
      are fixed server-side at create; the post-create lifecycle is driven with
      a capability session token.
  - name: FlowAnalytics
    description: >-
      Query aggregated analytics and paginated transaction lists for the Flow
      product.
  - name: Gasless
    description: >-
      Query billing summaries and paginated transaction lists for sponsored
      (gasless) transactions.
  - name: Custom Networks
    description: >-
      Add and manage custom EVM-compatible networks beyond the built-in chain
      list.
  - name: Chainalysis
    description: >-
      Configure Chainalysis integration for blockchain address screening and
      risk assessment.
  - name: Visits
    description: Track and query user visit activity within your environment.
  - name: ExternalJwt
    description: >-
      Configure external JWT providers so existing auth tokens can be used with
      Dynamic.
  - name: SDK Views
    description: >-
      Manage SDK view configurations that customize the appearance of Dynamic
      modals and flows.
  - name: DeeplinkUrls
    description: Configure deep link URLs for mobile app integration with the Dynamic SDK.
  - name: OrganizationSettings
    description: >-
      Read and update organization-level settings such as approval workflow
      configuration.
  - name: AdminActions
    description: >-
      Manage admin action requests that require approval from another
      administrator.
  - name: ClientGrant
    description: |
      OAuth 2.0 Device Authorization Grant flow (RFC 8628) used by first-party
      Dynamic clients (CLI, MCP server, demo apps, IDE plugins) to obtain a
      revocable, 30-day client JWT without ever seeing the user's dashboard
      session token.
  - name: AuthorizedClients
    description: |
      Manage first-party clients (CLI / MCP / demo / IDE plugins) authorized
      to act as a dashboard user. Surfaced under Profile → Authorized Clients.
  - name: Kyb
    description: >-
      Verify a business's identity via AI Prise passthrough and check KYB tier
      status.
  - name: BusinessAccounts
    description: >-
      Administer the business accounts (multi-operator wallet containers) that
      end users create in an environment.
  - name: ScreeningPolicies
    description: >
      Author per-provider address screening policies that map TRM and
      Chainalysis

      signals to block, alert, or allow, plus per-address exceptions. The

      sanctions floor sits underneath every policy and is not configurable.
paths:
  /sdk/{environmentId}/yield/earnings:
    get:
      tags:
        - SDK
      summary: Get a wallet's earnings across all vaults on one chain
      description: >
        Returns the wallet's earnings across every yield-vault position it holds
        on the given chain, as a per-vault breakdown plus USD totals.
        `chainName` selects the chain family — `EVM` covers Morpho and Aave
        vaults, `SOL` covers Kamino vaults — and defaults to `EVM`; `chainId`
        selects the chain within it. Providers only aggregate within a single
        chain, so `chainId` is required. Totals are USD-denominated because each
        vault's earnings are expressed in its own underlying asset and are
        therefore not additive. Positions in vaults this environment does not
        offer are still included, with a null `vaultId`. Aave reports no
        earnings, so its positions carry null `pnl`, `pnlUsd` and `roe`; Kamino
        reports no time-weighted return, so its positions carry a null `roe`.
      operationId: getYieldEarnings
      parameters:
        - $ref: '#/components/parameters/environmentId'
        - name: ownerAddress
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/WalletPublicKey'
          description: Wallet address whose earnings to query.
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 2147483647
          description: >
            Chain id to aggregate earnings on: an EVM chain id for
            `chainName=EVM`, or the Solana cluster id for `chainName=SOL` (101
            for mainnet, the only Solana cluster with earnings data).
        - name: chainName
          in: query
          required: false
          schema:
            allOf:
              - $ref: '#/components/schemas/ChainEnum'
            default: EVM
          description: >
            Chain family of `ownerAddress` and `chainId`. Only `EVM` and `SOL`
            are supported; any other value is rejected with a 400. Defaults to
            `EVM` so existing callers are unaffected.
      responses:
        '200':
          description: Earnings across the wallet's vault positions on the chain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YieldEarnings'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
components:
  parameters:
    environmentId:
      in: path
      name: environmentId
      required: true
      description: ID of the environment
      schema:
        $ref: '#/components/schemas/uuid'
  schemas:
    WalletPublicKey:
      type: string
      pattern: ^[A-Za-z0-9_-]{18,100}$
      description: >-
        Valid blockchain wallet address, must be an alphanumeric string
        (underscores allowed for chains like Midnight, hyphens allowed for
        chains using base64url-encoded addresses like TON)
      example: '0xbF394748301603f18d953C90F0b087CBEC0E1834'
      maxLength: 255
    ChainEnum:
      type: string
      enum:
        - ETH
        - EVM
        - FLOW
        - SOL
        - ALGO
        - STARK
        - COSMOS
        - BTC
        - ECLIPSE
        - SUI
        - SPARK
        - TRON
        - APTOS
        - TON
        - STELLAR
        - ALEO
        - TEMPO
        - MIDNIGHT
    YieldEarnings:
      type: object
      required:
        - chainId
        - ownerAddress
        - totalAssetsUsd
        - totalPnlUsd
        - vaults
      properties:
        chainId:
          type: integer
          description: >
            Chain id the earnings were aggregated on: an EVM chain id, or the
            Solana cluster id.
        ownerAddress:
          $ref: '#/components/schemas/WalletPublicKey'
        totalAssetsUsd:
          type: number
          description: >
            Sum of the USD position sizes. Vaults with no USD price are skipped
            rather than counted as zero.
        totalPnlUsd:
          type: number
          description: >
            Sum of the USD earnings. Vaults with no USD price are skipped rather
            than counted as zero.
        vaults:
          type: array
          items:
            $ref: '#/components/schemas/YieldVaultEarnings'
          description: Per-vault breakdown behind the totals.
    uuid:
      type: string
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      minLength: 36
      maxLength: 36
      example: 95b11417-f18f-457f-8804-68e361f9164f
    YieldVaultEarnings:
      type: object
      required:
        - assets
        - assetsUsd
        - pnl
        - pnlUsd
        - roe
        - vaultAddress
        - vaultId
      properties:
        assets:
          type: string
          description: |
            Position size, in raw units of the vault's underlying token.
        assetsUsd:
          type: number
          nullable: true
          description: >
            Position size in USD. Null when the provider has no price for the
            underlying token.
        pnl:
          type: string
          nullable: true
          description: >
            Earnings on the position, in raw units of the vault's underlying
            token. Null while the position has too little history to compute it,
            or when the provider reports no earnings (Aave).
        pnlUsd:
          type: number
          nullable: true
          description: >
            Earnings on the position in USD. Null when the provider has no price
            for the underlying token, or reports no earnings (Aave).
        roe:
          type: number
          nullable: true
          description: >
            Time-weighted, non-annualized return on equity since inception, as a
            decimal. Null while the position has too little history to compute
            it, or when the provider reports none (Aave, Kamino).
        vaultAddress:
          type: string
          description: Vault address as reported by the provider.
        vaultId:
          type: string
          nullable: true
          description: >
            Opaque vault identifier, when the vault is one this environment
            offers. Null for positions in vaults outside the environment's
            catalog.
    BadRequest:
      type: object
      properties:
        error:
          description: Human-readable error message
          type: string
        code:
          description: >-
            Machine-readable reason for the 400, set only by endpoints that
            distinguish rejections.
          type: string
          example: exchange_currency_unsupported
    Forbidden:
      type: object
      properties:
        error:
          description: Human-readable error message
          type: string
          example: Access Forbidden
        code:
          description: >-
            Machine-readable reason for the 403, set only by endpoints that
            distinguish rejections. Flow endpoints use sanctions_blocked,
            session_token_invalid and risk_blocked.
          type: string
          example: sanctions_blocked
    InternalServerError:
      type: object
      properties:
        error:
          description: Human-readable error message
          type: string
          example: Internal Server Error
    BadGateway:
      type: object
      properties:
        error:
          description: Human-readable error message
          type: string
          example: Error from Snowflake service
        code:
          description: >-
            Machine-readable reason for the 502, set only by endpoints that
            distinguish rejections. Flow endpoints use exchange_unavailable.
          type: string
          example: exchange_unavailable
      required:
        - error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequest'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Forbidden'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'
    BadGateway:
      description: Bad Gateway
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadGateway'

````

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