Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Fetch the latest APY for a vault
import { getVaultAPY } from "@paxoslabs/amplify-sdk";
const result = await getVaultAPY({ vaultAddress: "0x1234...5678", }); console.log(result.apy); // 4.5 console.log(result.apyFormatted); // "4.50%"
vaultAddress
Address
chainId
number
interface GetVaultAPYParams { vaultAddress: Address; chainId?: number; }
interface VaultAPYResult { /** APY as a number (e.g., 4.5) */ apy: number; /** Formatted APY string (e.g., "4.50%") */ apyFormatted: string; /** Vault address */ vaultAddress: Address; /** Timestamp of the data point */ timestamp: string; }
import { useQuery } from "@tanstack/react-query"; import { getVaultAPY } from "@paxoslabs/amplify-sdk"; function VaultAPYDisplay({ vaultAddress }: { vaultAddress: `0x${string}` }) { const { data, isLoading } = useQuery({ queryKey: ["vaultAPY", vaultAddress], queryFn: () => getVaultAPY({ vaultAddress }), }); if (isLoading) return <span>Loading...</span>; return <span>{data?.apyFormatted ?? "N/A"}</span>; }
"SDK not initialized"
initAmplifySDK()
"No APY data found"
"Failed to fetch vault APY"