Bonsai is a Solana-based price prediction platform that allows users to stake SOL on future price points of various assets. The platform aims to create an engaging, fair, and rewarding environment for price prediction enthusiasts and market analysts. The program utilizes Pyth oracle for price feeds and implements SPL Token for ticket minting and management.
- Exact price prediction: Users specify precise asset prices for specific time slots. High-performing predictors receive the majority of the prize pool, while others can enjoy lottery-style rewards.
- Prediction oracle: Over time, the platform accumulates prediction accuracy data, serving as a price oracle for other platforms. Top predictors receive additional incentives when their predictions are used.
- User Staking:
- Users stake SOL on price predictions
- Minimum stake: 0.01 SOL, Maximum stake: 1 SOL
- Each 0.01 SOL represents one "ticket" in the prediction pool
- Price Prediction Mechanism:
- Users predict prices for specific assets at future timestamps
- Each price point contains 100 tickets (0.01 SOL per ticket)
- Predictions close when all tickets for a time/price slot are sold
- Winning Conditions:
- Settlement triggered by Pyth price oracle when prediction time is reached
- Exact match: 50% of pool distributed to winning tickets
- Proximity winners (within 0.1%): 25% of pool
- Fortune (lottery) winners: 10% of pool
- 15% to reserve (10%) and platform fee (5%)
- Unclaimed rewards go to the reserve pool
- Leaderboard:
- Smart contract tracks prediction accuracy per wallet
- Users accumulate long-term accuracy
- Ranking based on accuracy and prediction frequency
- Future Engagement Mechanisms:
- Dynamic reward multipliers for low-participation periods
- Cumulative jackpots for consecutive low-participation rounds
- Streak bonuses for consistent participation
-
Clone the repository:
git clone https://gitlab.com/atadia/fortune-favor-program cd fortune-favor-program
-
Install dependencies:
npm install
-
Build the program:
anchor build
-
Run tests:
anchor test
- Main program account:
FortuneFavor
- Key accounts:
PriceSlot
,Settlement
- Important instructions:
initialize_slot
,reserve_price_slot
,settle_from_pyth_feed_account
,claim_winner_prize
- Built with Anchor framework
- Uses Pyth oracle for price feeds
- Implements SPL Token for ticket minting and management