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 total value locked for a vault
import { getVaultTVL } from "@paxoslabs/amplify-sdk";
const result = await getVaultTVL({ vaultAddress: "0x1234...5678", }); console.log(result.tvl); // "15000000.00" console.log(result.tvlAsset); // "USDC"
vaultAddress
Address
chainId
number
interface GetVaultTVLParams { vaultAddress: Address; chainId?: number; }
interface VaultTVLResult { /** Total value locked as string */ tvl: string; /** Asset denomination (e.g., "USDC") */ tvlAsset: string; /** Vault address */ vaultAddress: Address; /** Chain ID */ chainId: number; /** Timestamp of the data point */ timestamp: string; }
import { useQuery } from "@tanstack/react-query"; import { getVaultTVL } from "@paxoslabs/amplify-sdk"; function VaultTVLDisplay({ vaultAddress }: { vaultAddress: `0x${string}` }) { const { data, isLoading } = useQuery({ queryKey: ["vaultTVL", vaultAddress], queryFn: () => getVaultTVL({ vaultAddress }), }); if (isLoading) return <span>Loading...</span>; const formatted = data ? `$${Number(data.tvl).toLocaleString()} ${data.tvlAsset}` : "N/A"; return <span>{formatted}</span>; }
"SDK not initialized"
initAmplifySDK()
"No TVL data found"
"Failed to fetch vault TVL"