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

# getYieldDetails

# getYieldDetails

Gets full details for one [Earn](/docs/overview/yield) vault: fixed info like its contract address and curator, plus live numbers like `netApy` and `tvlUsd`. The live numbers are best-effort and may be missing (`undefined`) if that data is temporarily unavailable — always check for that before displaying them.

## Usage

```javascript theme={"system"}
import { getYieldDetails } from '@dynamic-labs-sdk/client';

const details = await getYieldDetails({ vaultId: 'fb-eth-galaxy-usdc-fw-01' });

console.log(details.contractAddress, details.netApy);
```

## Parameters

| Parameter | Type                       | Description                                                                                        |
| --------- | -------------------------- | -------------------------------------------------------------------------------------------------- |
| `vaultId` | `string`                   | Opaque vault identifier, from [`listYieldVaults`](/docs/javascript/reference/client/list-yield-vaults). |
| `client`  | `DynamicClient` (optional) | The Dynamic client instance. Only required when using multiple Dynamic clients.                    |

## Returns

`Promise<YieldVaultDetails>` - The vault's full details.

| Field                    | Type                | Description                                                                                                                                                                                             |
| ------------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `vaultId`                | `string`            | Opaque identifier for the vault.                                                                                                                                                                        |
| `contractAddress`        | `string`            | On-chain contract address of the vault.                                                                                                                                                                 |
| `chainId`                | `number`            | EVM chain ID where the vault is deployed.                                                                                                                                                               |
| `curator`                | `string`            | Name of the organization or team that curates this vault.                                                                                                                                               |
| `assetAddress`           | `string`            | Contract address of the underlying asset token.                                                                                                                                                         |
| `assetSymbol`            | `string`            | Ticker symbol of the underlying asset (e.g. `USDC`).                                                                                                                                                    |
| `assetDecimals`          | `number`            | Number of decimals for the underlying asset token. Use this to format `getYieldPosition` amounts.                                                                                                       |
| `isFeeWrapper`           | `boolean`           | `true` if a fee is taken before your deposit reaches the vault. Informational only — you don't need to do anything differently either way; every Earn function works the same regardless of this value. |
| `netApy`                 | `number` (optional) | Estimated yearly return, as a decimal (e.g. `0.05` = 5% per year). Includes any bonus rewards. Missing when live data is temporarily unavailable.                                                       |
| `netApyExcludingRewards` | `number` (optional) | Same as `netApy`, but base yield only — with bonus rewards excluded.                                                                                                                                    |
| `tvlUsd`                 | `number` (optional) | Total amount deposited in the vault by everyone, in US dollars. Missing when live data is temporarily unavailable.                                                                                      |
| `tvlRaw`                 | `string` (optional) | Same as `tvlUsd`, but in the vault's raw, undecimalized token units instead of dollars. Prefer `tvlUsd` unless you need the raw figure.                                                                 |

<Warning>
  `getYieldDetails` throws if `vaultId` doesn't match a vault available to your environment. This looks identical whether the ID is simply wrong or points to a vault scoped to a different environment — treat any error here as "vault not found."
</Warning>

## Examples

### Format an amount using assetDecimals

```javascript theme={"system"}
import { getYieldDetails } from '@dynamic-labs-sdk/client';
import { formatUnits } from 'viem';

const details = await getYieldDetails({ vaultId: 'fb-eth-galaxy-usdc-fw-01' });

console.log(`${details.assetSymbol} decimals: ${details.assetDecimals}`);
console.log(
  `TVL: ${details.tvlRaw ? formatUnits(BigInt(details.tvlRaw), details.assetDecimals) : 'n/a'}`
);
```

## React

```tsx theme={"system"}
import { useGetYieldDetails } from '@dynamic-labs-sdk/react-hooks';

function VaultDetails({ vaultId }: { vaultId: string }) {
  const { data: details, isLoading } = useGetYieldDetails({ vaultId });

  if (isLoading) {
    return <p>Loading...</p>;
  }

  return (
    <p>
      {details?.assetSymbol} vault by {details?.curator} — APY:{' '}
      {details?.netApy ?? 'n/a'}
    </p>
  );
}
```

## Related

* [`listYieldVaults`](/docs/javascript/reference/client/list-yield-vaults) - List all accessible vaults
* [`getYieldPosition`](/docs/javascript/reference/client/get-yield-position) - A wallet's position in this vault
* [`depositToYieldVault`](/docs/javascript/reference/client/deposit-to-yield-vault) - Deposit into this vault
