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

# Get vault position

> Query a wallet's holdings, display balances, and calculate earned yield.

Once Privy confirms a deposit, your app can query the wallet's holdings using the [get position](/api-reference/wallets/earn/get-position) endpoint. The `assets_in_vault` field shows the current redeemable value, including accrued yield.

<Info>
  View the full [API reference](/api-reference/wallets/earn/get-position) for the get position
  endpoint.
</Info>

## Usage

<Tabs>
  <Tab title="REST API">
    To check a wallet's position via REST API, make a `GET` request to:

    ```bash theme={"system"}
    https://auth.privy.io/api/v1/wallets/{wallet_id}/earn/ethereum/vaults?vault_id={vault_id}
    ```

    ### Parameters

    <ParamField path="vault_id" type="string" required>
      The unique identifier for the vault.
    </ParamField>

    ### Returns

    <ResponseField name="asset" type="object">
      The vault's underlying asset, with `address`, `symbol`, and `decimals` fields.
    </ResponseField>

    <ResponseField name="total_deposited" type="string">
      Total amount deposited into the vault, in the token's smallest unit.
    </ResponseField>

    <ResponseField name="total_withdrawn" type="string">
      Total amount withdrawn from the vault, in the token's smallest unit.
    </ResponseField>

    <ResponseField name="assets_in_vault" type="string">
      Current redeemable value of the wallet's vault shares, including accrued yield.
    </ResponseField>

    <ResponseField name="shares_in_vault" type="string">
      Number of vault shares held by the wallet.
    </ResponseField>

    ### Example

    ```bash theme={"system"}
    curl https://auth.privy.io/api/v1/wallets/{wallet_id}/earn/ethereum/vaults?vault_id={vault_id} \
      -H "privy-app-id: <your-app-id>" \
      -H "Authorization: Basic <credentials>"
    ```

    ```json Example response theme={"system"}
    {
      "asset": {
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "symbol": "usdc",
        "decimals": 6
      },
      "total_deposited": "1000000",
      "total_withdrawn": "0",
      "assets_in_vault": "1050000",
      "shares_in_vault": "1000000000000000000"
    }
    ```
  </Tab>
</Tabs>

## Display balances

| Field             | What it represents                       | How to use it                                         |
| ----------------- | ---------------------------------------- | ----------------------------------------------------- |
| `assets_in_vault` | Current redeemable value including yield | Show this as the user's **current balance**           |
| `total_deposited` | Sum of all deposits                      | Use as the user's **cost basis**                      |
| `total_withdrawn` | Sum of all withdrawals                   | Subtract from `total_deposited` for net contributions |
| `shares_in_vault` | Raw vault shares held                    | Rarely shown to users — use `assets_in_vault` instead |

## Calculate earned yield

To display how much yield a wallet has earned:

```
earned_yield = assets_in_vault - (total_deposited - total_withdrawn)
```

For example, if a wallet deposited 1,000 USDC, withdrew 200 USDC, and `assets_in_vault` is 850 USDC:

```
earned_yield = 850 - (1000 - 200) = 850 - 800 = 50 USDC
```

<Info>
  All amounts are in the token's smallest unit. For USDC (6 decimals), divide by `10^6` before
  displaying to users. For example, `1050000` equals 1.05 USDC.
</Info>

## Next steps

<Card title="Get vault details" icon="vault" href="/wallets/actions/earn/get-vault-details" arrow>
  Retrieve vault-level information like APY, TVL, and available liquidity.
</Card>
