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

# getPosition

> Returns an owner's position in an Earn vault

## Function Signature

```typescript theme={"system"}
client.earn.getPosition(params: {
  vaultId: string;
  ownerAddress: string;
  traceContext?: TraceContext;
}): Promise<EarnVaultPosition>
```

## Description

Returns an owner's `shares` and `assets` in an [Earn](https://www.dynamic.xyz/docs/earn/overview.md) vault, both in raw token units. Show `assets`, because it grows as yield accrues. Depending on the vault's provider, `shares` either stays flat or always equals `assets`, so it is not meaningful to show a user.

Available as `client.earn` on `DynamicEvmWalletClient` and `DynamicSvmWalletClient`.

## Parameters

### Required Parameters

* **`vaultId`** (`string`): The vault identifier from [`listVaults`](https://www.dynamic.xyz/docs/node/reference/earn/list-vaults).
* **`ownerAddress`** (`string`): The wallet address that owns the position, typically `walletMetadata.accountAddress`.

### Optional Parameters

* **`traceContext`** (`TraceContext`): Trace context forwarded to the Dynamic API.

## Returns

* **`Promise<EarnVaultPosition>`**: The owner's position. Amounts are raw-unit strings; keep them as strings or `bigint`.

## Example

```typescript theme={"system"}
import { authenticatedEvmClient } from './client';

const evmClient = await authenticatedEvmClient();

const position = await evmClient.earn.getPosition({
  vaultId: 'steakhouse-prime-usdc',
  ownerAddress: walletMetadata.accountAddress,
});

console.log(`Balance: ${position.assets} raw units`);
```

## Error Handling

Fails with an HTTP 403 error when Earn is not enabled for your environment, or an HTTP 400 error when the address does not match the vault's chain family.

## See Also

* [Earn](https://www.dynamic.xyz/docs/node/earn.md)
* [getPerformance](https://www.dynamic.xyz/docs/node/reference/earn/get-performance.md)
* [getEarnings](https://www.dynamic.xyz/docs/node/reference/earn/get-earnings.md)


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