# nASTR Price Feeds by DIA

nASTR Price Feeds was developed by the leading Oracle of the Polkadot Ecosystem : [DIA Protocol](https://www.diadata.org/).

### **Methodology:**

nASTR price using collateral feed will be derived as follows:

* nASTR price = ASTR price \* (ASTR in staking contracts/ nASTR total supply)
* ASTR in staking contracts will be derived by calling function `getAstrInStakingContractFromAddress()` on [Astar DappsStaking contract](https://blockscout.com/astar/address/0x0000000000000000000000000000000000005001).
* nASTR total supply will be derived by calling function `totalSupply` on [nASTR token contract](https://blockscout.com/astar/address/0xE511ED88575C57767BAfb72BfD10775413E3F2b0/read-proxy#address-tabs)

### **DIA Oracle Contract:**

{% embed url="<https://blockscout.com/astar/address/0x88463254469c37b9cECb71A34746707e008fb5A9>" %}

To get the market price of ASTR/USD or nASTR/USD, query `getValue()` with argument “ASTR/USD” or “nASTR/USD”. \
Return values are the price (with 8 decimals, so divide by 10^8 to get the actual price) and unix timestamp of last update. Prices will update as soon as 1% change is detected.

### Algem adapter Contract:

{% embed url="<https://blockscout.com/astar/address/0x8e066de9a3B0ac5965e4361fDE2752c11509f4F2>" %}

The contract connects the ASTR/USD price to onchain collateral information.

Call `getNAstrPriceFromCollateralRatio()` to get the latest price from the collateral ratio and `getAstrInAllStakingContracts()` to retrieve the number of staked ASTR in all registered contracts.

More details can be found on DIA's forum:

{% embed url="<https://forum.diadata.org/t/cdr-033-algem-price-feeds/543>" %}


---

# 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.algem.io/bahasa-indonesia/perkembangan/nastr-price-feeds-by-dia.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.
