nASTR Price Feeds by DIA

nASTR Price Feeds was developed by the leading Oracle of the Polkadot Ecosystem : DIA Protocol.


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.
  • nASTR total supply will be derived by calling function totalSupply on nASTR token contract

DIA Oracle Contract:

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:

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: