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

# fetchSupportedAssets

> Retrieve the list of supported deposit assets for a yield strategy

Retrieves the list of tokens supported for deposits into a specific yield strategy.

## Import

```ts theme={null}
import { fetchSupportedAssets } from "@paxoslabs/amplify-sdk";
```

## Usage

```ts theme={null}
const assets = await fetchSupportedAssets({
  yieldType: YieldType.CORE,
});
```

## Parameters

All parameters are optional and can be combined to narrow the results.

| Parameter   | Type        | Required | Description                                                  |
| ----------- | ----------- | -------- | ------------------------------------------------------------ |
| `yieldType` | `YieldType` | No       | Filter by yield strategy (`CORE`, `TREASURY`, or `FRONTIER`) |
| `chains`    | `number[]`  | No       | Filter by chain IDs (e.g., `[1, 8453]`)                      |
| `address`   | `string`    | No       | Filter by exact token address (cache-only)                   |
| `symbol`    | `string`    | No       | Filter by token symbol (cache-only)                          |

```ts theme={null}
interface AssetFilterOptions {
  /** Filter by yield type (CORE, TREASURY, FRONTIER) */
  yieldType?: YieldType;
  /** Filter by chain IDs (e.g., [1, 8453]) */
  chains?: number[];
  /** Filter by exact token address (cache-only) */
  address?: string;
  /** Filter by token symbol (cache-only) */
  symbol?: string;
}
```

<Info>
  The `yieldType` and `chains` filters are applied at the API level. The `address` and `symbol` filters are applied client-side against the cached asset data.
</Info>

## Return Type

<Tabs>
  <Tab title="Type Definition">
    ```ts theme={null}
    interface SupportedAsset {
      /** Token contract address */
      address: `0x${string}`;
      /** Token symbol (e.g., "USDC") */
      symbol: string;
      /** Full token name (e.g., "USD Coin") */
      name: string;
      /** Token decimals (e.g., 6 for USDC) */
      decimals: number;
      /** CoinGecko token identifier for price lookups */
      coinGeckoTokenId?: string;
      /** Chain IDs where this token is supported */
      chains: number[];
    }

    type FetchSupportedAssetsResult = SupportedAsset[];
    ```
  </Tab>

  <Tab title="Example Response">
    ```ts theme={null}
    [
      {
        address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        symbol: "USDC",
        name: "USD Coin",
        decimals: 6,
        coinGeckoTokenId: "usd-coin",
        chains: [1],
      },
      {
        address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
        symbol: "USDT",
        name: "Tether USD",
        decimals: 6,
        coinGeckoTokenId: "tether",
        chains: [1],
      },
    ]
    ```
  </Tab>
</Tabs>

## Examples

<Tabs>
  <Tab title="Basic">
    ```ts theme={null}
    import { fetchSupportedAssets, YieldType } from "@paxoslabs/amplify-sdk";

    // Fetch assets for Core yield strategy
    const coreAssets = await fetchSupportedAssets({
      yieldType: YieldType.CORE,
    });

    console.log(`Found ${coreAssets.length} supported assets`);
    coreAssets.forEach(asset => {
      console.log(`${asset.symbol}: ${asset.address}`);
    });
    ```
  </Tab>

  <Tab title="With React Query">
    ```tsx theme={null}
    import { useQuery } from "@tanstack/react-query";
    import { fetchSupportedAssets, YieldType } from "@paxoslabs/amplify-sdk";

    function useAssets(yieldType: YieldType) {
      return useQuery({
        queryKey: ["assets", yieldType],
        queryFn: () => fetchSupportedAssets({ yieldType }),
        staleTime: 5 * 60 * 1000, // 5 minutes
      });
    }

    // In component
    const { data: assets, isLoading } = useAssets(YieldType.CORE);
    ```
  </Tab>

  <Tab title="Asset Selector">
    ```tsx theme={null}
    import { useState } from "react";
    import { useQuery } from "@tanstack/react-query";
    import { fetchSupportedAssets, YieldType } from "@paxoslabs/amplify-sdk";

    function AssetSelector({ onSelect }: { onSelect: (address: string) => void }) {
      const { data: assets } = useQuery({
        queryKey: ["assets", YieldType.CORE],
        queryFn: () => fetchSupportedAssets({ yieldType: YieldType.CORE }),
      });

      return (
        <select onChange={(e) => onSelect(e.target.value)}>
          <option value="">Select asset</option>
          {assets?.map((asset) => (
            <option key={asset.address} value={asset.address}>
              {asset.symbol}
            </option>
          ))}
        </select>
      );
    }
    ```
  </Tab>
</Tabs>

## Checking Permit Support

To determine the optimal deposit flow for a token, use `prepareDepositAuthorization()` which automatically detects permit support at the contract level:

```ts theme={null}
import { prepareDepositAuthorization, isPermitAuth, YieldType } from "@paxoslabs/amplify-sdk";

const auth = await prepareDepositAuthorization({
  yieldType: YieldType.CORE,
  depositAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  depositAmount: "100",
  to: userAddress,
  chainId: 1,
});

if (isPermitAuth(auth)) {
  console.log("Token supports gasless permit signatures");
} else {
  console.log("Token requires standard approval");
}
```

## Error Handling

| Error Message Pattern   | Description                 | Resolution                    |
| ----------------------- | --------------------------- | ----------------------------- |
| `"SDK not initialized"` | SDK not initialized         | Call `initAmplifySDK()` first |
| `"No vault found"`      | No vault matches parameters | Verify yieldType and chainId  |

```ts theme={null}
import { fetchSupportedAssets, YieldType, APIError } from "@paxoslabs/amplify-sdk";

try {
  const assets = await fetchSupportedAssets({ yieldType: YieldType.CORE });
} catch (error) {
  if (error instanceof APIError) {
    console.error(`API Error [${error.endpoint}]: ${error.message}`);
  }
}
```

## Related

* [YieldType](/v0.4.2/intro/products/earn/developers/types/YieldType) - Yield strategy types
* [Deposit Workflow](/v0.4.2/intro/products/earn/developers/api/deposit-workflow) - Using assets for deposits
* [Deposits Guide](/v0.4.2/intro/products/earn/developers/guides/deposits) - Complete deposit examples
