@skynetxbt/plugin-beefy-finance
TypeScript icon, indicating that this package has built-in type declarations

1.3.8 • Public • Published

Beefy Finance Plugin

A Skynet XBT plugin for interacting with Beefy Finance yield optimization protocols. This plugin provides comprehensive access to Beefy Finance's vault ecosystem, metrics, and strategies.

Features

  • Access to all Beefy Finance vaults across multiple chains
  • Real-time APY and TVL tracking
  • Advanced vault filtering and suggestions
  • Detailed vault metrics and analytics
  • Strategy-based vault selection
  • Chain-specific vault management

Core API Documentation

Vault Discovery

getVaults(): Promise<BeefyVault[]>

Retrieves all available Beefy Finance vaults.

  • Returns: Array of vault details including assets, strategies, and status
getVaultsByChain(chain: string): Promise<BeefyVault[]>

Gets vaults available on a specific blockchain.

  • chain: Chain identifier (e.g., 'base', 'ethereum')
  • Returns: Chain-specific vault list
getActiveVaults(): Promise<BeefyVault[]>

Fetches only currently active vaults.

  • Returns: List of active vaults accepting deposits
getVaultsByAsset(asset: string): Promise<BeefyVault[]>

Finds vaults containing a specific asset.

  • asset: Asset identifier
  • Returns: Vaults containing the specified asset

Financial Metrics

getVaultFees(): Promise<{ [vaultId: string]: VaultFees }>

Retrieves fee structures for all vaults.

  • Returns: Map of vault IDs to their fee configurations
getVaultTVL(): Promise<VaultTVL>

Gets Total Value Locked for all vaults.

  • Returns: TVL data per vault
getVaultAPY(): Promise<VaultAPY>

Fetches current APY for all vaults.

  • Returns: Current APY rates per vault
getVaultAPYBreakdown(): Promise<{ [vaultId: string]: VaultAPYBreakdown }>

Provides detailed APY composition for vaults.

  • Returns: Breakdown of yield sources per vault

Advanced Analytics

getTopVaultsByTVL(limit = 10, chain = "base"): Promise<Array<{ vault: BeefyVault; tvl: number }>>

Finds vaults with highest Total Value Locked.

  • limit: Number of vaults to return
  • chain: Target blockchain
  • Returns: Sorted list of top TVL vaults
getTopVaultsByAPY(limit = 10, chain = "base"): Promise<Array<{ vault: BeefyVault; apy: number }>>

Identifies highest yielding vaults.

  • limit: Number of vaults to return
  • chain: Target blockchain
  • Returns: Sorted list of highest APY vaults
getFilteredVaults(options: FilterOptions): Promise<VaultSuggestion[]>

Advanced vault filtering with custom criteria.

  • options: Filtering parameters including:
    • minTVL
    • minAPY
    • assets
    • chain
    • strategy types
  • Returns: Filtered and sorted vault suggestions

Protocol Information

getConfig(): Promise<BeefyConfig>

Retrieves protocol configuration.

  • Returns: Current protocol settings and parameters
getBifiStats(): Promise<BifiStats>

Fetches BIFI token statistics.

  • Returns: Token metrics and protocol statistics

Smart Contract Integration

getVaultContract(address: string, signer: ethers.Signer): BeefyVaultContract

Creates contract instance for vault interaction.

  • address: Vault contract address
  • signer: Ethereum signer
  • Returns: Vault contract interface

Installation

npm install @skynetxbt/plugin-beefy-finance
# or
yarn add @skynetxbt/plugin-beefy-finance

Quick Start

import { BeefyFinancePlugin } from '@skynetxbt/plugin-beefy-finance';

// Initialize the plugin
const beefy = new BeefyFinancePlugin();

// Get top performing vaults
const topVaults = await beefy.getTopVaultsByAPY(5, 'base');

// Get filtered vault suggestions
const suggestions = await beefy.getFilteredVaults({
  chain: 'base',
  minTVL: 100000,  // $100k minimum
  minAPY: 10,      // 10% minimum APY
});

// Get vault metrics
const [apy, tvl] = await Promise.all([
  beefy.getVaultAPY(),
  beefy.getVaultTVL()
]);

Types

interface FilterOptions {
  chain?: string;
  minTVL?: number;
  minAPY?: number;
  assets?: string[];
  strategyTypes?: string[];
}

interface VaultMetrics {
  vault: BeefyVault;
  tvl: number;
  apy: number;
}

interface BeefyVault {
  id: string;
  name: string;
  assets: string[];
  status: string;
  platformId: string;
  strategyTypeId: string;
  risks: string[];
}

Requirements

  • Node.js 14+
  • TypeScript 4.5+ (for TypeScript users)
  • Web3 provider for contract interactions

Features

  • Real-time vault metrics
  • Multi-chain support
  • Strategy-based filtering
  • Smart contract integration
  • Comprehensive analytics
  • Type-safe interfaces

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @skynetxbt/plugin-beefy-finance

Weekly Downloads

205

Version

1.3.8

License

none

Unpacked Size

45.8 kB

Total Files

16

Last publish

Collaborators

  • mitrasish
  • 0xarpit