Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt

Use this file to discover all available pages before exploring further.

Resolution Types

How much must the world move before it counts as having moved? That is the question each resolution type answers. Each market has a resolution type that defines the threshold a price must cross for UP to win. Fourteen types — fourteen definitions of “enough.”

Type Reference

Standard Types (0-7)

ValueNameThresholdUP Wins WhenDOWN Wins When
0UP_00%Price increases by any amount (> 0%)Price stays flat or decreases
1UP_300.30%Price increases by > 30 bpsPrice does not exceed +30 bps
2UP_XCustomPrice increases by > X bpsPrice does not exceed +X bps
3DOWN_00%Price decreases by any amount (< 0%)Price stays flat or increases
4DOWN_300.30%Price decreases by > 30 bpsPrice does not exceed -30 bps
5DOWN_XCustomPrice decreases by > X bpsPrice does not exceed -X bps
6FLAT_00%Price does not change (exactly 0%)Price changes by any amount
7FLAT_XCustomPrice stays within X bpsPrice moves more than X bps

Extended Types (8-13)

These are hardcoded convenience presets for common volatility bands. They don’t use the customThresholds array.
ValueNameThresholdUP Wins WhenDOWN Wins WhenFLAT When
8UP_3003%Price increases by > 300 bps (3%)Otherwise
9UP_300030%Price increases by > 3000 bps (30%)Otherwise
10DOWN_3003%OtherwisePrice decreases by > 300 bps (3%)
11DOWN_300030%OtherwisePrice decreases by > 3000 bps (30%)
12FLAT_3003%Price > +3%Price < -3%abs(change) < 3%
13FLAT_300030%Price > +30%Price < -30%abs(change) < 30%

Custom Thresholds

Resolution types ending in _X (UP_X, DOWN_X, FLAT_X) accept a custom threshold in basis points. The threshold is set per market when creating the batch via the customThresholds array in createBatch(). 1 basis point = 0.01% Examples:
  • Threshold of 10 = 0.10%
  • Threshold of 30 = 0.30%
  • Threshold of 50 = 0.50%
  • Threshold of 100 = 1.00%
  • Threshold of 500 = 5.00%
For non-custom types (UP_0, UP_30, DOWN_0, DOWN_30, FLAT_0), the threshold value in customThresholds is ignored (pass 0).

Resolution Logic

At the end of each tick, the oracle network computes the price change percentage for each market:
priceChange = (closePrice - openPrice) / openPrice * 10000  // in basis points
The outcome for each market is then determined by the resolution type:
Resolution TypeUP Outcome (bitmap bit = 1)DOWN Outcome (bitmap bit = 0)
UP_0priceChange > 0priceChange <= 0
UP_30priceChange > 30priceChange <= 30
UP_XpriceChange > XpriceChange <= X
DOWN_0priceChange < 0priceChange >= 0
DOWN_30priceChange < -30priceChange >= -30
DOWN_XpriceChange < -XpriceChange >= -X
FLAT_0priceChange == 0priceChange != 0
FLAT_Xabs(priceChange) < Xabs(priceChange) >= X
UP_300priceChange > 300priceChange <= 300
UP_3000priceChange > 3000priceChange <= 3000
DOWN_300priceChange < -300priceChange >= -300
DOWN_3000priceChange < -3000priceChange >= -3000
FLAT_300abs(priceChange) < 300abs(priceChange) >= 300
FLAT_3000abs(priceChange) < 3000abs(priceChange) >= 3000

Storage

Resolution types are stored as raw uint8 values in the off-chain batch config (never stored on-chain). The oracle resolver interprets them at tick resolution time. The Solidity enum in IVision.sol defines the first 8 types for reference; types 8-13 are oracle-level extensions.

Choosing a Resolution Type

Use CaseRecommended TypeWhy
Bet on any price increaseUP_0Lowest threshold — any upward movement wins
Filter out noiseUP_30 or DOWN_3030 bps threshold filters micro-movements
High-conviction directional betsUP_X or DOWN_X with large thresholdOnly large moves win — higher risk, higher reward concentration
Range-bound marketsFLAT_XBet that the price stays within a band
Exact stagnation betsFLAT_0Extremely rare — price must not move at all

Example Batch Configuration

A batch with 3 markets using different resolution types:
{
  "marketIds": ["BTC", "ETH", "DOGE"],
  "resolutionTypes": [1, 0, 2],
  "tickDuration": 3600,
  "customThresholds": [0, 0, 100]
}
  • BTC uses UP_30 (enum 1): UP wins if BTC price increases by at least 0.30%
  • ETH uses UP_0 (enum 0): UP wins if ETH price increases by any amount
  • DOGE uses UP_X (enum 2) with threshold 100: UP wins if DOGE price increases by at least 1.00%

Tick Duration and Threshold Pairing

Higher thresholds mean more FLAT outcomes and fewer winning/losing rounds. Choose based on the expected volatility of your markets and the tick duration:
  • Short ticks (5-10 min): Use UP_0 or DOWN_0 for maximum action. Small price movements still produce winners.
  • Medium ticks (1 hour): Use UP_30 or DOWN_30 to filter out noise. Only meaningful moves count.
  • Long ticks (1 day): Use custom thresholds (UP_X) to require substantial moves, since daily volatility is higher.
  • Flat markets: Use FLAT_0 or FLAT_X when you want the game to reward stability detection.
The customThresholds array must be parallel to marketIds. Each entry corresponds to the market at the same index. For non-custom resolution types (like UP_0 or UP_30), the threshold value is ignored but a placeholder (e.g., 0) must still be provided to maintain array alignment, or the transaction reverts with ArrayLengthMismatch.