How to get latest eth price in solidity smart contract #20
Replies: 2 comments
-
|
Hi @stevendev0822 To get latest eth price, you need to use Uniswap v2 router or chainlink oracle contract. Hope you finds it helpful. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @stevendev0822 Recently I have found very useful api for getting native token price in usd, - gmgm.ai api.
For example if you wanna get eth price, you can call The response is as following: Here you can get "native_token_usd_price" This also would be good and fast enough. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @Mates
Recently I am working on the development of ICO presale website and writing smart contract for that.
I need to implement "Buy token with ETH", then I need to calculate eth price in smart contract.
Please let me know if you have any experience with that.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions