Practical overview
When it fits
Use the repository when evaluating or studying a Solana lottery program’s described ticket and draw mechanics; the supplied documentation does not establish a complete user-facing participation workflow.
Who it is for
- Solana users researching a participant-funded lottery mechanism.
- Developers inspecting or adapting an Apache-2.0 Rust lottery program.
Documented uses
- Review how ticket transactions are checked and recorded.
- Understand the described lottery account initialization and winner-selection flow.
- Inspect a Rust implementation that uses Solana accounts and a program-derived address.
Requirements & limits
The repository is public and identified as open source under the Apache-2.0 license.
- The README describes a participant cap of 300 and a draw triggered by the participant limit or a time condition.
- Ticket purchases are described as SOL transfers recorded by the program.
- The documentation shows initialization and ticket-handling code but not a complete installation, deployment, or player-facing guide.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Initialize the SOLotery stake account
Set up the lottery account and initialize its state using the documented `create_stake` program function.
Before you start
- A Solana program containing the documented
create_stakefunction andCreateaccounts structure. - A user signer account to pay for initialization.
- The
soloteryaccount is initialized withSoLotery::SIZE + 8bytes of space, as specified in the account constraint. - The Solana system program account.
Steps
Derive the stake PDA using the
SOLOTERYseed and the program ID.Initialize the
soloteryaccount with the PDA seed, bump, payer, and required account space.Run the documented initialization logic to store the bump, reset players and winner state, set the time check, and initialize ticket sales.
Expected outcome
The lottery account is initialized with its bump and starting state, including reset player and winner fields and initialized ticket sales.
Guide limitations
- The time check is set to
DAY_OF_DEPLOY; the source does not explain how that value is defined. - The source does not document wallet setup or the amount required to initialize the account.
Submit a ticket through the documented lottery instruction
Use the documented `ticket` program logic to add a participant to the current lottery state or, after a winner is selected, transfer funds to the winner.
Before you start
- An initialized SOLotery account and the stake PDA derived using the
SOLOTERYseed. - A signer account for the ticket transaction with at least
TICKET_PRICElamports when no winner has been selected. - The supplied winner public key must match the winner public key stored in the SOLotery account.
- The program accounts required by the
Ticketstructure, including the system program.
Steps
Provide the accounts expected by the
Ticketstructure:solotery, signerfrom,stake,winner_publickey, andsystem_program.Submit the ticket instruction with the stake account matching the expected PDA and the winner key matching the stored key.
When no winner has been selected, the program checks the sender's balance, transfers
TICKET_PRICEto the lottery account, and records the participant and ticket.If the player limit is reached or the time check has passed, the program selects a winner; if a winner was already selected, the documented logic instead calls the winner-transfer function.
Expected outcome
A valid ticket call either records a participant and may trigger winner selection, or invokes the winner-transfer logic when the lottery is already in the winner-selected state.
Guide limitations
- The README does not give values for
TICKET_PRICE,MAX_PLAYERS, or the program ID. - The source describes automatic winner selection but does not document how randomness is generated or provide transaction-submission instructions.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- mateolafalce/SOLotery · Official homepage title · retained in its source language

