0

I am building a simple erc-20 token. I don't have an idea as how token price is setup. However, I need to get my token's market price inside another contract. If you see this example of token BOMB, it has market price shown on etherscan.

My question is that how this market price is established? Do I need to list it anywhere or what? Please let me know the complete flow and secondly, can I get this market price value inside my solidity contract?

Thanks a bundle

closed as too broad by Ha ĐANG, shane, Achala Dissanayake, Ismael, eth Jul 27 at 7:22

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

0

I don't have an idea as how token price is setup.

There are two prices to consider here:

  1. The price you sell the tokens for during the ICO/crowdsale;
  2. The price your token trades at on exchanges once the ICO is complete.

You can control the price in point 1; you have no control over the price in point 2.

If you see this example of token BOMB, it has market price shown on etherscan.

You can't set this value. This value is derived as an aggregate from different exchanges that are trading that token. The price on those exchanges is set by the market (i.e. supply and demand), not something hard-coded in the contract.

My question is that how this market price is established?

Supply and demand on the exchanges. If no one wants your token, no one will buy it, and it will be worthless.

Do I need to list it anywhere or what?

You need to approach exchanges and ask them to list your token.

...can I get this market price value inside my solidity contract?

You can using an oracle...

...however, I think you're probably conflating the two prices at the top of this answer - 1 and 2.

It sounds like you're about to run an ICO, in which case you want to set the ICO/crowdsale price, which means you want a separate crowdsale contract as well as your ERC-20 contract.

After the ICO is finished, and you've listed your ERC-20 token on exchanges, then the market's trading price for your token will appear on Etherscan.

  • Thanks a bundle Richard for answering me specifically. Just last thing to clear, ICO needs to be run first and then token shall be listed on exchange? or they can go side by side? – Fariha Abbasi Jul 17 at 10:56
  • The ICO is run first and if successful (e.g. if you sell the amount of tokens you were aiming to sell), then you can approach exchanges and ask them to list the token. (I don't know what they would say if you tried to do it at the same time. They would probably be less likely to be interested.) – Richard Horrocks Jul 17 at 11:00
  • Thanks, understood – Fariha Abbasi Jul 17 at 11:07
0

For the token to have value, it has to be listed in some exchanges that will provide the market price, in case you already have the token listed in any exchange, you have to contact etherscan in order to add the price to your page.

Why do you need the price of token in your contract ? The only way to get external data is to use an oracle as contracts can't interact with external sources.

  • I have not listed the token on any exchange yet, can you suggest any options to list tokens on? Secondly, I need to run ICO and sell tokens according to market price so I need to fetch the price value inside contract – Fariha Abbasi Jul 17 at 9:30
  • @FarihaAbbasi Usually it's best to set a value in ETH like 1 ETH = 100 tokens, it would be an expensive path to use oracles for your scenario. You have a better chance to get listed on ForkDelta, TokenStore and other Decentralized exchanges. – strangethingspy Jul 17 at 9:35

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