> For the complete documentation index, see [llms.txt](https://shibatoken.gitbook.io/shiba-swap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shibatoken.gitbook.io/shiba-swap/architecture/how-does-shibaswap-work/staking-bury/calculating-staking-returns-to-woof.md).

# Calculating Staking returns to Woof

When Staking any Main Token (`SHIB/LEASH/BONE`)

* `SHIB/LEASH/BONE` from the users wallet is withdrawn and added to `xSHIB` Contract
* `xSHIB/xLEASH/tBONE` Tokens are minted and returned to the user
* Thus `xSHIB/xLEASH/tBONE` Contracts Hold all of the `SHIB/LEASH/BONE` staked

## How to calculate a users Main Token (SHIB/LEASH/BONE) share of staking rewards at any point

### Contracts involved

| Shiba Inu Ecosystem Main Token Name | Shiba Inu Ecosystem Main Token Symbol | <p>Shiba Inu Ecosystem </p><p>Main Token </p><p>Contract Address</p>                                                      | Staked Token Symbol | Staked Token Contract Address                                                                                             |
| ----------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **Shiba Inu**                       | **SHIB**                              | [**0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce**](https://etherscan.io/token/0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce)   | **xSHIB**           | [**0xb4a81261b16b92af0b9f7c4a83f1e885132d81e4**](https://etherscan.io/address/0xb4a81261b16b92af0b9f7c4a83f1e885132d81e4) |
| **Leash**                           | **LEASH**                             | [**0x27C70Cd1946795B66be9d954418546998b546634**](https://etherscan.io/token/0x27C70Cd1946795B66be9d954418546998b546634)   | **xLEASH**          | [**0xa57d319b3cf3ad0e4d19770f71e63cf847263a0b**](https://etherscan.io/address/0xa57d319b3cf3ad0e4d19770f71e63cf847263a0b) |
| **Bone**                            | **BONE**                              | [**0x9813037ee2218799597d83D4a5B6F3b6778218d9**](https://etherscan.io/address/0x9813037ee2218799597d83d4a5b6f3b6778218d9) | **tBONE**           | [**0xf7A0383750feF5AbaCe57cc4C9ff98e3790202b3**](https://etherscan.io/address/0xf7a0383750fef5abace57cc4c9ff98e3790202b3) |

To calculate a users share of **SHIB** (as an example) rewards at any point we use the following formula

$$
(usersShareOfStakingTokens \* totalMainTokenLockedInByStakingContract ) / StakingToken
TotalSupply
$$

1. We need to find out how much xSHIB the  wallet holds&#x20;
   1. This can be done by

      1. Simply looking at the xSHIB tokens in the wallet or&#x20;
      2. By Navigating to [**this**](https://etherscan.io/address/0xb4a81261b16b92af0b9f7c4a83f1e885132d81e4#readContract) url&#x20;
      3. You should see 7 numbered rows&#x20;
      4. Choose the second one `2. balanceOf`&#x20;
      5. This expects an address , which as you guessed is the wallet address&#x20;
      6. Enter that address and hit Query
      7. This should return the xSHIB held by the wallet&#x20;

2. Now we need to find out the total SHIB locked in&#x20;
   1. We need to do this because , when we stake SHIB,&#x20;
   2. the xSHIB contract hold the SHIB and then mints and returns xSHIB&#x20;
   3. To do this we need to the SHIB contract&#x20;

      1. Navigate to [**this**](https://etherscan.io/address/0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce#readContract) url&#x20;
      2. You should see 6 numbered rows&#x20;
      3. Choose number `4.balanceOf`&#x20;
      4. This expects an address, but unlike the last time, this isn't a wallet address but the address of the xSHIB contracts itself, which is  `0xB4a81261b16b92af0B9F7C4a83f1E885132D81e4`&#x20;
      5. Enter that in the box&#x20;
      6. This should return the total SHIB held by the address&#x20;

3. &#x20;Lastly, we need the total supply of xSHIB

4. &#x20;We can obtain this from the xSHIB contract
   1. &#x20;Navigate to [**this**](https://etherscan.io/address/0xb4a81261b16b92af0b9f7c4a83f1e885132d81e4#readContract) url
   2. You should see 7 numbered rows&#x20;
   3. Choose the 7th one `7.totalSupply`&#x20;
   4. This should return the total xSHIB held by the address&#x20;

5. Now let us use the formula&#x20;

6. `Step 1` gives us xSHIB in users wallet - lets call it - `usersShare`&#x20;

7. `Step 2` gives us total SHIB Locked in by xSHIB , lets call it - `totalShibLocked`&#x20;

8. `Step 3` gives us total xSHIB in existence , lets call it total `xShibTotalSupply`

9. So Total SHIB would be
   1. &#x20;$$(usersShare \* totalShibLocked ) / xShibTotalSupply$$&#x20;

10. &#x20;As you may be aware, the number of decimals by default is 18, So divide the number you obtain in `step 4` by 10^18 (1 and 18 zeroes)&#x20;

11. That should give you the SHIB available to be woofed at any point.

## How to calculate a users BONE token share of staking rewards at any point?

Bone Token shares are calculated offline and distributed via Special Merkel Distributors
