First you have to understand what the price of something is. The real price of something is how much people are willing to pay for it. If the seller is willing to sell at the price the buyer is willing to buy then a sale happens – the sale also defines the price of the item.
For example, McDonalds have the right to sell the BigMac at any price. They are free to sell BigMacs for $5000 each. However, if they do that then nobody would buy their burger. Therefore, while McDonalds can put any price on their product, the real price is the one which people are willing to pay. In economics-speak it is where the supply meets demand.
So the real price of a cryptocurrency is the the last price someone bought/sold that cryptocurrency. The easiest place to track this is at exchanges.
How exchanges set the price
Exchanges of all types (crypto, gold, oil, stock, forex etc.) don’t actually set the price. Instead they infer the price from the last successful transaction. There are generally two types of transactions that exchanges deal with:
-
Immediate/Quick buy/sell – this is where you buy/sell (or at least try to) your item (stock, bitcoin, gold etc.) at the market price. The exchange will use the information of past sales to set the market price.
-
Orders – this is where you tell the exchange that you want to buy/sell the item at a specific price. Orders are recorded in a database called the order book. The Exchange will scan through all orders and try to match the sell orders to appropriate buy orders so that buyers willing to sell at a specific price can be matched to sellers willing to sell at a specific price.
Obviously sellers want to make profit and tend to set the price higher. Those who cannot find buyers willing to buy their expensive items will just wait forever in the order book (or cancel their order at some future time). Buyers on the other hand tend to set the price lower. Where the buyer price meets the seller price is the market price. With enough people in the market there will always be sellers who are more inclined to get the money now than wait for the price to go up.
Therefore, each exchange generally have their own “market price”. Price aggregator websites like cryptocompare scan exchanges and average the overall prices.
Some exchanges have APIs allowing you access to their market data. Coinbase for example have such an API: https://docs.cloud.coinbase.com/exchange/docs. Other exchanges don’t provide APIs so aggregators will need to screen scrape the data from their websites.
Note that purchase/sales of cryptocurrencies does not only happen in exchanges. There are quite a few WhatsApp and Telegram groups where you can advertise your cryptocurrency for cash. So there is quite an active and sizable “black market” of crypto sales that are not tracked by exchanges.
2
solved How do websites like cryptocompare.com, coinmarketcap.com or livecoinwatch.com track the prices of cryptocurrencies? What are their sources? [closed]