How are users' winning possibilities calculated?
Learn more about our operations
Basic description
Users' winning possibilities are calculated based on the duration that the user has stayed in Modulus Protocol in an epoch, and the amount of tokens that they have deposited into pools. Mathematically, we use integral to calculate the number of tickets a user has in each epoch.


How is ticket amount calculated
The ticket amount of each user in an epoch can be calculated by the following formula
In the smart contract, every time a user deposits or withdraws, his ticket amount would be updated via the below function
function _updateAccumulatedTicket(uint256 userIDnow, uint256 beforeUpdateBalance, uint256 latestUpdatedBlock, uint256 currentEpoch) internalThe variable accumulatedTicket[Epoch ID][user] would be updated, which would be used to calculate the user's final ticket amount. In order to give the conveniences to the users making them do not have to do anything, our smart contract would automatically calculate the amount of tickets that is not accumulated (in the cases that user have no changes since the last updated time till the end of the epoch), and then sum it up with the user's accumulated ticket to get the final ticket amount of the user.
Below are the 3 examples that may help you figure out how your winning possibilities are calculated.
Case 1
On the first day of Modulus Protocol, Roberto has deposited 50 stETH, and has held it for the whole epoch duration (7 days). He is considered to be in Epoch 0.
To calculate Roberto's winning possibilities, first of all, Modulus would calculate his ticket amount. To do so, the protocol would take , which is equal to 350 tickets.
So, at Epoch 0, Roberto got 350 tickets.
Case 2
During epoch 0, Chris has deposited 100 stETH on the third day of the epoch, and has held it for the rest of the epoch, which means he has held it for a period of 4 days. Similar to Case 1, Chris would get a ticket amount of tickets.
So, at Epoch 0, Chris got 400 tickets.
Case 3
On the first day of Epoch 0, Anna has deposited 30 stETH; however, she has withdrawn half of them on the fifth day of the Epoch, and has held the rest for the last 2 days of the Epoch.
In this case, the way Anna's ticket amount calculated is a bit different. Here, we would break it down into 2 parts:
The first part would be from the first day to the fifth day. Anna's ticket amount would be tickets.
The second part for the rest of the Epoch would be
At the end of the Epoch, our smart contracts would summarize all Anna's accumulated tickets, which means Anna would get tickets at the end.
So, at Epoch 0, Anna would get 180 tickets.
With tickets given, how are the users' possibilities calculated?
At the end of each epoch, Modulus would automatically calculate how many tickets there are in total. The following formula best describes the winning possibility of a user.
For example, let say there were 650 users participated in Epoch 0, and the total amount of tickets was 125,000. To calculate one's winning chance, we would take his/her ticket amount divided by the total tickets in that epoch, which means:
Roberto in Case 1 would have a winning chance of =
Chris in Case 2 would have a winning chance of =
Anna in Case 3 would have a winning chance of =
*Please note that we don't take decimals
With such a winning chance, how are the winners chosen?
To learn more about how the winners are chosen each week, please browse the next page which is embedded below:
How are lucky winners chosen?Tips: If you deposit more and keep your tokens in Modulus Protocol for the whole epoch, your chance of winning would be higher!
However, don't worry if you deposit less as you would still get a chance of winning super huge prizes!
Last updated