# Resource Calculation Methodology

## 1. Specific Calculation Relations for the Districts

| **Element**            | **Nature**                                                                                                                                                                                                                    | **Calculation Method**                                                                                                                                                                                                                                                                                         | **Data Source**                                                                                                                                                                                                      |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Base Capacity          | The default resource generation capacity of a District.                                                                                                                                                                       | Predetermined at the map setup.                                                                                                                                                                                                                                                                                | Default map details in IPFS during district mint. Meta data is updated post-mint on District level.                                                                                                                  |
| Colony Bonus Capacity  | Dynamic enhanced capacity of a District based on adjacency                                                                                                                                                                    | Given to a district when claimed next to an already-owned district by the same user. Bonuses are effective backwards from genesis, just like the Base Capacity.                                                                                                                                                | Triggered automatically by the backend at the time of a new district claim based on on-chain data.                                                                                                                   |
| Upgrade Bonus Capacity | Optional based on resource burn for District upgrade                                                                                                                                                                          | Upgrade can be initiated by the users in exchange for resource burn. An upgrade increases the capacity of one specific resource. Bonuses are effective from on-chain initiation of upgrade.                                                                                                                    | Upgrade parameters are stored Onchain for each type of upgrade. Meta data update initiated by backend following the upgrade transaction initiated by the user, based on upgrade capacity bonus of the given upgrade. |
| Cosmic Yield           | Cosmic yield represents the reward for building the interstellar infrastructure. Builders and maintaniers of the Infra receive a percentage of resources generated on territories unlocked by the Interstellar infrastructure | Each Infra element has a Global Yield, which a percentage of the resource generated during the certain time period. The Global Yield is then divided based on the Cosmic Yield ratio of each part of the given Infra element. One District unlocked by new the Infra can have multiple related infra elements. | Global Yield: Stored onchain for each Infra element. Cosmic yield: stored in IPFS at infra element launch, transformed to metadata when the infra element has been built.                                            |

#### 2. General Rules of Resource Calculation

* Initiation: Resource calculations are initiated on-chain by users.
* Calculation: Performed at the district level. When initiated by a user, the backend investigates the owned districts at the time of the resource claim event. For each district, resources are calculated based on Base Capacity, Colony Bonus, and Upgrade Bonus.
* Cosmic yield is allocated based on the calculated resource and allocated according to onchain data.
* Halving: Resource capacity depletes over time as extraction becomes less efficient. Halving ratio divides the amount to mint during a claim.
* Federation Reserve Allocation: A percentage of each resource calculation is allocated to the Federation Reserve for purposes of incentives, liquidity, and ecosystem development. The ratio is stored onchain.


---

# 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://fdrtn.gitbook.io/the-core-network/behind-the-scenes/resource-calculation-methodology.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.
