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.
- 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
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
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
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
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
getVaultContract(address: string, signer: ethers.Signer): BeefyVaultContract
Creates contract instance for vault interaction.
-
address
: Vault contract address -
signer
: Ethereum signer - Returns: Vault contract interface
npm install @skynetxbt/plugin-beefy-finance
# or
yarn add @skynetxbt/plugin-beefy-finance
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()
]);
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[];
}
- Node.js 14+
- TypeScript 4.5+ (for TypeScript users)
- Web3 provider for contract interactions
- Real-time vault metrics
- Multi-chain support
- Strategy-based filtering
- Smart contract integration
- Comprehensive analytics
- Type-safe interfaces
MIT