Quickstart
The simplest way to start using Vaults API is to install an SDK package.
Using npm
npm install @vaultsfyi/sdk
Using Yarn
yarn add @vaultsfyi/sdk
Using pnpm
pnpm add @vaultsfyi/sdk
Using Bun
bun add @vaultsfyi/sdk
Using jspm
jspm install @vaultsfyi/sdk
To start tinkering you ned to obtain an API key, the fastest way is to fill this form https://forms.fillout.com/t/tLA9t6HyAFus
Set your API key as an environment variable
export VAULTS_FYI_API_KEY="your_api_key_here"
Initialize the SDK
import pkg from '@vaultsfyi/sdk';
const { VaultsSdk } = pkg;
const vaultsFyi = new VaultsSdk({
apiKey: process.env.VAULTS_FYI_API_KEY,
});
To take it for a spin, use one of the SDK functions: getDepositOptions to get best DeFi opportunities for a specific blockchain address
const depositOptions = await vaultsFyi.getDepositOptions({
path: { userAddress: '0xdB79e7E9e1412457528e40db9fCDBe69f558777d' },
query: { allowedAssets: ['USDC', 'USDS'] }
});
For more detailed example implementation check out our lightning tutorials (<5 mins!)
Last updated