VyToken (Legacy)

Note: This page documents legacy VyToken contracts. For v3 contracts, see Vault Contract.

VyToken contracts are volatile yield token contracts (vyUSD, vyBTC, vyETH) with enhanced yield optimization from earlier versions.

Connecting to VyToken

Using Wagmi

import { connectVyToken, getContractAddresses, Chain } from "yieldfi-sdk";
import { ethers } from "ethers";
import { useAccount, useWalletClient } from "wagmi";

function VyTokenExample() {
  const { address } = useAccount();
  const { data: walletClient } = useWalletClient();

  const connectVyTokenContract = async () => {
    if (!walletClient || !address) {
      throw new Error("Wallet not connected");
    }

    const provider = new ethers.BrowserProvider(walletClient);
    const signer = await provider.getSigner();

    const contracts = getContractAddresses(Chain.ETHEREUM);
    const vyUSD = connectVyToken(
      contracts.vyUSD,
      vyTokenAbi, // Your VyToken ABI
      signer
    );

    return vyUSD;
  };
}

Using Browser Provider

VyToken-Specific Operations

Deposit YToken

View Methods

Inherited Operations

VyToken inherits all YToken operations (ERC-20 and ERC-4626):

Migration to V3

For new integrations, use v3 contracts:

  • Manager V3 - See Manager Contract

  • Vault Contract - See Vault Contract

Last updated