vaults.fyi
  • General
    • 🏦Overview
    • 💡Use Cases
      • For Wallets and Apps
        • Monetize Your Wallet Seamlessly & Securely
      • For Analysts
      • For Protocols & Product Teams
    • 🔎Methodology
      • vaults.fyi USD benchmark rate
      • vaults.fyi ETH benchmark rate
    • ❓FAQ
      • Vault requirements for inclusion on vaults.fyi
    • 🤖AI
  • API
    • Introduction
      • Market data
      • Transactional support
      • Portfolio tracking
      • Personalized insights
    • Quickstart
    • Tutorials
      • Wallet Integration
      • Data Analytics
    • SDK
  • Endpoints
    • General
    • Detailed Vaults
    • Historical
    • Portfolio
    • Transactions
    • Legacy (v1) endpoints
      • v1 Market data
        • Get historical data
          • Get historical APY and TVL data on single vault over timestamp range
          • Get historical APY on single vault over timestamp range
          • Get historical TVL on single vault at single timestamp
          • Get historical APY on single vault at single timestamp
        • Get data for multiple vaults
        • Get data on single vault
          • Get APY on single vault
        • Get benchmark rates
        • Get supported vaults, networks & tokens
          • /vaults
          • /networks
          • /tokens
          • /tags
      • v1 Contextual insights
        • Top vault options for address
        • Get single top option for address
        • [Etherscan cards] Get top USD, top ETH vault for address
      • v1 Generate payloads
        • Prepare calldata
          • Supply/Deposit
          • Withdraw/Redeem
            • Request redeem
            • Claim redeem
          • Claim rewards
        • Get contract interaction details
        • Get supported assets
        • Get supported vaults
      • v1 Position tracking
        • Get user balances
        • Get user positions
        • Get list of past vault txns by user address
        • Get estimated returns for user's vault position
  • Case Studies
    • Kraken Wallet
    • Etherscan Cards
    • Gauntlet
  • Plans
    • Credits
      • Credits (v1 endpoints)
  • Links
    • vaults.fyi
    • X
    • Farcaster
    • Wallfacer Labs
Powered by GitBook
On this page
  1. API

Quickstart

PreviousPersonalized insightsNextTutorials

Last updated 1 day ago

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

Using PIP

pip install vaultsfyi

Using Poetry

poetry add vaultsfyi

To start tinkering you ned to obtain an API key, the fastest way is to fill this form

  1. Set your API key as an environment variable

export VAULTS_FYI_API_KEY="your_api_key_here"
  1. Initialize the SDK

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)
  1. 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'] }
    });
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!)

https://forms.fillout.com/t/tLA9t6HyAFus
Cover
Wallet Integration
Cover
Data Analytics