The protocol mints users tickets instantly upon deposit. This opens a potential attack vector where users could deposit right before a prize, have a chance to win, and withdraw immediately.
To prevent this, each prize pool has a credit rate and credit limit . The credit rate is the rate at which a user accrues credit, the credit limit defines the minimum required credit to withdraw instantly and losslessly. Together these serve to maintain fairness by setting a minimum deposit period.
Users can withdraw instantly before the credit limit is reached but they must either 1) timelock their funds until their credit limit is reached or 2) pay an early exit fee that goes to the prize.
The question of this post is, what should the credit rate and credit limit for a pool be?
In principal, we want the credit limit to be as low as possible. We are trying to prevent abuse of the system by a small subset of users while keeping the smoothest experience for the majority of users.
At first glance the credit limit should simply be equal to the amount of interest a deposit would contribute over a prize period. But there are several factors that can change the cost / benefit balance for depositors, specifically:
- Any subsidies to the prize (whether through sponsored deposits or direct additions)
- Any rewards given to deposits through the token drips
- Fluctuations in the yield rate
- Amount of tickets for a given prize
- Gas fees of entering and exiting the pool
To find the ideal credit limit it is best to estimate the effective apr a pool is offering.
Example
Assume a pool has 100,000 tickets sold and its yield source is returning 5% APR, that would infer a $96 weekly prize. It means over the course of 7 days, one ticket (equaling 1 dollar deposited) contributes $0.0009 to the prize and over the course of one day contributes $0.00012 to the prize.
In this situation, a credit limit should be set to $0.0009 and the credit rate and the credit rate set to $0.00012.
But this pool also has a $1,000 weekly prize subsidy. So the actual prize is $1,096 per week. That would mean the effective APR is 57%! If the credit rate and limit were set to the above it could be very profitably gamed. At 57% APR one ticket (equaling 1 dollar deposited) effectively represents $0.01 to the prize and over the course a week and $0.0015 to the prize each day.
Therefore the credit rate and credit limit need to at minimum be matched to these rates.
Conclusion
The example illustrates how just one factor can impact the effective APR a pool is generating. Given this, I would propose setting the initial credit limit / fairness fee for a 7 day prize period to 0.5% and the daily credit rate to 0.05%.