Autonomous OTC derivatives settlement inside an Intel TDX TEE on Eigen Compute.
Two parties draft a custom yes/no contract. Settle prices it, holds both sides' USDC collateral, watches a pre-agreed signed oracle, and settles automatically at expiry. The agent's wallet key is derived from the sealed image digest — neither counterparty nor the operator can move funds outside the sealed code path.
- Live app: https://settle-on-eigen.vercel.app
- TEE agent:
http://34.6.239.230:8080(app0x155E557cbFC91f675D0eB2Cc481220a153F4d8D3on Base sepolia) - TEE verify page (with live logs): https://verify-sepolia.eigencloud.xyz/app/0x155E557cbFC91f675D0eB2Cc481220a153F4d8D3
Two guilds want to bet 500 USDC on a tournament bracket. A farmer wants a 2 000 USDC rainfall hedge. Two traders want a swap on an illiquid token. Today those trades don't happen. The alternatives are all broken:
- Centralized custodians (Betfair, brokers): won't list long-tail risks, 5–10% fees, KYC-heavy.
- Smart contracts: can't run discretionary pricing, can't consume arbitrary signed oracles cheaply, leak the book on-chain.
- Legal contracts: cost > notional for anything under ~$50 k.
Settle fills the gap: arbitrary code + a self-controlled wallet + a hardware-backed proof, all running in a TDX enclave that neither side — nor the operator — can tamper with.
Four guarantees, each coming directly from the TEE:
- Collateral can't be rugged. The wallet key is derived from a sealed secret bound to the image digest. The operator never sees it.
- Pricing can't be rigged. Pricing code is baked into the signed image. Any change means a new digest; counterparties can refuse to accept against an unfamiliar digest.
- Oracle inputs can't be faked. The feed is chosen at origination, frozen for the contract lifetime, and signatures are verified on every read.
- Settlement can't be delayed. The settlement timer runs inside sealed code. The operator can't "pause for maintenance" selectively.
Every state transition emits a signed event carrying the agent's wallet address and the KMS public-key digest. The public contract page renders the full hash-chained log. A verifier script can recover each signer from the canonical bytes + signature and confirm the chain head.
┌─────────┐ ┌────────────┐
│ Party A │─┐ ┌───▶│ OpenRouter │
└─────────┘ │ ┌──────────────────────────────┐ │ │ (LLM + │
├──▶│ Settle agent (TDX TEE) │────┤ │ web search)│
┌─────────┐ │ │ • pricing │ │ └────────────┘
│ Party B │─┘ │ • collateral vault wallet │────┤
└─────────┘ │ • LLM oracle resolver │ │ ┌────────────┐
│ • settlement + fee logic │────┼───▶│ Base L2 │
│ • signed event log │ │ │ (USDC) │
└──────────────────────────────┘ │ └────────────┘
(attested image) │
│ ┌────────────┐
└───▶│ contract │
│ page │
└────────────┘
- Container: Node 22 · Hono · viem · zod
- Runtime: Eigen Compute (Intel TDX),
g1-standard-4t - Settlement chain: Base (USDC, low gas)
- Oracle: OpenRouter LLM with live web search (default:
perplexity/sonar) - Frontend: Next.js 14 on Vercel, with server-side API routes proxying through to the enclave so HTTPS browsers can reach the HTTP TEE cleanly
agent/ Hono service that runs inside the TEE (Dockerfile, state machine, pricing, wallet, OpenRouter oracle).
cli/ `settle` commander CLI for originators.
web/ Next.js contract page — form to originate, accept flow, live attestation chain.
deploy/ `ecloud` deploy scripts and .env template.
data/ Local event log + state (gitignored, TEE holds the authoritative copy).
cd agent
npm install
cp ../deploy/.env.example .env # local dev
SETTLE_ALLOW_DEV_WALLET=1 npm run dev # hono on :8080cd cli
npm install && npm run build
./dist/settle.js originate \
--yes-party 0x… --no-party 0x… \
--question "Will team X win tournament Y?" \
--yes-price 0.4 --notional 10 \
--expiry 2026-05-01T00:00:00Z
./dist/settle.js status <contract_id>cd web
npm install
AGENT_URL=http://localhost:8080 npm run dev
# http://localhost:3000# Build + push amd64 image
cd agent
docker buildx build --platform linux/amd64 -t <registry>/settle:v0.3 --push .
# Deploy (non-interactive flags cover all prompts)
cd ../deploy
./deploy.sh <registry>/settle:v0.3cd web
npx vercel@latest deploy --prod --yes -e AGENT_URL=http://<tee-ip>:8080| Template | Inputs | Oracle | Settlement |
|---|---|---|---|
| Binary (MVP) | question, yes_price, notional, expiry | UMA OOv3 | winner takes pot − fee |
| Vanilla option | strike, expiry, call/put, notional | Chainlink | cash-settled delta |
| Rainfall cap | location, threshold, period | NOAA-signed | stepwise payout |
| Price range | asset, upper, lower, expiry | Chainlink | inside/outside |
MVP ships binary only. Others live in the roadmap.
draft
│ originate()
▼
pending_accept ── atomic verify of both USDC deposits ──┐
▼
live
│ expiry → LLM oracle → payout
▼
settled
Transitions that don't match raise StateError. A refund escape hatch exists for the freeze-and-return case if a TEE vulnerability is disclosed — it only ever returns collateral pro-rata, never to a third address.
Deterministic, no LLM surface:
YES side posts p · notional NO side posts (1 − p) · notional
Fee = 50 bps of pot, split across sides at settlement
Winner receives pot × (1 − fee_bps/10_000); the remainder accrues to the agent wallet.
- USDC only, Base only
- Notional ≥ $1, ≤ $50 000 per contract
- Fully collateralized — no margin calls
- Non-US addresses and non-securities underlyings only (pending legal review)
A plain cloud deployment can't give any of the four guarantees above — the operator can always swap the binary, read the wallet key, stall the oracle poll. A smart contract can't do discretionary pricing or pull from arbitrary signed oracles cheaply. Eigen Compute sits in the gap: arbitrary code, a sealed wallet, and an attestation both counterparties can verify out-of-band before they deposit a dollar.
MVP v0.5 — TypeScript end-to-end (Node 22 + Hono + viem on the agent, Next.js + wagmi on the web, commander on the CLI). Binary contracts live on Base sepolia, oracle resolution via OpenRouter (LLM with live web search), frontend on Vercel.
Roadmap: options + rainfall + range templates, multi-model oracle quorum for contracts > $10 k notional, ERC-8004 reputation, append-only event-log mirror on Base L2 (so upgrade doesn't wipe history), threshold KMS.
MIT.