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

# DeFi Positions

> Access a wallet's DeFi positions along with USD values and metadata across supported EVM chains.

export const DefiProtocolsList = () => {
  const dataState = useState(null);
  const data = dataState[0];
  const setData = dataState[1];
  const loadingState = useState(true);
  const isLoading = loadingState[0];
  const setIsLoading = loadingState[1];
  useEffect(function () {
    fetch("https://sim-proxy.dune-d2f.workers.dev/v1/evm/defi/supported-protocols").then(function (response) {
      return response.json();
    }).then(function (responseData) {
      setData(responseData);
      setIsLoading(false);
    });
  }, []);
  if (isLoading) {
    return <div>Loading protocol information...</div>;
  }
  if (!data || !data.protocol_families) {
    return <div>No data available</div>;
  }
  function formatFamily(family) {
    return family.split('_').map(function (word) {
      return word.charAt(0).toUpperCase() + word.slice(1);
    }).join(' ');
  }
  return <AccordionGroup>
      {data.protocol_families.map(function (family) {
    var hasSubs = family.sub_protocols && family.sub_protocols.length > 0;
    return <Accordion title={formatFamily(family.family)} key={family.family}>
            {hasSubs && <p>Recognized forks and variants: {family.sub_protocols.join(', ')}</p>}
          </Accordion>;
  })}
    </AccordionGroup>;
};

export const SupportedChains = ({endpoint, title, excludeChains}) => {
  const dataState = useState(null);
  const data = dataState[0];
  const setData = dataState[1];
  useEffect(function () {
    var url = "https://api.sim.dune.com/v1/evm/supported-chains";
    fetch(url, {
      method: "GET"
    }).then(function (response) {
      return response.json();
    }).then(function (responseData) {
      setData(responseData);
    });
  }, [endpoint]);
  if (data === null) {
    return <div>Loading chain information...</div>;
  }
  if (!data.chains) {
    return <div>No chain data available</div>;
  }
  var supportedChains = [];
  var totalChains = data.chains.length;
  var excludedChainNames = excludeChains || [];
  for (var i = 0; i < data.chains.length; i++) {
    var chain = data.chains[i];
    if (excludedChainNames.indexOf(chain.name) !== -1) continue;
    if (endpoint === undefined) {
      supportedChains.push(chain);
    } else if (chain[endpoint] && chain[endpoint].supported) {
      supportedChains.push(chain);
    }
  }
  var count = supportedChains.length;
  var endpointName = endpoint ? endpoint.charAt(0).toUpperCase() + endpoint.slice(1).replace(/_/g, " ") : "All";
  var accordionTitle = title ? title + " (" + count + ")" : "Supported Chains (" + count + ")";
  return <Accordion title={accordionTitle}>
      <table>
        <thead>
          <tr>
            <th>name</th>
            <th>chain_id</th>
            <th>tags</th>
          </tr>
        </thead>
        <tbody>
          {supportedChains.map(function (chain) {
    return <tr key={chain.name}>
                <td><code>{chain.name}</code></td>
                <td><code>{chain.chain_id}</code></td>
                <td><code>{chain.tags ? chain.tags.join(", ") : ""}</code></td>
              </tr>;
  })}
        </tbody>
      </table>
    </Accordion>;
};

<img src="https://mintcdn.com/sim-dune/ZJaWY5isqbzG1C45/images/evm/defi-positions.svg?fit=max&auto=format&n=ZJaWY5isqbzG1C45&q=85&s=b696fe9e3b1c99d9d2b7c85b5bb1946c" alt="Defi Positions API" width="700" height="282" data-path="images/evm/defi-positions.svg" />

The DeFi Positions API returns a wallet's active positions across liquidity pools, lending protocols, yield strategies, and tokenized DeFi assets. The endpoint is available at the beta path (`/v1/evm/defi/positions`). Each position includes token holdings, USD valuations, underlying asset metadata, and protocol-specific details such as tick ranges, collateral status, or reward accruals.

