Skip to main content
The Vaults.fyi SDK gives you typed access to 1,000+ DeFi yield strategies across 80+ protocols. This guide walks you through installation, authentication, and your first API call.
1

Install the SDK

Add the SDK to your project using your preferred package manager.
npm install @vaultsfyi/sdk
2

Set your API key

Export your API key as an environment variable so the SDK can authenticate your requests.
export VAULTS_FYI_API_KEY="your_api_key_here"
You need an API key to use the SDK. Request one by filling out this form. Keys are typically issued within one business day.
3

Initialize the client

Import the SDK and create a client instance using your API key from the environment.
import pkg from '@vaultsfyi/sdk';
const { VaultsSdk } = pkg;

const vaultsFyi = new VaultsSdk({
  apiKey: process.env.VAULTS_FYI_API_KEY,
});
4

Make your first call

Call getDepositOptions to fetch personalized yield opportunities for a wallet address. The response is filtered by the assets you specify.
const depositOptions = await vaultsFyi.getDepositOptions({
  path: { userAddress: '0xdB79e7E9e1412457528e40db9fCDBe69f558777d' },
  query: { allowedAssets: ['USDC', 'USDS'] }
});

console.log(depositOptions);
getDepositOptions ranks results by APY and filters out vaults below minimum TVL thresholds. It’s the fastest way to surface relevant opportunities for a specific wallet.

Next steps

Now that your client is working, explore the full set of SDK methods or follow a tutorial for your use case.