Skip to content

Optimize status query path to avoid full reverse scan #481

@hman38705

Description

@hman38705

Issue 036: Optimize status query path to avoid full reverse scan

Area: Contracts
Priority: Medium
Files: contracts/predict-iq/src/modules/queries.rs, contracts/predict-iq/src/modules/markets.rs

Problem

get_markets_by_status reverse-scans all markets and becomes expensive at scale. Gas costs grow linearly with market count.

Acceptance Criteria

  • Add status index keys or equivalent strategy\n- Query complexity is reduced\n- Gas benchmark demonstrates improvement\n- Index maintenance cost is documented

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions