Overview
The bids API handles all bidding operations in SolBid games. Users can place new bids, end games, and retrieve bid information including PDAs for blockchain operations.
Place bid
curl -X POST https://api.solbid.com/api/bid \
-H "Content-Type: application/json" \
-H "userId: 123" \
-d '{
"gameId": 1,
"bidPda": "CxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsY",
"amount": 2000000,
"playerPda": "DxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsZ",
"creatorPublicKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"bidCount": 2,
"txId": "6k8t9L0nO4qR5sU7wY9zA2bD4eF5gH6iJ7kL8mN9oP0qR1s"
}'
Places a new bid in an active game. Creates a player record if the user hasn’t participated in this game before, or updates existing player data.
Authenticated user’s ID for authorization
Request body
Game ID to place the bid in (positive integer)
Bid’s Program Derived Address on Solana (base58 encoded)
Bid amount in lamports (positive integer)
Player’s Program Derived Address on Solana (base58 encoded)
Player’s Solana wallet public key (base58 encoded)
Sequential bid count for this player (positive integer)
Solana transaction ID for the bid
Response
Updated game information Updated highest bid amount
Timestamp of this bid (ISO 8601)
Incremented total bid count
Updated prize pool amount
Array containing the new player record Player’s wallet public key
Player’s Program Derived Address
Total amount bid by this player
The bid record just created
User profile (name, imageUrl)
200 Success
401 Unauthorized
404 Game not found
400 Validation error
{
"message" : "Game updated successfully" ,
"gameData" : {
"id" : 1 ,
"gameId" : "1" ,
"pda" : "8xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsV" ,
"initialBidAmount" : 1000000 ,
"highestBid" : 2000000 ,
"lastBidTime" : "2026-03-02T21:00:00.000Z" ,
"totalBids" : 6 ,
"lastBidderId" : "CxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsY" ,
"prizePool" : 8000000 ,
"gameEnded" : false ,
"players" : [
{
"id" : 2 ,
"playerPubkey" : "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" ,
"pda" : "DxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsZ" ,
"totalBidAmount" : 2000000 ,
"bidCount" : 2 ,
"royaltyEarned" : 0 ,
"safe" : false ,
"role" : "PLAYER" ,
"bid" : {
"pda" : "CxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsY" ,
"amount" : 2000000 ,
"timestamp" : "2026-03-02T21:00:00.000Z" ,
"txId" : "6k8t9L0nO4qR5sU7wY9zA2bD4eF5gH6iJ7kL8mN9oP0qR1s"
},
"user" : {
"id" : 123 ,
"name" : "PlayerTwo" ,
"imageUrl" : "https://example.com/avatar2.jpg"
}
}
]
}
}
Each bid increments the game’s total bid count and adds to the prize pool.
Get bid PDAs
curl "https://api.solbid.com/api/bid?id=1"
Retrieves all Program Derived Addresses (PDAs) and public keys for players and bids in a specific game. Used for on-chain operations.
Query parameters
Game ID to fetch PDAs for
Response
Array of player wallet public keys
200 Success
404 Game not found
404 Missing ID
{
"message" : "PDAs and public keys fetched successfully" ,
"playersPda" : [
"9xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsW" ,
"DxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsZ"
],
"bidsPda" : [
"AxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsX" ,
"CxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsY"
],
"playersPubkey" : [
"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" ,
"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
]
}
End game
curl -X PUT https://api.solbid.com/api/bid \
-H "Content-Type: application/json" \
-H "userId: 123" \
-d '{
"gameId": 1,
"amount": 3000000,
"playerPda": "ExKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsA",
"creatorPublicKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"bidCount": 10,
"bidPda": "FxKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsB",
"txId": "7m9u0M1pP5rS6tV8xZ0aB3cE5fG6hI7jK8mN9oP0qR1sT2u",
"playerData": [
{
"playerId": 1,
"total_bid_amount": 5000000000,
"royalty_earned": 500000,
"bid_count": 5,
"safe": true
},
{
"playerId": 2,
"total_bid_amount": 3000000000,
"royalty_earned": 200000,
"bid_count": 3,
"safe": false
}
]
}'
Ends a game by placing the final bid and updating all player statistics with final data from the blockchain. This marks the game as ended and assigns winner/finisher roles.
Authenticated user’s ID for authorization
Request body
Final bid amount in lamports
Finisher’s wallet public key
Array of all player final statistics from blockchain Final total bid amount in lamports
Whether player’s position is safe
Response
200 Success
401 Unauthorized
404 Game not found
400 Validation error
{
"message" : "Game and players updated successfully"
}
When ending a game:
The game’s gameEnded field is set to true
All player statistics are updated with final blockchain data
The finisher is assigned the FINISHER role
The player with bidCount - 1 is assigned the WINNER role
Lamports are converted to USDC for storage