Integrate
Read protocol state from your own dApp, indexer or backend service.
Read via REST
The simplest way to read protocol state from another app is the JSON snapshot endpoint. It's edge-cached, CORS-open and contains every number the dashboard renders.
ts
const r = await fetch("https://your-app.vercel.app/api/onchain/snapshot")
const snapshot = await r.json()Read via ethers
For tighter integrations point ethers at the deployed addresses with the ABIs in lib/contract-abis.ts.
ts
import { ethers } from "ethers"
import { CONTRACT_ADDRESSES, YIELD_VAULT_V4_ABI } from "@/lib/contract-abis"
const provider = new ethers.JsonRpcProvider("https://rpc-amoy.polygon.technology")
const vault = new ethers.Contract(
CONTRACT_ADDRESSES.AMOY.YieldVaultV4,
YIELD_VAULT_V4_ABI,
provider,
)
const tvl = await vault.totalAssets()
const apyBps = await vault.yieldRate()Submitting transactions
Use a browser provider for user-signed transactions. The vault and governance contracts use plain ABI calls — no extra meta-tx wrapping needed.
ts
const provider = new ethers.BrowserProvider(window.ethereum)
const signer = await provider.getSigner()
const vault = new ethers.Contract(VAULT_ADDRESS, YIELD_VAULT_V4_ABI, signer)
await (await vault.deposit(amount, await signer.getAddress())).wait()