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

# getYieldDetails

# getYieldDetails

Gets full details for one [Earn](/docs/overview/yield) vault: registry data (contract address, curator, underlying asset) merged with live protocol data (`netApy`, `netApyExcludingRewards`, `tvlUsd`) on a best-effort basis — these fields may be omitted if that data is temporarily unavailable.

## 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`           | Whether this vault is a Fireblocks fee-wrapper contract.                                            |
| `netApy`                 | `number` (optional) | Net APY including reward incentives, as a decimal. Omitted when live data is unavailable.           |
| `netApyExcludingRewards` | `number` (optional) | Net APY excluding reward incentives, as a decimal.                                                  |
| `tvlUsd`                 | `number` (optional) | Total value locked, in USD. Omitted when live data is unavailable.                                  |
| `tvlRaw`                 | `string` (optional) | Total value locked, in raw underlying-token units. See `tvlUsd` for the USD-denominated equivalent. |

<Warning>
  `getYieldDetails` throws (via the underlying request) when `vaultId` doesn't
  resolve to a vault accessible to the current environment — an unrecognized
  ID or a private vault scoped to a different environment look the same to
  the caller.
</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
