> For the complete documentation index, see [llms.txt](https://csrfi.gitbook.io/csrfi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://csrfi.gitbook.io/csrfi/usdcsrcanto-mechanics/calculation-of-csr-revenues-to-holders.md).

# Calculation of CSR revenues to holders

The amount of revenue each $csrCANTO holder can claim is determined by the following factors:

* how much csrCANTO they hold relative to other whitelisted holders at each block
* how much CSR was generated

On a high level, rewards for users are calculated using the following logic:

$$\sum (X\_n \* R\_n )$$

Where:

$$X =$$percentage of user ownership of csrCANTO supply (as a fraction) at block $$n$$

$$R =$$total revenue generated from CSR at block $$n$$

$$n =$$block number

When a user claims CSR, all the revenue they are eligible for since their last claim is distributed to them. Therefore, you can claim your revenue at any time - it will not affect the amount you receive. All logic is on-chain in the smart contract; there are no off-chain calculations used in this logic.

For a more technical and accurate description of the reward calculation logic, please refer to the following description:

* After some CSR has accumulated from token contract use, anyone can call `withdrawFromTurnstile` to effectively distribute the CSR to all csrCANTO holders.
* A global accumulator is incremented whenever CSR is withdrawn from the Turnstile. Every account maintains a 'claimed' accumulator value to track how many rewards they are entitled to claim as the global value increases.&#x20;
* Accounts can call `getReward` after CSR has been pulled from the Turnstile contract.
* Therefore, the incoming funds pulled from the Turnstile contract can be distributed efficiently among large numbers of token holders.
