Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
04. Auto-open a market for every event
Read docs/prompts/event-markets/README.md first.
The problem
Markets only work if they exist the moment an event is announced. A person opening each one by hand means most events never get one.
Build
Check for the contract in api/_lib/event-markets/. If absent, create the minimal seam from the README first.
api/_lib/event-markets/sources/: one adapter per event source that lists upcoming and live events with their entrants from our own tables: Arena tournaments, the/playplatform event, launch cohorts and seasons, program rounds, bounties. Each adapter returns normalized{ sourceKind, sourceRef, title, startsAt, endsAt, entrants[] }.api/cron/event-markets-open.js: for every event without a market, create one: slug, title phrased as a question ("Who wins X?"), outcomes from entrants with their images and profile refs,opens_atnow,locks_atat event start or a documented fraction into it,resolves_atat event end, and the matching resolution rule. Idempotent on(source_kind, source_ref).- Late entrants: when an event gains an entrant before lock, add the outcome and keep existing picks intact. After lock, never change outcomes.
- Too few entrants (under two) or an event with no defined winner: skip and record why in a log table so the owner can see skipped events.
- Admin view
/admin/event-markets(or the admin pattern in use): events with and without markets, skipped reasons, a button to open or void one by hand. - Emit an
event_market.openedrecord the announcement brief can read (a row in an outbox table, not an in-process call), so the two features stay independent.
Docs and wiring
docs/event-markets.md section "Which events get a market", vercel.json cron, scheduler sync, STRUCTURE.md, changelog entry tagged feature.
Acceptance
- Run the cron against production data on a spare local port (see the local API testing note in your memory index) and show a market created for each live event type, with correct entrants.
- Run it twice: no duplicates.
- A late entrant appears as an outcome before lock and not after.
npm testgreen.