0xtkm/anchor-prediction-market — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a Solana prediction market program for cricket matches using Anchor and Rust. I want users to be able to bet on a match outcome by buying YES or NO shares, where the price moves automatically as people trade using the LMSR formula from the README.

There should be a way to create a market with a question like “Will India win the 2025 Champions Trophy”, set the liquidity value, track YES and NO share totals, let users buy shares with USDC, and show the current implied probability for each side. After the match is finished, an authority should be able to settle the result so winning shares can be redeemed for 1 USDC each and losing shares are worth zero.

Please wire up the accounts cleanly, add useful errors, and include TypeScript tests that create a market, make a few trades, check price movement, settle the market, and redeem winnings. Look up current Anchor docs online if you need to.

Want more depth? Deep Reverse