Chat-driven assistant for Kamino Finance. Ask in plain English — "best USDC yield on Kamino", "deposit 100 USDC", "will this borrow liquidate me?" — and Kami streams a natural-language answer plus, when relevant, a ready-to-sign mainnet transaction.
Live: kami.rectorspace.com · Bounty: Eitherway Track — Frontier Hackathon 2026
Deposited live on mainnet through the deployed UI:
- Tx:
5XKeETjGfmj9jEWUNCKcf8u49bY4hEzX2a7JcB4nPxQCBbmZ7ipoNrgTXQMJWXHvKw7Bsera9xxYygLVxLUpUvZE - Action: 0.5 USDC supplied to Kamino Main Market at ~5.09% APY
- Flow: typed "Deposit 0.5 USDC into Kamino main market" → LLM called
findYield+buildDeposit→ signed in wallet → on-chain confirmed via client-side polling
| Tool | Purpose |
|---|---|
getPortfolio |
Connected wallet's live Kamino position: deposits, borrows, APYs, LTV, health factor |
findYield |
Top reserves by live supply / borrow APY, filterable by symbol |
simulateHealth |
Project the user's health factor after a hypothetical deposit/borrow/withdraw/repay |
buildDeposit · buildBorrow · buildWithdraw · buildRepay
Each builds an unsigned v0 transaction server-side (fresh blockhash, proper compute budget, all required account inits for first-time users), then returns it as base64 wire bytes. The UI renders a Sign & Send card with the exact action/amount/protocol; the user signs with their wallet, the client submits, and on-chain confirmation is polled over HTTP until confirmed or blockhash expiry.
Preflight built-in: every build* tool runs simulateTransaction before returning. If the wallet is short on SOL for account rent, Kami surfaces a precise shortfall — before the user burns a failed-tx fee.
- Frontend — Vite + React 18 + TypeScript + Tailwind. Featured wallet: Solflare via
@solana/wallet-adapter-solflare(unified extension / web / mobile fallback). Any Solana-wallet-standard wallet also works (Phantom, Backpack, etc.) — the "Use another wallet" option lists everything detected. - Chat backend —
server/chat.tsexports a WebReadableStreampowered by Vercel AI SDKstreamText+fullStream. Consumed by Fastify in local dev (server/index.ts) and a Node-style Vercel Function in production (api/chat.ts). One source of truth for tool wiring. - RPC — Same-origin
/api/rpcVercel Function proxies JSON-RPC to Helius server-side. Keeps the key off the browser, avoids CORS, and sidesteps new-domain reputation issues. - LLM —
anthropic/claude-sonnet-4.6via OpenRouter. Swappable viaKAMI_MODEL. - DeFi —
@kamino-finance/klend-sdk7.3 on@solana/kitv2, against the Kamino Main Market. - Transaction build —
createNoopSigner+compileTransaction+getBase64EncodedWireTransaction. The wallet signs on the client; the server never holds a secret key. - Confirmation — HTTP polling over
getSignatureStatuses+getBlockHeight(Vercel Functions can't upgrade WebSockets, so the default subscription-basedconfirmTransactionwould hang).
pnpm install
cp .env.example .env.local # fill KAMI_OPENROUTER_API_KEY + SOLANA_RPC_URL
pnpm dev # web :5173 + api :3001 concurrentlypnpm dev— web + api concurrentlypnpm dev:web— Vite frontend onlypnpm dev:api— Fastify backend only (tsx watch)pnpm build— production bundle (tsc -b && vite build)pnpm exec tsc -p server/tsconfig.json --noEmit— typecheck the server +api/*.tsVercel Functions
- Vercel project
rectors-projects/kami, auto-deploys frommain. - Production env vars:
KAMI_OPENROUTER_API_KEY,KAMI_MODEL,SOLANA_RPC_URL. - Custom domain
kami.rectorspace.comserved from Vercel with auto-renewed SSL (Cloudflare DNS-only).
Initial scaffold generated by Eitherway on 2026-04-19 (tagged eitherway-v0). Everything after is custom: Fastify + Vercel Function backends, Kamino SDK integration, the seven-tool suite, same-origin RPC proxy, preflight simulation, Sign & Send card, and the polling-based confirmation path.