1

I am new to blockchain currently learning and exploring. I followed Patrick's tutorial and now in order to have hands-on I want to implement a FundMe smart contract but for my national currency instead of USD. I am not sure if the way I am approaching this problem is correct. The reason I am thinking this way is that I want to display amount on frontend in my currency instead of USD. I tried finding address for my desired data feed on chainlink, but did not find anything. Any help would be highly appreciated. Thanks.

1
  • This might or might be topical for you, but I just published few Chainlink tutorials here, including how to get price feeds. However if there is no existing Chainlink price feed, then you need to fetch the price data using Chainlink HTTPS oracle - a bit expensive depending on the chain. Jan 24 at 9:26

1 Answer 1

1

Chainlink data feed not only provides price of multiple asset values in units of USD(like BTC/USD, ETH/USD) but also provides the price of multiple fiats in units of USD.

If you want to implement "fundme" in the currency of your nation, the priceConverter could use this calculation to convert ETH to the currency you want to use:

ETH value in unit of your currency = (amount of ETH) * (ETH price in USD) / (your nation's currency price in USD)

Please head to the data feed address list to find 2 necessary addresses for ETH/USD and (your national currency)/USD.

Please be noticed in sepolia there is no such data feed provided, but you can find them in mainnet.

4
  • Thanks for response. I tried but could not find my nation's currency in that list. There are very limited currencies feeds
    – doc
    Jan 25 at 16:39
  • @doc what is your nation?
    – Frank Kong
    Jan 26 at 14:21
  • I am from Pakistan, so basically Im looking for PKR conversion.
    – doc
    Jan 26 at 16:46
  • I checked data feed for Fiat, and PKR is not there. There are only 8 feeds that are listed here docs.chain.link/data-feeds/price-feeds/… .
    – Frank Kong
    Jan 29 at 3:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.