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

# Solana Wallet DeFi Positions API

> Get a Solana wallet's DeFi positions across lending, liquidity, staking, leverage and orders, with value, APY, health and claimable rewards.

The wallet's DeFi positions, largest first. Filter by `platform` or `category`.

Each position has:

* **`assets`**: the tokens in the position, with their role (`supplied`, `borrowed`, `liquidity` or `staked`), amount, price and value. Borrowed tokens have a negative `usd`, so the assets add up to the position's `usd`.
* **`apy` and `yearlyUsd`**: what the position earns in a year at today's rates, after borrowing costs. Leveraged positions can have a large negative `apy`.
* **`healthPercent`** for loans: 100 means no debt, 0 means liquidation.
* **`inRange`** for concentrated liquidity: whether the current price is inside the position's range.
* **`claimable`**: rewards and fees that can be claimed now. Their value is `claimableUsd`, which is not included in `usd`.

`id` stays the same for the life of the position. Token names, symbols and logos are in `tokens`.

Looking for trading profit and loss per token instead? Use [Get Wallet Positions](https://docs.solanatracker.io/data-api/pnl-v2/wallet/get-wallet-positions.md) in PnL V2.

**Paging.** Pass `nextCursor` as `cursor` until `hasNextPage` is `false`, keeping the filters and `sortDirection` the same.

## SDK Example

```typescript
import { Client } from '@solana-tracker/data-api';

const client = new Client({ apiKey: 'YOUR_API_KEY' });

const data = await client.getWalletPositionsV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i', {
  category: 'lending', // Or liquidity, staking, leverage, orders, rewards, other.
  // platform: 'kamino', // An id from client.getPortfolioPlatformsV2().
  limit: 50,
});

for (const position of data.positions) {
  console.log(position.name, position.usd, position.apy, position.healthPercent, position.claimableUsd);
}

// client.iterateWalletPositionsV2() walks every page.
```


## OpenAPI

````yaml /data-api/wallet-v2/openapi.json get /v2/wallet/{wallet}/positions
openapi: 3.1.0
info:
  title: Solana Tracker Wallet API v2
  version: 2.0.0
  description: >-
    What a Solana wallet holds and earns: its tokens and its DeFi positions on
    lending, liquidity, staking, leverage and order platforms, valued in USD and
    SOL, with yield, claimable rewards and net worth history. Percentages are
    plain numbers (6.99 means 6.99%) and times are Unix milliseconds unless
    stated otherwise.
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: Production server
security:
  - apiKey: []
tags:
  - name: Wallet
    description: A wallet's net worth, tokens, DeFi positions and net worth history.
  - name: Platforms
    description: The DeFi platforms Wallet V2 supports.
paths:
  /v2/wallet/{wallet}/positions:
    get:
      tags:
        - Wallet
      summary: Get Wallet Positions
      description: >-
        The wallet's DeFi positions: lending, liquidity, farming, staking,
        leverage and open orders.
      operationId: getWalletPositionsV2
      parameters:
        - $ref: '#/components/parameters/Wallet'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/Platform'
        - $ref: '#/components/parameters/Category'
        - $ref: '#/components/parameters/SortDirection'
      responses:
        '200':
          description: A page of the wallet's DeFi positions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletV2PositionsResponse'
              example:
                wallet: CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i
                slot: 475880664
                updatedAt: 1796067128569
                positions:
                  - id: kamino-vault-LnBhqBJEA4T8JpTSZBrWTFCL4Qa6nWJ6H72ukHkE729
                    platform: kamino
                    service: vault
                    category: liquidity
                    name: Kamino Vault
                    address: LnBhqBJEA4T8JpTSZBrWTFCL4Qa6nWJ6H72ukHkE729
                    usd: 26010.10554
                    apy: 8.77
                    yearlyUsd: 2280.462624
                    claimableUsd: 83.651952
                    healthPercent: null
                    inRange: null
                    assets:
                      - mint: 2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo
                        role: supplied
                        amount: 26005.642935
                        priceUsd: 1.0001716013994661
                        usd: 26010.10554
                        apy: null
                        yearlyUsd: null
                    claimable:
                      - mint: 2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo
                        amount: 83.6376
                        priceUsd: 1.0001716013994661
                        usd: 83.651952
                    image: >-
                      https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fkamino.webp
                  - id: kamino-vault-ADietbkvGfEL5gYFzQN6wzazp4f221tEhZRPUGPck2Sy
                    platform: kamino
                    service: vault
                    category: liquidity
                    name: Kamino Vault
                    address: ADietbkvGfEL5gYFzQN6wzazp4f221tEhZRPUGPck2Sy
                    usd: 21154.671999
                    apy: 8
                    yearlyUsd: 1693.263872
                    claimableUsd: 0
                    healthPercent: null
                    inRange: null
                    assets:
                      - mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        role: supplied
                        amount: 21154.671999
                        priceUsd: 1
                        usd: 21154.671999
                        apy: null
                        yearlyUsd: null
                    claimable: []
                    image: >-
                      https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fkamino.webp
                tokens:
                  EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:
                    name: USD Coin
                    symbol: USDC
                    decimals: 6
                    image: >-
                      https://image.solanatracker.io/proxy?url=https://static.datapi.jup.ag/token-icons/6c4e5669d2a438653105399865445682e4a6cb51e19e1e61dc97578cd27bb9b2.webp
                    supply: 8121434516.222706
                    uri: null
                    description: null
                    creator: null
                    createdOn: null
                    twitter: https://twitter.com/circle
                    telegram: null
                    website: https://www.circle.com/en/usdc
                  2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo:
                    name: PayPal USD
                    symbol: PYUSD
                    decimals: 6
                    image: >-
                      https://image.solanatracker.io/proxy?url=https://static.datapi.jup.ag/token-icons/0817b3345e648b1663385bac48eb086877635ee27639c3d5da2a4d9dfd8603b1.webp
                    supply: 688682738.280124
                    uri: >-
                      https://token-metadata.paxos.com/pyusd_metadata/prod/solana/pyusd_metadata.json
                    description: >-
                      PayPal USD is designed to contribute to the opportunity
                      stablecoins offer for payments and is 100% backed by U.S.
                      dollar deposits, short-term U.S Treasuries and similar
                      cash equivalents. PayPal USD is redeemable 1:1 for U.S.
                      dollars and is issued by Paxos Trust Company.
                    creator: null
                    createdOn: null
                    twitter: null
                    telegram: null
                    website: null
                nextCursor: >-
                  eyJ2IjoyLCJhdCI6MTc5NjA2NzEyODU2OSwicyI6MjExNTQuNjcxOTk5LCJ0Ijoia2FtaW5vLXZhdWx0LUFEaWV0Ymt2R2ZFTDVnWUZ6UU42d3phenA0ZjIyMXRFaFpSUFVHUGNrMlN5IiwicSI6InB8ZHx8In0
                hasNextPage: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/Unavailable'
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


            const client = new Client({ apiKey: 'YOUR_API_KEY' });


            const data = await
            client.getWalletPositionsV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i',
            {
              category: 'lending', // Or liquidity, staking, leverage, orders, rewards, other.
              // platform: 'kamino', // An id from client.getPortfolioPlatformsV2().
              limit: 50,
            });


            for (const position of data.positions) {
              console.log(position.name, position.usd, position.apy, position.healthPercent, position.claimableUsd);
            }


            // client.iterateWalletPositionsV2() walks every page.
      x-code-samples:
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


            const client = new Client({ apiKey: 'YOUR_API_KEY' });


            const data = await
            client.getWalletPositionsV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i',
            {
              category: 'lending', // Or liquidity, staking, leverage, orders, rewards, other.
              // platform: 'kamino', // An id from client.getPortfolioPlatformsV2().
              limit: 50,
            });


            for (const position of data.positions) {
              console.log(position.name, position.usd, position.apy, position.healthPercent, position.claimableUsd);
            }


            // client.iterateWalletPositionsV2() walks every page.
