in

[Question] Calculating True Price of A Smart Contract

I am new to programming smart contracts in solidity, My goal is just to learn how a mobile app interacts with the block chain. I am currently building my own smart contract and ERC-20 Token as a project to better understand blockchain and specifically the Ethereum blockchain. I have been following the courses Dapp University has to offer.

​

And my question is in solidity how do I calculate a proper dynamic exchange rate. In the course it is a static rate 1 ETH = 100 Dapp but I know in the real world that is not how that works since the USD value of every Cryptocurrency is always changing and thus the exchange rate even from 1 Token to another Token has to change all the time aswell. So how is this calculated and deployed?

​

Edit: spelling errors

What do you think?

10 Points
Upvote Downvote

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

3 Comments

  1. The price of a token A in terms of token B on, for example, Uniswap is determined by the ratio of token A to B in its liquidity pool. You can use the functions in the Uniswap smart contract to get the price.

VoltBit – $VBIT | Charity Token Audited | Fully Doxed Team | Low market Cap | Documented Charity partnership with5k Donated! | Locked Liquidity | Listed on CMC and CG!

PowerDoge ๐Ÿš€ the most powerful Doge! Don’t miss out on this x100 gem JUST LAUNCHED ๐Ÿš€