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

# Get Yield Position

> Load and read a user's yield position

The `YtPosition` class represents a user's yield position for a specific vault. It tracks deposited YT balance, accrued interest, and emission rewards.

## Loading a Position

### By address

```typescript theme={null}
import { YtPosition, Vault, LOCAL_ENV } from "@exponent-labs/exponent-sdk";
import { Connection, PublicKey } from "@solana/web3.js";

const connection = new Connection("https://api.mainnet-beta.solana.com");
const vault = await Vault.load(LOCAL_ENV, connection, vaultAddress);

// vault is optional — if omitted, it will be auto-loaded from the position's vault address
const ytPosition = await YtPosition.load(LOCAL_ENV, connection, positionAddress, vault);
```

### By owner

```typescript theme={null}
const ytPosition = await YtPosition.loadByOwner(
  LOCAL_ENV,
  connection,
  wallet.publicKey,
  vault,
);
```

### Multiple positions for one owner

```typescript theme={null}
// Accepts PublicKey[] or (Vault | PublicKey)[] — passing loaded Vault instances avoids redundant RPC fetches
const vaultAddresses = [vaultAddress1, vaultAddress2, vaultAddress3];

const positions = await YtPosition.loadAllByOwner(
  LOCAL_ENV,
  connection,
  wallet.publicKey,
  vaultAddresses,
);
```

## Reading Position State

```typescript theme={null}
console.log("YT balance:", ytPosition.ytBalance);
console.log("Owner:", ytPosition.owner.toBase58());
console.log("Staged interest:", ytPosition.stagedInterest);
```

## Available Properties

| Property         | Type        | Description                                  |
| ---------------- | ----------- | -------------------------------------------- |
| `ytBalance`      | `bigint`    | Amount of YT deposited in the position       |
| `owner`          | `PublicKey` | Owner of the yield position                  |
| `stagedInterest` | `bigint`    | Interest that has been staged for collection |
| `selfAddress`    | `PublicKey` | The yield position PDA address               |
| `vault`          | `Vault`     | The associated vault instance                |

## Refreshing State

```typescript theme={null}
await ytPosition.reload(connection);
```

## Serialization

```typescript theme={null}
const json = ytPosition.toJson();
```

Returns a `YtPositionJson` object with:

* `owner` — Owner public key as string
* `ytBalance` — YT balance as string
* `interest` — Interest tracker with `lastSeenIndex` and `staged`
* `claimableInterest` — Calculated claimable interest amount
* `emissions` — Array of emission trackers
* `vault` — Serialized vault state
