Minimum bid requirements
Initial bid (creating a game)
To create a new game, you must place an initial bid of at least:This minimum ensures the prize pool starts at a meaningful amount. The initial bid becomes the first entry in the prize pool and sets the baseline for subsequent bids.
create_game.rs:35:
Subsequent bids
Every bid after the initial bid must be exactly 2x the current highest bid:- Bid 1: 0.014 SOL (initial)
- Bid 2: 0.028 SOL (2x previous)
- Bid 3: 0.056 SOL (2x previous)
- Bid 4: 0.112 SOL (2x previous)
- Bid 5: 0.224 SOL (2x previous)
Timing rules
Game timeout period
The game has a fixed timeout period:Timer mechanics
Bid is placed
When you successfully place a bid, the smart contract records the current blockchain timestamp as
last_bid_time.Timer starts counting
The 10-minute countdown begins from the moment your bid is confirmed on-chain.
Next bid resets timer
If another player bids before the 10 minutes expire, the timer completely resets to 10 minutes from their bid time.
place_bid.rs:40-44:
The timer is enforced by blockchain timestamps, not client-side timers. This means you cannot manipulate the timing by adjusting your local clock.
Bid validation
Bid count synchronization
Each bid must include the correct bid count to prevent race conditions:Game state validation
Before accepting a bid, the smart contract verifies:- Game is active: The
game_endedflag must befalse - Timer hasn’t expired: Current time minus last bid time must be ≤ 600 seconds
- Bid amount is correct: Must be exactly 2x the current highest bid
- Bid count matches: Your submitted count must match expected count
place_bid.rs:36-38:
Account requirements
Player accounts
Each bid creates a new player account (PDA) with:- Seeds:
["player", game_id, bidder_pubkey, bid_count] - Size: 32 bytes
- Rent: Automatically calculated and paid by bidder
Bid accounts
Each bid also creates a bid record account (PDA) with:- Seeds:
["bid", game_id, bid_count] - Size: 48 bytes
- Rent: Automatically calculated and paid by bidder
The rent for these accounts is typically very small (less than 0.002 SOL total) and is automatically included in your transaction cost.
Transaction costs
When placing a bid, you pay:- Bid amount: The actual bid (2x current highest)
- Account rent: For player and bid PDAs (~0.002 SOL)
- Transaction fee: Standard Solana network fee (~0.000005 SOL)
Example calculation
Edge cases and error handling
Common bid rejection reasons
InsufficientBidAmount
InsufficientBidAmount
Your bid was less than 2x the current highest bid. Check the current game state and submit the correct amount.
GameEnded
GameEnded
The game has already ended and is no longer accepting bids. This can happen if the timer expired between when you loaded the page and submitted your bid.
BidCountMismatch
BidCountMismatch
Another player submitted a bid before yours. Refresh the game state to get the updated bid count and highest bid amount.
InvalidNewPlayerAccount or InvalidNewBidAccount
InvalidNewPlayerAccount or InvalidNewBidAccount
The derived PDA addresses don’t match expected values. This is usually a client-side error in how the PDAs were calculated.
Handling failed bids
If your bid transaction fails:Check the error message
The blockchain will return a specific error indicating why the bid was rejected.
Best practices
Before placing a bid
- ✅ Verify the game is still active
- ✅ Check the time remaining on the timer
- ✅ Confirm you have enough SOL for bid + fees
- ✅ Calculate the exact 2x bid amount
- ✅ Verify the current bid count
During high competition
- ✅ Expect bid count mismatches if multiple players are active
- ✅ Have retry logic ready in your client
- ✅ Monitor the timer closely near expiration
- ✅ Account for blockchain confirmation time (~400-800ms)
Transaction optimization
- ✅ Use
skipPreflight: truefor faster submission in competitive situations - ✅ Set
maxRetriesappropriately (recommended: 3-5) - ✅ Request recent blockhash immediately before sending
Next steps
Prize distribution
Learn how the prize pool is distributed when the game ends
How to play
Review the complete gameplay flow