## Solution space on rewards attribution issue for collective accounts
### 1. Enhanced bookkeeping
Approach: maintain an accounting model based on [stETH shares](https://docs.lido.fi/guides/lido-tokens-integration-guide#steth-internals-share-mechanics), rather than stETH balances. This involves [tracking](https://docs.lido.fi/guides/lido-tokens-integration-guide#bookkeeping-shares) the collective account balance in shares, allowing participants to join and leave with precise share amounts, ensuring accurate reward distribution.
Token shares are implemented on the token contract's level, see the [shares-related methods](https://docs.lido.fi/contracts/lido#shares-related-methods).
Note: [Lido Ethereum SDK](https://github.com/lidofinance/lido-ethereum-sdk) provides all necessary interfaces and methods for shares and rewards estimation, see the examples provided.
### 2. Rebases and rewards history
> :information_source: Due to possibility of rounding errors during shares->stETH conversion, events-based approach described below is intended for display purposes mostly, bookkeeping should be based on the stETH token shares. See also [[1]](https://docs.lido.fi/guides/lido-tokens-integration-guide/#1-2-wei-corner-case), [[2]](https://github.com/lidofinance/lido-dao/issues/442).
Reward distribution happens upon the [token rebase](https://docs.lido.fi/contracts/lido#rebase), thus to retrieve and display historical data (APR projections, past rebase events, accrued rewards concerning a period), the [contracts' logs](https://github.com/lidofinance/lido-dao/blob/master/contracts/0.4.24/Lido.sol#L231-L240) data available off-chain should be used.
The [Lido Ethereum SDK](https://github.com/lidofinance/lido-ethereum-sdk) has the full set of features in this regard:
- estimating APR for the latest token rebase.
- calculating average APR over a selected period.
- last rebase event (contains share rate)
- first rebase event starting from the reference point in the past
- get last N rebase events
- get all rebase events for the last N days
- assessing specific rewards accrued over a [chosen period by an address](https://stake.lido.fi/rewards)