REST API
Public, edge-cached endpoints powering the dashboard.
The dashboard is built on a small set of public endpoints. They are server-rendered, edge-cached for ~5 seconds and require no authentication.
GET /api/onchain/snapshot
Unified protocol snapshot — vault, risk, strategies, oracle, governance, events. Optional ?account=0x… includes the wallet's position.
bash
curl https://your-app.vercel.app/api/onchain/snapshot?account=0xabc...json
{
"network": { "name": "Polygon Amoy", "blockNumber": 12345678 },
"vault": { "address": "0x...", "asset": "0x...", "totalAssets": "...", "yieldRateBps": 0 },
"risk": { "score": 18, "protectionActive": false },
"strategies":[ { "name":"Aave v3","apyBps":520,"weight":0.42 } ],
"oracle": { "strategyHash":"0x...","score":74 },
"governance":{ "proposalCount": 7 },
"events": [ { "type":"Deposit","tx":"0x...","at":1730000000 } ]
}GET /api/ai/insights
Structured AI insight (headline, risk band, recommendation, allocation, signals).
bash
curl https://your-app.vercel.app/api/ai/insightsPOST /api/ai/rebalance
Streaming rebalance reasoning. Body: { account?, question? }. Response: text/plain stream.
bash
curl -N -X POST https://your-app.vercel.app/api/ai/rebalance \
-H "content-type: application/json" \
-d '{ "question": "Should we increase Aave weight?" }'GET /api/governance/proposals
Indexed proposals from the Governor contract.
bash
curl https://your-app.vercel.app/api/governance/proposals