# Casino Affiliate

## Become an Overtime Casino Affiliate

Every casino contract on Overtime has affiliate revenue baked into the bet flow. You can earn **up to 20% of generated fees** from any user you refer, paid programmatically, by the contract, in the same transaction as the user's losing bet.

There is no application form, no monthly statement, no minimum payout threshold, no "review" step where the operator decides how much you earned. The smart contract is the affiliate manager.

***

### How it works

Every game contract (Roulette, Dice, Blackjack, Baccarat, Slots) has an `IReferrals` integration baked in. When a user places a bet, they can pass a `_referrer` address as a parameter:

```solidity
function placeBet(
    address collateral,
    uint amount,
    BetType betType,
    uint8 selection,
    address _referrer    // ← your affiliate wallet
) external;
```

The first time a user bets with your address as the referrer, the Overtime referrals registry **registers the relationship permanently for that user**. From that point on, every losing bet that user makes — across **every** Overtime Casino game, automatically pays out your share, in the same collateral and transaction.

When a user wins, the contract pays the user. When a user loses, the contract pays your referral share to your wallet, then keeps the rest as bankroll.

The relevant contract code:

```solidity
function _payReferrer(address _user, address _collateral, uint _amount) internal {
    if (address(referrals) == address(0)) return;
    address referrer = referrals.referrals(_user);
    if (referrer == address(0)) return;
    uint referrerFee = referrals.getReferrerFee(referrer);
    if (referrerFee == 0) return;
    uint referrerAmount = (_amount * referrerFee) / ONE;
    if (referrerAmount > 0) {
        // transfer the cut, emit event
    }
}
```

Every successful affiliate payout emits a `ReferrerPaid(referrer, user, amount, betAmount, collateral)` event. You can index it. You can verify every cent.

***

### How to set up

#### 1. Get a wallet to receive payouts

Use any EVM wallet that supports Base, Optimism and Arbitrum (the chains the Casino contracts are deployed on). This is the address Overtime will pay your share to.

#### 2. Generate a referral link

The Overtime frontend supports referral links of the form:

```
https://overtimemarkets.xyz/casino?referrer=0xYOUR_AFFILIATE_ADDRESS
```

Anyone who connects their wallet via your link will be tagged with your address as their referrer when they place their first bet. Once tagged, the relationship persists.

#### 3. Distribute your link

Share it however you reach your audience, Twitter, Discord, Telegram, your blog, an embedded widget, your own custom frontend. Wherever you can drive bettors, plug your referrer address into the `placeBet` calls and earn.

#### 4. (Optional) Embed the contracts in your own product

This is where it gets interesting. **You don't have to use the Overtime frontend to capture the referral revenue.** If you build your own UI, your own bot, your own AI agent that wraps the Overtime contracts, and you pass your referrer address into every bet your product makes on behalf of users, every trade your users take pays you, programmatically, forever.

See Integrate Overtime Casino for the developer guide.

***

### How much you earn

The default referral fee is **up to 20%** of generated fees, configured in the Overtime referrals registry. The exact percentage applied to your address is read at the moment of each bet via `referrals.getReferrerFee(referrer)`.

If a user you referred loses a 100 USDC bet, your share (at 20%) is paid to your wallet in USDC, in the same transaction, with `ReferrerPaid` emitted. No batching. No claim step. No delay.

***

### Why this is structurally different from a traditional affiliate program

Traditional online casino affiliate programs run on the operator's good-faith. Some examples of what those programs *can* do, and have done, that Overtime structurally cannot:

* **Retroactive review.** A trad affiliate program can decide your earnings were "fraud-tagged" months later and claw them back.
* **Negative carryover.** Some affiliate programs roll your account into negative balance when your referred users win big, locking you out of future earnings until the deficit clears.
* **Unilateral fee changes.** A trad operator can drop your % from 30 to 5 with notice, or sometimes without.
* **Frozen accounts.** A trad operator can suspend your account during payout review, indefinitely.
* **Geo-restrictions on your referrals.** Some programs disallow specific markets after the fact, voiding earnings.

The Overtime contracts don't have most of these levers. The referrer fee paid on each bet is calculated and transferred inside the bet's resolution transaction. There's no centralized statement to review. There's no operator approving payouts. The contract pays, the event emits, and it's settled.

The fee percentage *is* a parameter the Overtime referrals registry can change for new bets going forward. But it cannot be changed retroactively — past `ReferrerPaid` events stand permanently.

***

### Best practices

* **Use one consistent referrer address across your distribution channels** so all your traffic accrues to the same wallet.
* **Index `ReferrerPaid` events** to build your own dashboard. The Overtime subgraph indexes them, but you can also self-host an indexer over the Casino contracts if you want full control.
* **Be transparent with your audience.** Onchain settlement means anyone can verify your address received payouts. That's a feature, turn it into a credibility signal.
* **Don't promise outcomes you can't deliver.** Never represent gambling as risk-free. Make sure your audience understands the games involve financial risk.
* **Comply with your local laws.** Promoting gambling content has different rules in different jurisdictions. The contracts don't enforce that for you.

***

### Frequently asked

**Do I need to apply or be approved?** No. Pass any address as the `_referrer` parameter on a bet, and the Overtime referrals registry will tag the user. Your payouts begin from that user's next losing bet.

**Can my % be changed without my consent?** The fee is configured in the central referrals registry and can be updated for new bets going forward. Past payouts are permanent.

**What if my referred user only ever wins?** Then you don't earn anything from them — the referrer fee is paid on losing bets. (You also don't lose anything: there's no negative carryover.)

**Can I refer myself?** Technically the contract does not prevent you from passing your own address as `_referrer` on a bet from another wallet you control. Whether that's allowed by the protocol's terms of service or by your local law is your responsibility — the contracts don't police it.

**Is there a payout minimum?** No. Every losing bet that triggers a non-zero referral fee is settled immediately, in the same transaction, in the bet's collateral.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overtime.io/overtime-casino/casino-affiliate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
