OracleMart LogoOracleMart
Smart Contracts

ResolutionEngine

Contract responsible for resolving markets via oracle, manual, or VRF methods

ResolutionEngine

ResolutionEngine is the judge of OracleMart — it determines market outcomes (YES/NO) using multiple resolution methods while preventing manipulation and ensuring auditability.

Overview

  • Determines market outcomes
  • Supports multiple resolution methods
  • Provides consensus and emergency procedures
  • Isolates decision logic from market/betting flow

Resolution Methods

1) Manual (Commit → Reveal)

Purpose: prevents front‑running and manipulation for subjective markets.

Commit steps:

  1. Resolver decides outcome (YES/NO)
  2. Submits commitment hash of decision + secret salt
  3. Waits a timelocked period

Reveal steps:

  1. Reveals outcome + salt
  2. Contract verifies hash
  3. Outcome finalized

2) Oracle (Automated)

Single oracle flow:

  1. Market ends
  2. Oracle fetches price from Chainlink
  3. Compares to threshold/condition
  4. Submits result → finalize

Multi‑oracle consensus:

  1. Multiple oracle submissions
  2. Weighted aggregation
  3. Threshold (for example 51 percent) reached → finalize

Validation:

  • Freshness window (data must be recent)
  • Deviation limits (reject anomalous prices)
  • Approved feed sources only

3) VRF (Random)

Provably fair randomness for gaming‑style markets via Chainlink VRF.

Flow:

  1. Request random number
  2. Receive proof and value
  3. Map number to outcome

Roles

  • Resolver (creator for manual markets): commits and reveals
  • Oracle providers: submit data, participate in consensus
  • Emergency admin: circuit breaker and emergency resolution
  • System admin: oracle configuration, thresholds, pause

Oracle Consensus (example)

Weight‑based voting:

Oracle A: 40% YES
Oracle B: 35% YES
Oracle C: 25% NO
Total YES: 75% → consensus reached

Key parameters:

  • Minimum oracles
  • Consensus threshold (percent)
  • Max allowed deviation (percent)
  • Response timeout

Emergency Procedures

Circuit breaker triggers on:

  • Excessive deviation
  • Stale/failed feeds
  • No consensus

Effects:

  • Pause resolution
  • Require admin review or emergency resolve

Timeout handling:

  • If commit‑reveal not completed in time → emergency path
  • Oracle unavailability → manual admin resolution

Data Flows

Manual:

Commit → Wait → Reveal → Verify → Finalize

Oracle:

End → Fetch price → Validate → Consensus → Finalize

VRF:

End → Request VRF → Receive proof → Compute → Finalize

Security

  • Commit‑reveal with salted hashes
  • Multi‑source oracles with weights
  • Deviation and staleness checks
  • Reentrancy guards and pause

On-chain (Sepolia)

{
  address: "0xdD2DBd78d4D260321735d45EF32Df965c962Ab7F"
}