Protocol writes
| Endpoint | Auth | Notes |
|---|---|---|
POST /api/predictions { marketId, direction, priceAtPrediction, source? } | session or dk_ | the canonical signal write. One scored signal per user per market, first-call-locked. 409 market_closed when settled, 409 already_predicted on a second call, 503 signal_service_unavailable. Returns { ok, id }; receipt at denpa.ai/receipts/<id> |
POST /api/m/[marketId]/streams { url, label? } · DELETE | session or dk_ | stream binding; handle resolved server-side, never from the body |
POST /api/streamer/signal { marketId, name, yesPct?, slug?, annotation?, closesAt? } · DELETE | session or dk_ | push / clear the OBS overlay SIGNAL; same server-side handle rule |
POST /api/signals/[id]/events { type, payload? } | session or dk_ (owner) | append take (mediaAssetId / url / text) · reaffirm · confidence (1–100) · note (≤ 500 chars) · share (channel). Never edits the signal; resolved is resolver-only. 201 { event } |
POST /api/dev/keys { label } · GET · DELETE | Privy JWT | mints dk_ (shown once); lists; revokes |
POST /api/user/follow · DELETE { handle } | session | follow an operator. The route takes a handle, writes the handle-keyed follows table and bridges to the id-keyed user_follows best-effort; the protocol rule is user-to-user by id |
POST /api/live/[handle]/clip | session | MARK ▸ 30 s (Mux clip; cooldown 120 s, 10/day) |
priceAtPrediction
Section titled “priceAtPrediction”The price of the side called, in bps. A NO call sends the NO price. The server keeps a YES snapshot (crowdYesAtSignal, captured at write time when omitted) and normalises a NO call that arrived as the YES price, so stored rows follow one convention.
Fork environment
Section titled “Fork environment”A fork’s own server route proxies these — it never writes from the browser. DENPA_BASE_URL (default https://denpa.ai) is the hub for writes and builds the receipt link. Reference: apps/pundit/app/api/signal/route.ts.