Getting Started with the SDK
The simplest way to start using the vaults.fyi API is with our SDK.
See below for installation instructions and find additional detailed documentation here: SDK Reference
Using npm
npm install @vaultsfyi/sdkUsing Yarn
yarn add @vaultsfyi/sdk
Using pnpm
pnpm add @vaultsfyi/sdk
Using Bun
bun add @vaultsfyi/sdk
Using jspm
jspm install @vaultsfyi/sdkUsing PIP
pip install vaultsfyiUsing Poetry
poetry add vaultsfyiexport VAULTS_FYI_API_KEY="your_api_key_here"To start using the SDK you'll need to obtain an API key. The fastest way is to fill this form.
import pkg from '@vaultsfyi/sdk';
const { VaultsSdk } = pkg;
const vaultsFyi = new VaultsSdk({
apiKey: process.env.VAULTS_FYI_API_KEY,
});from vaultsfyi import VaultsSdk
api_key = os.getenv("VAULTS_FYI_API_KEY")
client = VaultsSdk(api_key=api_key)- To take it for a spin, use one of the SDK functions:
example:
getDepositOptionsto get multiple relevant yield opportunities for a specific blockchain address.Find more in SDK Reference
const depositOptions = await vaultsFyi.getDepositOptions({
path: { userAddress: '0xdB79e7E9e1412457528e40db9fCDBe69f558777d' },
query: { allowedAssets: ['USDC', 'USDS'] }
});user_address = "0xdB79e7E9e1412457528e40db9fCDBe69f558777d"
deposit_options = client.get_deposit_options(
user_address,
allowed_assets=["USDC", "USDS"]
)For more detailed example implementation check out our lightning tutorials (<5 mins!)
Last updated

