Type: BUG
Severity: Medium
Component: oracle/index.js
Context
The resolveCryptoPrice function hardcodes the BTC price threshold check: if the question includes 100k or 100,000, resolve to outcome 0 if BTC price is above 100,000. This means any BTC market with a different threshold (e.g. Will BTC reach ) will always resolve incorrectly because the threshold is not parsed from the market question. It also means non-BTC crypto markets (ETH, SOL) are not handled at all.
Root Cause
The threshold value 100000 is hardcoded in the resolveCryptoPrice function. There is no logic to extract the threshold from the market question text. Non-BTC assets are not handled.
Fix Guide
- Add a parseThreshold(question) utility function that extracts the numeric threshold from the question using a regex: /\True([\d,]+)k?/i. Handle k suffix (e.g. 100k = 100000).
- Add an extractAsset(question) function that identifies the asset from keywords: bitcoin/btc, ethereum/eth, solana/sol.
- Fetch the price for the identified asset from CoinGecko using the correct asset ID.
- Compare the fetched price against the parsed threshold to determine the outcome.
- Add unit tests for threshold parsing with various formats: , ,000, 100000, .5M.
Guidelines
- Key requirement: Dynamic Threshold Parsing / Multi-asset Support / Regex Extraction / Unit Tests.
Definition of Done
PR and Checkout
git checkout -b fix/oracle-dynamic-threshold-parsing
git add .
git commit -m "fix: implement dynamic threshold parsing and multi-asset support in crypto oracle"
git push origin fix/oracle-dynamic-threshold-parsing
Open a PR against main and include the issue number in the PR description.
Type: BUG
Severity: Medium
Component: oracle/index.js
Context
The resolveCryptoPrice function hardcodes the BTC price threshold check: if the question includes 100k or 100,000, resolve to outcome 0 if BTC price is above 100,000. This means any BTC market with a different threshold (e.g. Will BTC reach ) will always resolve incorrectly because the threshold is not parsed from the market question. It also means non-BTC crypto markets (ETH, SOL) are not handled at all.
Root Cause
The threshold value 100000 is hardcoded in the resolveCryptoPrice function. There is no logic to extract the threshold from the market question text. Non-BTC assets are not handled.
Fix Guide
Guidelines
Definition of Done
PR and Checkout
git checkout -b fix/oracle-dynamic-threshold-parsing
git add .
git commit -m "fix: implement dynamic threshold parsing and multi-asset support in crypto oracle"
git push origin fix/oracle-dynamic-threshold-parsing
Open a PR against main and include the issue number in the PR description.