Build

Run it yourself

A pnpm monorepo with four apps and five packages; each app ships as its own Docker image.

web — Next.js 16: pages, API v1, live stream
worker — keeper, House, agents, indexer, archiver
mcp — the MCP server
docs — this site (Fumadocs, static)
contracts — Foundry: RoundBook, HouseVault, PriceGate, AgentPolicy, jobs
core — networks, deployments, records, rules
hedera — SDK, EVM signer, Supra, SaucerSwap, mirror
agents — brains, gates, House policy
db — Drizzle schema

Run it

pnpm install
pnpm typecheck && pnpm lint
cd packages/contracts && forge build && forge test
pnpm --filter @kakehiki/agents test

The worker needs a Postgres URL, Hedera keys for its roles (operator, House, archiver, funder) and an OpenAI key; the web app needs the Postgres URL and a WalletConnect project ID. Keys stay in the worker's environment: the web app holds none.

Ship it

Each app has its own Dockerfile (apps/web, apps/worker, apps/mcp, apps/docs), built from the repository root. Kakehiki runs all of them on one Coolify server with Postgres beside them. Only one worker may run per network at a time: it settles rounds and pays winners.

On this page