
Architecture
Each daily “Lotry” cycle involves the deployment of a new token instance, open trading, and a fully on-chain winner selection process. All orchestrated through automated scripts and decentralized randomness.
Daily Token Lifecycle
A new Lotry token is deployed every 23 hours and 45 minutes, marking the beginning of a fresh draw cycle.
A cron job triggers the Lotry API, which interacts with the Token Launchpad Contract to deploy the new daily token.
The newly deployed token has a total supply of 1,000,000,000 (1B), made available on a bonding curve for trading.
Users can buy, hold, or sell tokens anytime during the active draw period.
Token trading remains open until the draw cutoff, after which no further transactions are allowed for that cycle.
Winner Selection Process
At the end of each cycle, a second cron job initiates the draw by calling the Winner Selection Contract.
This contract integrates with Chainlink VRF (Verifiable Random Function) to ensure an unbiased and tamper-proof random number generation process.
Mathematical Logic of Winner Picking
Let there be n wallets participating in the draw, where each wallet ( i ) holds ( W_i ) tokens.
The total circulating tokens in the pool is:
An index array is conceptually constructed to represent every token held in the system, arranged sequentially according to wallet ownership:
Example;
If three wallets are holding 10, 25, and 50 tokens respectively:
W₁
10
[0 – 9]
W₂
25
[10 – 34]
W₃
50
[35 – 84]
A random number ( R ) is requested from Chainlink VRF.
The winner is determined as follows:
The wallet whose assigned range contains the Winning Index is declared the winner.
For example, if ( R = 162 ) and ( T = 85 ):
Since 77 lies in W₃’s range, Wallet 3 is the winner.
This ensures that the probability of winning is directly proportional to the number of tokens held, providing a fair, mathematically verifiable selection mechanism.
Reward Distribution
Once the winner is selected:
89% of the total tax pool (accumulated from the 11% buy/sell tax) is distributed to the winner.
The remaining 11**%** is allocated to the protocol treasury for sustainability, liquidity, and development.
The remaining liquidity in the bonding curve is proportionally distributed among all other token holders (excluding the winner) based on their holdings:
Automation Workflow
All processes in the Lotry.fun ecosystems are fully automated and executed sequentially:
Cron Job 1: Deploys the daily Lotry token from the Launchpad Contract.
Active Phase: Users trade tokens on the bonding curve throughout the draw period.
Cron Job 2: Triggers the Winner Selection Contract post draw period.
Randomness Request: Fetches a verifiable random number from Chainlink VRF.
Winner Determination: Calculates the winning index and selects the winner.
Reward Distribution: Automatically disburses $LOTRY and liquidity according to the distribution logic.
Last updated