components:
  parameters:
    Wallet:
      name: wallet
      in: path
      required: true
      schema:
        type: string
        default: CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i
      description: Wallet address.
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 100
      description: Rows per page, up to 500. Larger values return 500 rows.
    Cursor:
      name: cursor
      in: query
      schema:
        type: string
      description: >-
        `nextCursor` from the previous page. Keep the other parameters the same,
        or the request returns a 400.
    Platform:
      name: platform
      in: query
      schema:
        type: string
        examples:
          - kamino
      description: >-
        Only positions on this platform. Use an `id` from [Get Portfolio
        Platforms](/data-api/wallet-v2/platforms/get-portfolio-platforms).
    Category:
      name: category
      in: query
      schema:
        type: string
        enum:
          - liquidity
          - lending
          - staking
          - leverage
          - orders
          - rewards
          - other
      description: Only positions in this category.
    SortDirection:
      name: sortDirection
      in: query
      schema:
        type: string
        enum:
          - DESC
          - ASC
        default: DESC
      description: >-
        `DESC` for largest first (default) or `ASC` for smallest first. Rows
        without a value always come last.
  schemas:
    WalletV2PositionsResponse:
      type: object
      required:
        - wallet
        - slot
        - updatedAt
        - positions
        - tokens
        - nextCursor
        - hasNextPage
      properties:
        wallet:
          type: string
        slot:
          type: integer
          description: Solana slot the data was fetched at.
        updatedAt:
          type: integer
          description: When the data was fetched, in Unix milliseconds.
        positions:
          type: array
          items:
            $ref: '#/components/schemas/WalletV2Position'
        tokens:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TradeTokenV2'
          description: 'Details of each token on the page: name, symbol, decimals and logo.'
        nextCursor:
          type:
            - string
            - 'null'
          description: Pass as `cursor` to get the next page. Null on the last page.
        hasNextPage:
          type: boolean
    WalletV2Position:
      type: object
      description: >-
        A DeFi position. Values are in USD and percentages are plain numbers.
        Values that are unknown or don't apply are null.
      required:
        - id
        - platform
        - service
        - category
        - name
        - address
        - usd
        - apy
        - yearlyUsd
        - claimableUsd
        - healthPercent
        - inRange
        - assets
        - claimable
      properties:
        id:
          type: string
          description: >-
            Unique position id, `platform-service-address`. Stays the same for
            the life of the position.
        platform:
          type: string
          description: Platform id from Get Portfolio Platforms.
        service:
          type: string
          description: Service id within the platform, such as `vault` or `lend`.
        category:
          type: string
          enum:
            - liquidity
            - lending
            - staking
            - leverage
            - orders
            - rewards
            - other
        name:
          type: string
          description: Display name, such as `Kamino Vault`.
        address:
          type: string
          description: On-chain address of the position.
        usd:
          type:
            - number
            - 'null'
          description: >-
            Value in USD: supplied minus borrowed. Claimable rewards are not
            included (see `claimableUsd`). Null when a token in it has no price.
        apy:
          type:
            - number
            - 'null'
          description: >-
            Yearly return in percent at today's rates, after borrowing costs.
            Can be negative, and very negative on leveraged positions. Liquidity
            positions earn 0 while out of range. Null when no rate is known.
        yearlyUsd:
          type:
            - number
            - 'null'
          description: >-
            USD earned per year at today's rates. Negative when the position
            costs more than it earns. Null when no rate is known.
        claimableUsd:
          type: number
          description: >-
            Value in USD of `claimable`. Net worth counts `usd` +
            `claimableUsd`.
        healthPercent:
          type:
            - number
            - 'null'
          description: >-
            For loans: how far the position is from liquidation. 100 means no
            debt, 0 means liquidation. Null for other positions or when unknown.
        inRange:
          type:
            - boolean
            - 'null'
          description: >-
            For concentrated liquidity: whether the current price is inside the
            position's range. Null for other positions.
        assets:
          type: array
          items:
            $ref: '#/components/schemas/WalletV2Asset'
        claimable:
          type: array
          items:
            $ref: '#/components/schemas/WalletV2Reward'
          description: Rewards and fees that can be claimed now.
        image:
          type:
            - string
            - 'null'
          description: Platform logo. Null when there is none.
    TradeTokenV2:
      type: object
      description: Token details, current at the time of the request.
      required:
        - name
        - symbol
        - decimals
        - image
        - supply
      properties:
        name:
          type:
            - string
            - 'null'
        symbol:
          type:
            - string
            - 'null'
        decimals:
          type:
            - integer
            - 'null'
        image:
          type:
            - string
            - 'null'
        supply:
          type:
            - number
            - 'null'
          description: Current supply, in whole tokens.
        uri:
          type:
            - string
            - 'null'
          description: Metadata link, when known.
        description:
          type:
            - string
            - 'null'
          description: At most 2,000 characters.
        creator:
          type:
            - string
            - 'null'
        createdOn:
          type:
            - string
            - 'null'
        twitter:
          type:
            - string
            - 'null'
        telegram:
          type:
            - string
            - 'null'
        website:
          type:
            - string
            - 'null'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message.
    WalletV2Asset:
      type: object
      description: A token in a position.
      required:
        - mint
        - role
        - amount
        - priceUsd
        - usd
        - apy
        - yearlyUsd
      properties:
        mint:
          type: string
        role:
          type: string
          enum:
            - supplied
            - borrowed
            - liquidity
            - staked
          description: What the token does in the position. `borrowed` is debt.
        amount:
          type: number
          description: >-
            Amount in whole tokens, always positive. Already adjusted for
            decimals.
        priceUsd:
          type:
            - number
            - 'null'
          description: Price of one token in USD. Null when no price is available.
        usd:
          type:
            - number
            - 'null'
          description: Value in USD. Negative for borrowed tokens. Null without a price.
        apy:
          type:
            - number
            - 'null'
          description: >-
            Yearly rate in percent for this token: earned when supplied, paid
            when borrowed. Null when the platform has no rate per token.
        yearlyUsd:
          type:
            - number
            - 'null'
          description: >-
            USD per year at that rate. Negative for borrowed tokens. Null
            without a rate or price.
    WalletV2Reward:
      type: object
      description: A token that can be claimed.
      required:
        - mint
        - amount
        - priceUsd
        - usd
      properties:
        mint:
          type: string
        amount:
          type: number
          description: Amount in whole tokens.
        priceUsd:
          type:
            - number
            - 'null'
          description: Price of one token in USD. Null when no price is available.
        usd:
          type:
            - number
            - 'null'
          description: Value in USD. Null without a price.
  responses:
    BadRequest:
      description: Invalid wallet address or query parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Invalid sort. Valid options are: value, amount, change24h'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unavailable:
      description: The wallet can't be loaded right now. Retry after `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            example: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Wallet data is temporarily unavailable, please retry
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````

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