## Response Structure

Every response contains a `positions` array and an `aggregations` object:

```json theme={null}
{
  "positions": [...],
  "aggregations": {
    "total_value_usd": 4201.34,
    "total_by_chain": {
      "1": 3800.00,
      "8453": 401.34
    }
  }
}
```

Each entry in `positions` has a `type` discriminator field that determines its shape. All positions also include `chain` (string name, e.g. `"ethereum"`) and `chain_id` (numeric). Token metadata is returned as **nested objects** — not flat fields.

## Supported Chains

<SupportedChains endpoint="defi_positions" title="Supported Chains" />

## Supported Protocols

Protocol coverage is organized by position type. Each protocol specifies its supported chains and the API response type under which it appears.

<DefiProtocolsList />

## Compute Units

Each request consumes **10 Compute Units per processed chain ID**. Filtering to fewer chains lowers usage. Aggregations are calculated server-side and included in the same response.

<Note>
  To learn more specifics, please visit the [Compute Units](/compute-units) page.
</Note>


## OpenAPI

````yaml /openapi.json GET /v1/evm/defi/positions/{address}
openapi: 3.0.3
info:
  title: Sim API
  description: >-
    The Sim API by Dune provides real-time blockchain data across EVM and SVM
    chains. Access token balances, transaction history, on-chain activity, DeFi
    positions, NFT collectibles, token information, and webhook subscriptions
    through a unified REST API.
  version: 1.0.0
  license:
    name: ''
  contact:
    name: Dune Support
    url: https://docs.sim.dune.com
    email: support@dune.com
servers:
  - url: https://api.sim.dune.com
security:
  - ApiKeyAuth: []
tags:
  - name: evm
    description: EVM-compatible blockchain endpoints.
  - name: svm
    description: Solana/SVM blockchain endpoints.
  - name: activity
    description: On-chain activity feed.
  - name: balances
    description: Token balances (EVM and SVM).
  - name: transactions
    description: Transaction history (EVM and SVM).
  - name: collectibles
    description: NFT and ERC721/ERC1155 holdings.
  - name: defi
    description: DeFi protocol positions.
  - name: supported-chains
    description: Supported blockchain networks.
  - name: token-info
    description: Token metadata and pricing.
  - name: token-holders
    description: Token holder distribution.
  - name: subscriptions
    description: >-
      Webhook subscription management for real-time on-chain event
      notifications.
