> ## 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.

# Collect Interest

> Collect accrued interest from a yield position via the Vault

The `ixCollectInterest` method on the `Vault` class creates a transaction instruction that collects accrued interest (paid in SY) from a yield position.

## Usage

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

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

// Collect all available interest
const ix = vault.ixCollectInterest({
  owner: wallet.publicKey,
  amount: amount("All"),
});

const tx = new Transaction().add(ix);
const signature = await sendAndConfirmTransaction(connection, tx, [wallet]);
```

To collect a specific amount:

```typescript theme={null}
const ix = vault.ixCollectInterest({
  owner: wallet.publicKey,
  amount: amount("Some", [500_000n]),
});
```

## Required Parameters

| Parameter | Type | Description |
| - | - | - |
| `owner` | `PublicKey` | The owner's wallet public key |
| `amount` | `Amount` | `amount("All")` or `amount("Some", [value])` |

## Optional Parameters

| Parameter | Type | Description |
| - | - | - |
| `syDst` | `PublicKey` | Destination SY token account. Defaults to owner's ATA |

## Returns

Returns a `TransactionInstruction` that transfers accrued SY interest to the owner.

> [!NOTE]
>
> You must [stage yield](https://docs.exponent.finance/yield-stripping/typescript/yt-instructions/ix-stage-yield) before collecting. Staging computes the earned interest from the exchange rate delta.


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