# Affiliate Fund

## Overview

The AffiliateFund smart contract manages the affiliate fund within the application. It facilitates the distribution of bonuses to affiliates based on their activities and conditions set by the affiliate program.

## Role-based Access Control

The contract implements role-based access control with two roles: `TIMELOCK` and `SERVICE`. These roles control access to functions responsible for setting affiliate contracts and managing bonuses.

## Constants

* `DIRECT_STAKING_BONUS`: Percentage of direct staking bonus.
* `DIRECT_BETTING_BONUS`: Percentage of direct betting bonus.
* `MAX_CLAIM_DAILY`: Maximum amount that can be claimed daily.
* `MAX_CLAIM_DAILY_PERCENT`: Maximum percentage of staked amount that can be claimed daily.

## Events

* `MatchingBonusClaimed`: Triggered when a matching bonus is claimed.
* `DirectBonusClaimed`: Triggered when a direct bonus is claimed.
* `NewAffiliate`: Triggered when a new affiliate contract is set.
* `NewMaxClaimDaily`: Triggered when the maximum claim daily value is updated.

The Affiliate Fund smart contract manages an affiliate fund within the application. It:

* Handles the distribution of bonuses to affiliates based on their activities and conditions set by the affiliate program.
* Allows affiliates to claim matching bonuses and direct bonuses.
* Tracks daily claimed bonuses for affiliates to ensure adherence to daily limits.
* Enables the setting of the affiliate contract address and maximum daily claim value.


---

# 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.celestium.digital/smartcontracts-description/affiliate-contract/affiliate-fund.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.
