Skip to content

Markets shown to users are hardcoded fixtures, not contract state #203

Description

@Muyideen-js

Problem

The markets a visitor sees are invented in JavaScript and have no relationship to the deployed
contract.

  • frontend/pages.js:1 -- pageMarkets is a literal array of six markets with hardcoded yes:
    percentages (54, 68, 76, 47, 61, 43) and close labels like "Month end"
  • frontend/script.js:9 -- baseMarkets is another hardcoded array; exactly one entry carries
    onchainId: 3, and only that one can be traded

The probability bars are therefore decoration. A market shown at "68% Yes" is 68% because someone
typed 68, not because of anything in the YES/NO pools. The catalogue does not change when markets
are created, resolved, or cancelled on chain.

The contract already exposes everything needed: get_market_count, get_market(market_id),
get_open_market_count, get_market_bettors_page.

Acceptance criteria

  • markets.html and the landing page enumerate real markets via get_market_count +
    get_market, with no hardcoded market array left in the codebase
  • Implied probability is derived from the YES/NO pool totals, not a literal
  • Close time, resolution status, and cancellation state come from the contract
  • Resolved and cancelled markets are visibly distinguished from open ones
  • Read calls use simulation only -- no signing, no fees (see the read-only pattern in
    docs/CONTRACT_CALLS.md)
  • Empty state when no markets exist; error state when RPC is unreachable

Why this is critical

The product presents itself as a live prediction market. Today it displays fiction with a real
Connect button next to it, which misleads anyone who funds a wallet and tries to trade.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: frontendWeb client, wallet, and user experiencebugSomething isn't workingpriority: criticalCritical to protocol safety or mainnet readiness

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions