BitFutures: Decentralized Bitcoin Price Prediction Market Implementation#1
Open
samuel-dafeta wants to merge 6 commits into
Open
BitFutures: Decentralized Bitcoin Price Prediction Market Implementation#1samuel-dafeta wants to merge 6 commits into
samuel-dafeta wants to merge 6 commits into
Conversation
- Define administrative constants including contract owner and owner-only error. - Add error codes for various conditions such as not found, invalid prediction, market closed, already claimed, insufficient balance, and invalid parameter.
- Define platform configuration variables including oracle address, minimum stake, fee percentage, and market counter. - Add data maps for market data structure and user predictions tracking.
… claiming - Implement `create-market` to initialize a new prediction market. - Implement `make-prediction` to allow users to place stakes on market outcomes. - Implement `resolve-market` to finalize market outcomes based on oracle data. - Implement `claim-winnings` to distribute winnings to users based on their predictions.
- Implement `get-market` to return details of a specific market. - Implement `get-user-prediction` to return details of a user's prediction in a specific market. - Implement `get-contract-balance` to return the contract's STX balance.
- Implement `set-oracle-address` to update the oracle address. - Implement `set-minimum-stake` to update the minimum stake requirement. - Implement `set-fee-percentage` to update the platform fee percentage. - Implement `withdraw-fees` to allow the contract owner to withdraw accumulated fees.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a complete decentralized prediction market smart contract for Bitcoin price movements on the Stacks blockchain. The implementation includes core functionality for market creation, user predictions, market resolution, and reward distribution.
Changes
Constants and Error Codes
State Management
Core Functions
Administrative Controls
Documentation
Security Considerations
Deployment Notes
Checklist