Skip to content

PM-11: Resolve Modal — TWAP Resolution #13397

@mzparacha

Description

@mzparacha

Overview

Resolution modal for thread author / community admin to resolve prediction markets using TWAP.

Size: Small
Depends on: PM-7
Blocks: PM-17

Files to Create

  • client/scripts/views/modals/prediction_market_resolve_modal.tsx

Acceptance Criteria

  • Current TWAP probability, TWAP window selector, predicted outcome
  • "Resolve Market" triggers Governor.resolve() on-chain
  • Only visible to thread author / community admin, only enabled after end_time

UI Wireframe

  +---------------------------------------+
  | Resolve: Will ETH reach $5k?         |
  |                                       |
  | Current TWAP Probability:            |
  |                                       |
  | PASS 73% █████████████░░░░░░░ FAIL   |
  |                                       |
  | Threshold: 55%                       |
  | Predicted outcome: PASS              |
  |                                       |
  | This will resolve the market and     |
  | allow winners to redeem tokens.      |
  |                                       |
  | [Cancel]        [Resolve Market]     |
  +---------------------------------------+
             |
             | Wallet TX: Governor.resolve()
             v

Data Flow — RESOLVE FLOW

  1. User (thread author or admin) clicks "Resolve Market"
  2. Frontend: Prompts wallet → calls Governor.resolve()
  3. No immediate API call — EVM worker picks up event
  4. EVM Worker (120s polling) detects ProposalResolved event
  5. Event mapper → Outbox → RabbitMQ
  6. ProjectResolution command → DB update (status=resolved, winner set)
  7. React Query refetch → card shows winner and enables redeem tab

Permission Gating

  • Modal only visible to thread author or community admin
  • "Resolve Market" button only enabled after end_time has passed
  • Use useTopicGating for permission checks

Related

Part of the Prediction Markets (Futarchy) Integration Plan. See common_knowledge/Prediction-Markets.md for full specification.

Metadata

Metadata

Assignees

Labels

ai-readyReady for AI implementationarea:uiFrontend/UI changespriority:highHigh priorityrisk:mediumMedium risk - review carefullytype:featureNew feature (creates feature/* branch)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions