Skip to content

Giveaway

bigzPubkey edited this page Oct 9, 2023 · 2 revisions

Giveaway

The first competition scheme is a promotional giveaway, created with different entry methods to ensure an inclusive and economically Sybil-proof ecosystem.

Overview

Drift-Competitions is designed to add competitive elements to the Drift Protocol ecosystem. The program aims to ensure fairness, transparency, and active participation among users.

Competition Scheme

The competition is a multi-round promotional giveaway. The sponsor specifies the round duration in timestamp.

Each round results in a randomly selected winner and a randomly selected prize from a prize bucket. The prize is an insurance fund stake, selected using the Switchboard Verifiable Random Function (VRF). Winners can trigger a protocol transfer of the stake from the sponsor when claiming their prizes.

Entry Mechanism

Participants can enter through multiple methods (including no purchase):

  1. Taker volume on markets in protocol-v2, counted via snapshots of the UserStats account. More volume leads to more entries.
  2. Sending a Solana transaction requesting an additional entry. Only one entry request instruction per transaction is allowed to maintain fairness and prevent abuse.

The sponsor can set a maximum entry limit per participant. The sponsor also has the ability to disqualify a competitor suspected of abuse (or for any reason).

It's also worth nothing that anyone can submit the transaction/request for an additional entry on behalf any active / opted-in competitor.

Prize Allocation

In every round, N winners are chosen and a prize is selected based on the sponsor's parameters. The randomness for these selections comes from the Switchboard VRF, ensuring a fair process.

Each winner's prize distribution: if N <= 3 : Each winner splits pool equally. else : [50%, 20%, 15%] for the top (first) three. 15%/(N-3) for all subsequent winners.

Carry Over Mechanism

Participants not selected to win in a particular round can carry over half of their entries to the next round, and this continues indefinitely. For example, a participant with 100 entries in round 1 would have 25 entries by round 3, if they haven't claimed more entries. Only winners who aren't in the top three prizes will be able to carry over.

Sponsorship and Prize Funding

The prize bucket for each round depends on the sponsor's stake balance. If the balance is below a certain threshold, the round may have limited or no prizes. This setup aligns the interests of the sponsor with the sweepstakes.

Winner Selection Formulation

A winner is chosen by picking a random entry from all entries. Participants with more entries have a higher chance of winning. The random number for prize/winner selection is generated in one request. After the randomness is received, all subsequent draws are programmatically derived using a non-linear method. Winners who have outstanding unclaimed winnings will not be considered for future rounds until those winnings are claimed.

Prize Buckets Formulation

The prize buckets are set as [min(1000, max_prize/10), min(5000, max_prize/2), max_prize].

The odds are calculated based on the relative size of each prize: Odds = sum(prizes)/prizes[i] in sum(prizes)

For example, if the max prize = 71,818, the odds would be:

Prize Odds
1,000 78 in 95
5,000 16 in 95
71,818 1 in 95

FAQ

Q: How is this sybil resistant?

A: The zero purchase method for entry only succeeds if it is the one and only instruction in the transaction. This limitation helps make the entry process economically Sybil-proof. The Sybil resistance comes from the expected number of tickets at the end of the round and the expected value of the prize.

Q: When does each round end?

A: The round duration is custom, specified in unix_timestamp by the Sponsor. The round expires at a pre-calculated expiry (viewable on the competition account) and, only once resolved, will determine the next round expiry (base on the duration and lateness).

Q: What if someone finds a way to abuse the entry process?

A: The sponsor has the authority to disqualify any competitor.

Contributing

Contributions are welcome! You can report bugs, suggest features, or add to the documentation. Please open an issue, pull request, or discussion, or reach out to other contributors.