paths:
  /v1/evm/defi/positions/{address}:
    get:
      tags:
        - evm
        - defi
      summary: Get DeFi positions for an address
      description: >-
        Returns a wallet's DeFi positions including USD values,
        position-specific metadata, and aggregation summaries across supported
        protocols.
      operationId: getEvmDefiPositions
      parameters:
        - name: address
          in: path
          description: Wallet address to inspect for DeFi positions.
          required: true
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x9512044bc14267a6c588296a20bd7c00e0de7da3'
        - name: chain_ids
          in: query
          required: false
          description: >-
            Filter by chain(s). Accepts numeric chain IDs and/or tags. Provide a
            single value (e.g. `?chain_ids=1` or `?chain_ids=mainnet`) or a
            comma-separated list (e.g. `?chain_ids=1,8453,testnet`). Chain names
            are not accepted. If this query parameter is omitted, results
            include positions from chains with the `default` tag. See the
            [Supported Chains Tags](/evm/supported-chains#tags) section.
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefiPositionsResponse'
              examples:
                success:
                  value:
                    positions:
                      - type: Erc4626
                        chain: ethereum
                        chain_id: 1
                        protocol: Unknown
                        token:
                          address: '0xa3931d71877c0e7a3148cb7eb4463524fec27fbd'
                          name: Savings USDS
                          symbol: sUSDS
                        underlying_token:
                          address: '0xdc035d45d973e3ec169d2276ddab16f1e407384f'
                          name: USDS Stablecoin
                          symbol: USDS
                          decimals: 18
                          holdings: 47.05
                        balance: 43.09
                        price_usd: 1.092
                        value_usd: 47.06
                        preview_redeem: 47.05
                        convert_to_assets: 47.05
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/1/0xdc035d45d973e3ec169d2276ddab16f1e407384f
                      - type: Tokenized
                        chain: ethereum
                        chain_id: 1
                        token_type: AtokenV2
                        token:
                          address: '0x030ba81f1c18d280636f32af80b9aad02cf0854e'
                          name: Aave interest bearing WETH
                          symbol: aWETH
                        underlying_token:
                          address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
                          holdings: 0.05158
                        lending_pool: '0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9'
                        balance: 0.04962
                        price_usd: 2116.32
                        value_usd: 105.01
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/1/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
                      - type: UniswapV2
                        chain: ethereum
                        chain_id: 1
                        protocol: ShibaSwapV2
                        pool: '0x76ec974feaf0293f64cf8643e0f42dea5b71689b'
                        token0:
                          address: '0x198065e69a86cb8a9154b333aad8efe7a3c256f8'
                          name: KOYO
                          symbol: KOY
                          decimals: 18
                          price_usd: 0.0000765
                          holdings: 75856.43
                        token1:
                          address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
                          name: Wrapped Ether
                          symbol: WETH
                          decimals: 18
                          price_usd: 2035.61
                          holdings: 0.00283
                        lp_balance: '0x8ac7230489e80000'
                        balance: 10
                        price_usd: 1.1577
                        value_usd: 11.577
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/1/0x198065e69a86cb8a9154b333aad8efe7a3c256f8
                      - type: Nft
                        chain: ethereum
                        chain_id: 1
                        protocol: UniswapV3
                        pool: '0x24a3ab2a20f5e903b5bb3efc3b4a60fcda17b496'
                        token0:
                          address: '0x6793655c396eaee311fb4d3596b88fd7d195c79e'
                          name: degeneratorv2
                          symbol: DGENV2
                          decimals: 8
                        token1:
                          address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
                          name: Wrapped Ether
                          symbol: WETH
                          decimals: 18
                        positions:
                          - tick_lower: -887270
                            tick_upper: 230270
                            token_id: '0x1b621'
                            token0:
                              holdings: 4349.16
                              rewards: 6.29
                            token1:
                              price_usd: 2035.61
                              holdings: 0.04326
                              rewards: 0.03198
                        logo: null
                        value_usd: 176.34
                      - type: NftV4
                        chain: ethereum
                        chain_id: 1
                        protocol: UniswapV4
                        pool_id: >-
                          0x9b12b3178fc669bfdb323817678bd93e1248def252c75dbf37395f3260f98148
                        pool_manager: '0x000000000004444c5dc75cb358380d2e3de08a90'
                        salt: >-
                          0x000000000000000000000000000000000000000000000000000000000001ac85
                        token0:
                          address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                          name: USD Coin
                          symbol: USDC
                          decimals: 6
                        token1:
                          address: '0xbd4b6f3b2278d727ae740c5449aaed6a09788e7c'
                          name: APXCOIN
                          symbol: APX
                          decimals: 18
                        positions:
                          - tick_lower: -887220
                            tick_upper: 887220
                            token_id: '0x1ac85'
                            token0:
                              price_usd: 0.9999
                              holdings: 59.26
                              rewards: 0.67
                            token1:
                              price_usd: 5.12
                              holdings: 10.55
                              rewards: 1.27
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
                        value_usd: 120.41
                      - type: CompoundV2
                        chain: ethereum
                        chain_id: 1
                        token:
                          address: '0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5'
                          name: Compound Ether
                          symbol: cETH
                        underlying_token:
                          address: '0x0000000000000000000000000000000000000000'
                          name: Ether
                          symbol: ETH
                          decimals: 18
                          holdings: 0.01291
                        comptroller: '0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b'
                        protocol: Compound
                        supply:
                          balance: 0.64218463
                          price_usd: 40.93
                          value_usd: 26.28
                          underlying_holdings: 0.01291
                        value_usd: 26.28
                        logo: null
                      - type: Morpho
                        chain: ethereum
                        chain_id: 1
                        morpho: '0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb'
                        market_id: >-
                          0x00edbb2e2de487431e8be432f8f51215b01bcda10503617e2ee9c7d674492b47
                        loan_token:
                          address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                          name: USD Coin
                          symbol: USDC
                          decimals: 6
                        collateral_token:
                          address: '0xcd9f5907f92818bc06c9ad70217f089e190d2a32'
                          name: Senior Royco USDC
                          symbol: srRoyUSDC
                          decimals: 6
                        supply:
                          balance: 1000
                          price_usd: 1
                          value_usd: 1000
                          underlying_holdings: 1000
                        value_usd: 1000
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
                      - type: Pendle
                        chain: ethereum
                        chain_id: 1
                        token_type: Principal
                        token:
                          address: '0x917459337caac939d41d7493b3999f571d20d667'
                          name: PT Ethena USDe 31JUL2025
                          symbol: PT-USDe-31JUL2025
                          decimals: 18
                        asset:
                          address: '0x4c9edd5852cd905f086c759e8383e09bff1e68b3'
                          name: USDe
                          symbol: USDe
                          decimals: 18
                        market: '0x9df192d13d61609d1852461c4850595e1f56e714'
                        balance: 1000
                        price_usd: 0.9995
                        value_usd: 999.5
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/1/0x4c9edd5852cd905f086c759e8383e09bff1e68b3
                      - type: FluidVault
                        chain: base
                        chain_id: 8453
                        vault_address: '0xa0f83fc5885cebc0420ce7c7b139adc80c4f4d91'
                        nft_id: '0xfd8'
                        vault_type: T1
                        is_liquidated: false
                        supply0:
                          token:
                            address: '0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452'
                            name: Wrapped liquid staked Ether 2.0
                            symbol: wstETH
                            decimals: 18
                          quote:
                            balance: 1.5
                            price_usd: 2400
                            value_usd: 3600
                        borrow0:
                          token:
                            address: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
                            name: Ether
                            symbol: ETH
                            decimals: 18
                          quote:
                            balance: 0.5
                            price_usd: 2000
                            value_usd: 1000
                        value_usd: 2600
                        logo: null
                      - type: VeNft
                        chain: base
                        chain_id: 8453
                        ve_contract: '0xebf418fe2512e7e6bd9b87a8f0f294acdc67e6b4'
                        token_id: '0x62ff'
                        underlying_token:
                          address: '0x940181a94a35a4569e4529a3cdfb74e38fd98631'
                          name: Aerodrome
                          symbol: AERO
                          decimals: 18
                        locked_amount: 3.5276
                        lock_end: 1751500800
                        is_permanent: false
                        value_usd: 1.11
                        logo: >-
                          https://api.sim.dune.com/beta/token/logo/8453/0x940181a94a35a4569e4529a3cdfb74e38fd98631
                        protocol: AerodromeVeNFT
                    aggregations:
                      total_value_usd: 22940.04
                      total_by_chain:
                        '1': 16922.23
                        '8453': 6017.82
        '400':
          description: Bad Request - Invalid user address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Collectibles_ErrorResponse'
              examples:
                invalidAddress:
                  value:
                    error: Invalid user address
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
              examples:
                invalidApiKey:
                  value:
                    error: invalid API Key
        '429':
          description: Rate Limit Exceeded - Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayErrorResponse'
              examples:
                rateLimitExceeded:
                  value:
                    error: >-
                      Too many requests. Please contact sales@dune.com to
                      increase your limit.
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Collectibles_ErrorResponse'
              examples:
                internalError:
                  value:
                    error: 'Internal error: unexpected failure'
components:
  schemas:
    DefiPositionsResponse:
      type: object
      required:
        - positions
      properties:
        positions:
          type: array
          items:
            $ref: '#/components/schemas/DefiPosition'
        aggregations:
          allOf:
            - $ref: '#/components/schemas/DefiAggregations'
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/Warning'
          description: >-
            Array of warnings that occurred during request processing. Warnings
            indicate non-fatal issues (e.g., unsupported chain IDs) where the
            request can still be partially fulfilled.
    Collectibles_ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message.
          example: invalid API Key
      required:
        - error
    GatewayErrorResponse:
      type: object
      description: >-
        Error response from the API gateway. Returned for authentication,
        permissions, rate-limiting, and quota errors.
      properties:
        error:
          type: string
          description: Error message.
      required:
        - error
    DefiPosition:
      oneOf:
        - $ref: '#/components/schemas/Erc4626Position'
        - $ref: '#/components/schemas/TokenizedPosition'
        - $ref: '#/components/schemas/UniswapV2Position'
        - $ref: '#/components/schemas/UniswapV3NftPosition'
        - $ref: '#/components/schemas/UniswapV4NftPosition'
        - $ref: '#/components/schemas/CompoundV2Position'
        - $ref: '#/components/schemas/MorphoPosition'
        - $ref: '#/components/schemas/PendlePosition'
        - $ref: '#/components/schemas/FluidVaultPosition'
        - $ref: '#/components/schemas/VeNftPosition'
      discriminator:
        propertyName: type
      description: A single DeFi position. The `type` field discriminates the variant.
    DefiAggregations:
      type: object
      properties:
        total_value_usd:
          type: number
          format: double
          description: Sum of the USD value across all returned positions.
        total_by_chain:
          type: object
          description: Breakdown of USD value by chain, keyed by chain ID as a string.
          additionalProperties:
            type: number
            format: double
    Warning:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Warning code identifier (e.g., 'UNSUPPORTED_CHAIN_IDS')
          example: UNSUPPORTED_CHAIN_IDS
        message:
          type: string
          description: Human-readable warning message
          example: >-
            Some requested chain_ids are not supported. Activity is returned
            only for supported chains.
        chain_ids:
          type: array
          items:
            type: integer
            format: int64
          description: >-
            List of chain IDs that triggered this warning (for chain-related
            warnings)
        docs_url:
          type: string
          description: URL to documentation with more information about the warning
          example: https://docs.sim.dune.com/evm/supported-chains
    Erc4626Position:
      type: object
      required:
        - type
        - chain_id
        - token
        - balance
        - value_usd
      properties:
        type:
          type: string
          enum:
            - Erc4626
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name (e.g. `ethereum`, `base`).
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        protocol:
          type: string
          description: Vault protocol identifier.
        token:
          $ref: '#/components/schemas/DefiTokenRef'
          description: ERC-4626 vault token.
        underlying_token:
          type: object
          description: Underlying token with redeemable holdings.
          properties:
            address:
              type: string
            name:
              type: string
            symbol:
              type: string
            decimals:
              type: integer
              format: int32
            holdings:
              type: number
              format: double
              description: Underlying token amount redeemable from this position.
        balance:
          type: number
          format: double
          description: Vault share balance, decimal-adjusted.
        price_usd:
          type: number
          format: double
          description: USD price per vault share. May be 0 when unavailable.
        value_usd:
          type: number
          format: double
          description: Total USD value of this position.
        preview_redeem:
          type: number
          format: double
          description: >-
            Underlying token amount returned when redeeming all shares (on-chain
            `previewRedeem`).
        convert_to_assets:
          type: number
          format: double
          description: >-
            Underlying token amount for the full share balance (on-chain
            `convertToAssets`).
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    TokenizedPosition:
      type: object
      required:
        - type
        - chain_id
        - token
        - balance
        - value_usd
      properties:
        type:
          type: string
          enum:
            - Tokenized
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        token_type:
          type: string
          description: Token subtype, e.g. `AtokenV2`, `AtokenV3`, `CompoundCToken`.
        token:
          $ref: '#/components/schemas/DefiTokenRef'
          description: The tokenized receipt token (e.g., aToken).
        underlying_token:
          type: object
          description: Underlying token with optional holdings.
          properties:
            address:
              type: string
            holdings:
              type: number
              format: double
              description: Underlying token amount this position represents.
        lending_pool:
          type: string
          description: Lending pool contract address.
        balance:
          type: number
          format: double
          description: Receipt token balance, decimal-adjusted.
        price_usd:
          type: number
          format: double
          description: USD price per receipt token.
        value_usd:
          type: number
          format: double
          description: Total USD value of this position.
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    UniswapV2Position:
      type: object
      required:
        - type
        - chain_id
        - protocol
        - pool
        - token0
        - token1
        - value_usd
      properties:
        type:
          type: string
          enum:
            - UniswapV2
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        protocol:
          type: string
          description: Protocol identifier (e.g., `UniswapV2`, `SushiSwap`, `ShibaSwapV2`).
          example: UniswapV2
        pool:
          type: string
          description: Pair contract address.
        token0:
          $ref: '#/components/schemas/AmmTokenDetails'
          description: Token0 metadata, price, and holdings.
        token1:
          $ref: '#/components/schemas/AmmTokenDetails'
          description: Token1 metadata, price, and holdings.
        lp_balance:
          type: string
          description: Raw LP token balance as a 0x-prefixed hex string.
        balance:
          type: number
          format: double
          description: Decimal-adjusted LP token balance.
        price_usd:
          type: number
          format: double
          description: USD value per LP token.
        value_usd:
          type: number
          format: double
          description: Total USD value of this LP position.
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    UniswapV3NftPosition:
      type: object
      required:
        - type
        - chain_id
        - protocol
        - pool
        - token0
        - token1
        - positions
        - value_usd
      properties:
        type:
          type: string
          enum:
            - Nft
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        protocol:
          type: string
          description: Protocol identifier, typically `UniswapV3`.
          example: UniswapV3
        pool:
          type: string
          description: Pool contract address.
        token0:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: Token0 metadata.
        token1:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: Token1 metadata.
        positions:
          type: array
          description: One or more concentrated liquidity positions in this pool.
          items:
            $ref: '#/components/schemas/NftPositionDetails'
        value_usd:
          type: number
          format: double
          description: Total USD value across all positions in this pool.
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    UniswapV4NftPosition:
      type: object
      required:
        - type
        - chain_id
        - protocol
        - pool_id
        - pool_manager
        - salt
        - token0
        - token1
        - positions
        - value_usd
      properties:
        type:
          type: string
          enum:
            - NftV4
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        protocol:
          type: string
          description: Protocol identifier, typically `UniswapV4`.
          example: UniswapV4
        pool_id:
          type: string
          description: Pool identifier as a 0x-prefixed hex string.
        pool_manager:
          type: string
          description: Uniswap V4 pool manager contract address.
        salt:
          type: string
          description: Salt used in position NFT derivation, as a 0x-prefixed hex string.
        token0:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: Token0 metadata. `0x000...000` denotes the chain's native asset.
        token1:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: Token1 metadata.
        positions:
          type: array
          description: One or more concentrated liquidity positions in this pool.
          items:
            $ref: '#/components/schemas/NftPositionDetails'
        value_usd:
          type: number
          format: double
          description: Total USD value across all positions in this pool.
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    CompoundV2Position:
      type: object
      required:
        - type
        - chain_id
        - token
        - value_usd
      properties:
        type:
          type: string
          enum:
            - CompoundV2
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        protocol:
          type: string
          description: Protocol label (always `Compound`).
        comptroller:
          type: string
          description: Compound comptroller contract address.
        token:
          $ref: '#/components/schemas/DefiTokenRef'
          description: The cToken (e.g., cETH, cUSDC).
        underlying_token:
          type: object
          description: Underlying token with holdings.
          properties:
            address:
              type: string
            name:
              type: string
            symbol:
              type: string
            decimals:
              type: integer
              format: int32
            holdings:
              type: number
              format: double
              description: Underlying token amount represented by this position.
        supply:
          $ref: '#/components/schemas/LendingQuote'
          description: Supply leg. Present when the wallet has a supply position.
        borrow:
          $ref: '#/components/schemas/LendingQuote'
          description: Borrow leg. Present when the wallet has a borrow position.
        value_usd:
          type: number
          format: double
          description: Net USD value (supply minus borrow).
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    MorphoPosition:
      type: object
      required:
        - type
        - chain_id
        - morpho
        - market_id
        - loan_token
        - value_usd
      properties:
        type:
          type: string
          enum:
            - Morpho
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        morpho:
          type: string
          description: Morpho Blue contract address.
        market_id:
          type: string
          description: Morpho market identifier (32-byte hash as 0x-prefixed hex).
        loan_token:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: The loan token for this market.
        collateral_token:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: The collateral token for this market.
        supply:
          $ref: '#/components/schemas/LendingQuote'
          description: Supply leg.
        borrow:
          $ref: '#/components/schemas/LendingQuote'
          description: Borrow leg.
        collateral_quote:
          $ref: '#/components/schemas/LendingQuote'
          description: Collateral leg.
        value_usd:
          type: number
          format: double
          description: Net USD value (supply minus borrow).
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    PendlePosition:
      type: object
      required:
        - type
        - chain_id
        - token_type
        - token
        - balance
        - value_usd
      properties:
        type:
          type: string
          enum:
            - Pendle
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        token_type:
          type: string
          enum:
            - Principal
            - Yield
            - Lp
          description: >-
            Pendle token category: `Principal` (PT), `Yield` (YT), or `Lp` (LP
            share).
        token:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: The Pendle PT, YT, or LP token.
        asset:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: The underlying asset token. Present for PT and YT positions.
        market:
          type: string
          description: Pendle market contract address.
        balance:
          type: number
          format: double
          description: Token balance, decimal-adjusted.
        price_usd:
          type: number
          format: double
          description: USD price per token.
        value_usd:
          type: number
          format: double
          description: Total USD value of this position.
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    FluidVaultPosition:
      type: object
      required:
        - type
        - chain_id
        - vault_address
        - nft_id
        - vault_type
        - is_liquidated
        - value_usd
      properties:
        type:
          type: string
          enum:
            - FluidVault
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        vault_address:
          type: string
          description: Fluid vault contract address.
        nft_id:
          type: string
          description: Position NFT ID as a 0x-prefixed hex string.
        vault_type:
          type: string
          description: Vault type variant (e.g., `T1`, `T2`, `T3`, `T4`).
        is_liquidated:
          type: boolean
          description: Whether the position has been fully liquidated.
        supply0:
          $ref: '#/components/schemas/VaultLeg'
          description: Primary supply leg.
        borrow0:
          $ref: '#/components/schemas/VaultLeg'
          description: Primary borrow leg.
        supply1:
          $ref: '#/components/schemas/VaultLeg'
          description: >-
            Secondary supply leg. Present for multi-collateral vault types (T2,
            T4).
        borrow1:
          $ref: '#/components/schemas/VaultLeg'
          description: Secondary borrow leg. Present for multi-debt vault types (T3, T4).
        value_usd:
          type: number
          format: double
          description: Net USD value (supply minus borrow).
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    VeNftPosition:
      type: object
      required:
        - type
        - chain_id
        - ve_contract
        - token_id
        - underlying_token
        - value_usd
      properties:
        type:
          type: string
          enum:
            - VeNft
          description: Position type discriminator.
        chain:
          type: string
          description: Chain name.
        chain_id:
          type: integer
          format: int64
          description: Numeric EVM chain ID.
        protocol:
          type: string
          description: >-
            Protocol label (e.g., `AerodromeVeNFT`, `VelodromeVeNFT`,
            `CurveVeNFT`).
        ve_contract:
          type: string
          description: Vote-escrow contract address.
        token_id:
          type: string
          description: NFT token ID as a 0x-prefixed hex string.
        underlying_token:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
          description: The governance token locked in this veNFT.
        locked_amount:
          type: number
          format: double
          description: Amount of governance token locked, decimal-adjusted.
        lock_end:
          type: integer
          format: int64
          description: Unix timestamp when the lock expires. 0 for permanent locks.
        is_permanent:
          type: boolean
          description: Whether this is a permanent lock with no expiry.
        value_usd:
          type: number
          format: double
          description: USD value of the locked tokens.
        logo:
          type: string
          nullable: true
          description: URL to a token logo.
    DefiTokenRef:
      type: object
      description: Basic token metadata.
      properties:
        address:
          type: string
          description: Token contract address.
        name:
          type: string
          description: Token name.
        symbol:
          type: string
          description: Token symbol.
    AmmTokenDetails:
      type: object
      description: AMM pool token with price and holdings data.
      properties:
        address:
          type: string
          description: Token contract address.
        name:
          type: string
          description: Token name.
        symbol:
          type: string
          description: Token symbol.
        decimals:
          type: integer
          format: int32
          description: Token decimals.
        price_usd:
          type: number
          format: double
          description: USD price per token.
        holdings:
          type: number
          format: double
          description: Token amount held in this LP position.
    TokenInfoWithDecimals:
      type: object
      description: Token metadata including decimals.
      properties:
        address:
          type: string
          description: Token contract address.
        name:
          type: string
          description: Token name.
        symbol:
          type: string
          description: Token symbol.
        decimals:
          type: integer
          format: int32
          description: Token decimals.
    NftPositionDetails:
      type: object
      description: A single concentrated liquidity position within a Uniswap V3 or V4 pool.
      required:
        - tick_lower
        - tick_upper
        - token_id
      properties:
        tick_lower:
          type: integer
          format: int64
          description: Lower tick bound.
        tick_upper:
          type: integer
          format: int64
          description: Upper tick bound.
        token_id:
          type: string
          description: NFT token ID as a 0x-prefixed hex string.
        token0:
          $ref: '#/components/schemas/NftTokenDetails'
          description: Token0 price, holdings, and unclaimed rewards for this position.
        token1:
          $ref: '#/components/schemas/NftTokenDetails'
          description: Token1 price, holdings, and unclaimed rewards for this position.
    LendingQuote:
      type: object
      description: A single lending position leg (supply, borrow, or collateral).
      properties:
        balance:
          type: number
          format: double
          description: Balance-sheet token balance (e.g., cToken shares).
        price_usd:
          type: number
          format: double
          description: USD price per balance-sheet token.
        value_usd:
          type: number
          format: double
          description: USD value of this leg.
        underlying_holdings:
          type: number
          format: double
          description: Underlying token amount this leg represents.
    VaultLeg:
      type: object
      description: A Fluid Vault supply or borrow leg (token + quote).
      properties:
        token:
          $ref: '#/components/schemas/TokenInfoWithDecimals'
        quote:
          $ref: '#/components/schemas/VaultQuote'
    NftTokenDetails:
      type: object
      description: Per-token details for a concentrated liquidity NFT position.
      properties:
        price_usd:
          type: number
          format: double
          description: USD price per token.
        holdings:
          type: number
          format: double
          description: Amount of this token in the position.
        rewards:
          type: number
          format: double
          description: Unclaimed fees/rewards in this token.
    VaultQuote:
      type: object
      description: USD-denominated balance for a Fluid Vault leg.
      properties:
        balance:
          type: number
          format: double
          description: Token balance, decimal-adjusted.
        price_usd:
          type: number
          format: double
          description: USD price per token.
        value_usd:
          type: number
          format: double
          description: USD value of this leg.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Sim-Api-Key
      description: >-
        API key for authentication. Obtain your key from the Dune dashboard at
        sim.dune.com.

````