<p>Exchanges don't calculate prices, they report them. They aggregate people who want to sell and people who want to buy and report the prices they are willing to buy and sell for. When one person is willing to sell at a price that another person is willing to buy, they facilitate that exchange and report the price.</p>
<p>Say you look at what's going on at a particular exchange with a particular asset. There cannot exist a person who is willing to buy that asset at a price another person is willing to sell it for. Why? Because if that were the case, they would have <em>already</em> transacted.</p>
<p>So there must be a highest price anyone is willing to buy the asset for and a lowest price anyone is wiling to sell the asset for. And the highest buy price <em>must</em> be lower than the highest sell price.</p>
<p>So may there are people willing to buy ABC for $100 or less and people willing to sell ABC for $101 or more. At this exchange, you can now buy ABC for $101 or sell ABC for $100.</p>
<p>This can happen for some time, with people buying ABC at $101 and selling ABC at $100. The trades take place at different prices (buys at $101, sells at $100) but the price isn't actually changing. (This is why even though every transaction is both a buy and a sell since someone is selling and someone is buying, a &quot;buy&quot; is still a logically different transaction from a &quot;sell&quot; at an exchange.)</p>
<p>If someone buys <em>all</em> the ABC that people are willing to sell for $100, then anyone who wants to buy ABC will have to pay <em>more</em> than $100 for it. That's how prices go up.</p>
<p>Similarly, if sells exhaust all the willing buyers at $100 by selling more ABC than that, the next sales will have to go to buyers willing to pay less than $100. That's how prices go down.</p>

CC BY-SA 4.0
2022-09-16T21:02:21.857Z
Well put, thank you (+1). A couple of clarifications before I accept the answer: 1/ Does that mean that when Binance or other exchanges force le to buy a certain amount of coins for the inputted value of exchanged currency, it's really a snapshot at a given time of the lowest price I can buy this amount of coins in the exchange at this time? 2/ Can you confirm this means the buy and sell prices shown on exchanges can be very different and only depend on respectively the sellers' and buyers' offers in the exchange? 3/ What's the point of liquidity in the exchange's pool then?
Mister Mystère
CC BY-SA 4.0
2022-09-16T21:20:18.397Z
1. Yes. If you buy more than is available at the stated price, you will pay more. 2. Yes, but in practice they will be very close in efficient markets. 3. Those people willing to buy and sell *are* liquidity in the exchange's pool. They're what lets you go to the exchange and buy and sell because there are people already willing to sell and buy.
David Schwartz
CC BY-SA 4.0
2022-09-16T21:43:35.873Z
Excellent, thanks. I had it all wrong. I accepted the answer, thanks. As a bonus: when you create a new coin, does that mean that you basically first give some for free to the exchange itself, and buy it back for a price which is automatically accepted by the exchange in order to set the initial price reported?
Mister Mystère
CC BY-SA 4.0
2022-09-16T22:19:49.400Z
Update: again, I was wrong. Looks like when adding liquidity, we're actually staking a pair, so both the token and its exchange currency - the ratio sets the price of the token. I wonder if the exchange automatically accepts a buy request up to the number staked at the reported price? I assume that if we can, as soon as we siphon the exchange, the price will go up if someone else wants to buy and offers a buy request for a higher price.
Mister Mystère
CC BY-SA 4.0
2022-09-17T05:55:28.943Z
@MisterMystère Exchanges don't own tokens, they just bring buyers and sellers together and hold tokens owner by others to facilitate staking and trading. When a token changes hands between someone who wants to buy it and someone who wants to sell it, exchanges report the transaction, including the price. Someone placing a buy request for a higher price will not change the price unless nobody was willing to sell at less than that price.
David Schwartz
CC BY-SA 4.0
2022-09-17T05:58:05.620Z
@MisterMystère Say I want to buy one bitcoin and I'm willing to pay up to $40,000 if I have to. That won't change the price of bitcoin to $40,000 since there are still plenty of people willing to sell for less than that and I won't have to pay $40,000. The price of bitcoin only goes up to $40,000 if nobody is willing to sell for less than that.
David Schwartz
CC BY-SA 4.0
2022-09-16T19:39:11.293Z
2022-09-16T19:44:38.853Z
2022-09-16T19:44:38.853Z
David Schwartz
<p>I find the mechanisms behind crypto fascinating, so I wanted to do the thought exercise of creating my own coin, and seeing how it evolves in a simplistic spreadsheet-based example such as this one:
<a href="https://i.sstatic.net/1H3yY.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1H3yY.jpg" alt="enter image description here" /></a></p>
<p>The idea is that each month, in turn, each person (that would be me, here, every time) decides whether to buy, or sell, &quot;Crypto&quot; coins, and how any of them. Each person is different in the amount they already own (the creator of the coin) or the amount of money they have at their disposal.</p>
<p>I know that when creating a coin, the creator determines: a) how many coins it mints, b) how many coins the creator keeps, c) how many coins are injected as liquidity in the exchange, and d) for how much money when adding in the liquidity to set the initial price. The table is here populated with arbitrary data. I'm assuming here that this coin has a fixed supply and no more can be minted, to simplify things.</p>
<p>... Happy as a clam, I tried to run &quot;month 2&quot; - then I realised, that someone who believes in this coin would buy a lot of it because it's cheap, effectively all that's available as a liquidity seeing how cheap it is. What now? If nobody sells, does the exchange automatically increase the price until holders are incentivised to sell? Second, if for some obscure reason here I would not buy all the liquidity, would the price increase because someone bought it? By how much?</p>
<p><strong>This made me realise that I have absolutely no clue about how exchanges calculate the price of a coin in their system. Is it always the same formula (and just the liquidity + members change) or does each exchange have their own algorithm? How could I simulate an exchange here?</strong></p>
<p>This would help me tremendously if someone could actually try to &quot;play&quot; this example in their answer to illustrate. I'm sure this will be of interest to many as well, because I found this question around quite a lot in my research, but never has <em>how</em> been answered.</p>

CC BY-SA 4.0
2022-09-16T04:30:25.447Z
This is a question on how markets price assets, and not really about bitcoin. Just imagine if you are in a room with 100 people and you wanted to sell some bitcoin, you could "ask" for $1 million per coin, but out of the other 99 people none of them want to pay $1 million per coin, so they put in their "bid". Eventually someone will offer to sell at a price that a buyer agrees to and you have the asset price. Some markets with low volume have very wide bid/ask spreads because there aren't enough people to provide a fair price, so many times larger exchanges have the "fairest" price.
m1xolyd1an
CC BY-SA 4.0
2022-09-16T04:37:45.060Z
Thanks, this is insightful. First, is there a stackexchange which is better suited to this question? I thought this was it because it applies to bitcoin as well (just replace coin with bitcoin in my text). Second, in my very limited experience of using exchanges (Binance), I don't really have a say in the ask/bid, the price is given to me. Assuming even I can set my own ask/bid prices, how is this price tag calculated?
Mister Mystère
CC BY-SA 4.0
2022-09-16T05:58:51.913Z
Also, unless I'm mistaken, I still can't compute what would happen in the "what now?" case explained above. Would you care to give a possible solution?
Mister Mystère
CC BY-SA 4.0
2022-09-16T08:54:24.450Z
Does this answer your question? [How does an exchange calculate the price of a coin?](https://bitcoin.stackexchange.com/questions/70206/how-does-an-exchange-calculate-the-price-of-a-coin) ... Also see https://bitcoin.stackexchange.com/search?q=exchange+prices+calculate
RedGrittyBrick
CC BY-SA 4.0
2022-09-16T12:18:04.040Z
@RedGrittyBrick partly yes, thanks - sorry, I had looked up previous posts and for some reason did not see this exact match (shame on me). I still don't know exactly how liquidity intervenes in there though: if it's only a bid/ask match, what's the point of liquidity in the exchange which is supposed to smooth out price variations?
Mister Mystère
CC BY-SA 4.0
2022-09-16T20:51:59.470Z
I'd say the effect of liquidity is indirect, just as general market mood has indirect effects. Neither of them are used directly or explicitly to set a market price but both of them affect prices in one way or another. You can measure actual prices paid without needing to measure liquidity or mood.
RedGrittyBrick
<exchanges><currencies><exchange-rate><value>
How are crypto prices calculated by an exchange? Example game in a spreadsheet to illustrate
Mister Mystère
# How are crypto prices calculated by an exchange? Example game in a spreadsheet to illustrate

(Asked by: username_0 on 2022-09-16)

I find the mechanisms behind crypto fascinating, so I wanted to do the thought exercise of creating my own coin, and seeing how it evolves in a simplistic spreadsheet-based example such as this one:
[![enter image description here](https://i.sstatic.net/1H3yY.jpg)](https://i.sstatic.net/1H3yY.jpg)

The idea is that each month, in turn, each person (that would be me, here, every time) decides whether to buy, or sell, "Crypto" coins, and how any of them. Each person is different in the amount they already own (the creator of the coin) or the amount of money they have at their disposal.

I know that when creating a coin, the creator determines: a) how many coins it mints, b) how many coins the creator keeps, c) how many coins are injected as liquidity in the exchange, and d) for how much money when adding in the liquidity to set the initial price. The table is here populated with arbitrary data. I'm assuming here that this coin has a fixed supply and no more can be minted, to simplify things.

... Happy as a clam, I tried to run "month 2" - then I realised, that someone who believes in this coin would buy a lot of it because it's cheap, effectively all that's available as a liquidity seeing how cheap it is. What now? If nobody sells, does the exchange automatically increase the price until holders are incentivised to sell? Second, if for some obscure reason here I would not buy all the liquidity, would the price increase because someone bought it? By how much?

**This made me realise that I have absolutely no clue about how exchanges calculate the price of a coin in their system. Is it always the same formula (and just the liquidity + members change) or does each exchange have their own algorithm? How could I simulate an exchange here?**

This would help me tremendously if someone could actually try to "play" this example in their answer to illustrate. I'm sure this will be of interest to many as well, because I found this question around quite a lot in my research, but never has *how* been answered.

**Tags:** exchanges, currencies, exchange-rate, value

> **Comments:**
> **username_1**: This is a question on how markets price assets, and not really about bitcoin. Just imagine if you are in a room with 100 people and you wanted to sell some bitcoin, you could "ask" for $1 million per coin, but out of the other 99 people none of them want to pay $1 million per coin, so they put in their "bid". Eventually someone will offer to sell at a price that a buyer agrees to and you have the asset price. Some markets with low volume have very wide bid/ask spreads because there aren't enough people to provide a fair price, so many times larger exchanges have the "fairest" price.  
> **username_0**: Thanks, this is insightful. First, is there a stackexchange which is better suited to this question? I thought this was it because it applies to bitcoin as well (just replace coin with bitcoin in my text). Second, in my very limited experience of using exchanges (Binance), I don't really have a say in the ask/bid, the price is given to me. Assuming even I can set my own ask/bid prices, how is this price tag calculated?  
> **username_0**: Also, unless I'm mistaken, I still can't compute what would happen in the "what now?" case explained above. Would you care to give a possible solution?  
> **username_2**: Does this answer your question? [How does an exchange calculate the price of a coin?](https://bitcoin.stackexchange.com/questions/70206/how-does-an-exchange-calculate-the-price-of-a-coin) ... Also see https://bitcoin.stackexchange.com/search?q=exchange+prices+calculate  
> **username_0**: @username_2 partly yes, thanks - sorry, I had looked up previous posts and for some reason did not see this exact match (shame on me). I still don't know exactly how liquidity intervenes in there though: if it's only a bid/ask match, what's the point of liquidity in the exchange which is supposed to smooth out price variations?  
> **username_2**: I'd say the effect of liquidity is indirect, just as general market mood has indirect effects. Neither of them are used directly or explicitly to set a market price but both of them affect prices in one way or another. You can measure actual prices paid without needing to measure liquidity or mood.  

---

## 1 answers

### Answer by username_3 on 2022-09-16. Score: 3 | Accepted answer

Exchanges don't calculate prices, they report them. They aggregate people who want to sell and people who want to buy and report the prices they are willing to buy and sell for. When one person is willing to sell at a price that another person is willing to buy, they facilitate that exchange and report the price.

Say you look at what's going on at a particular exchange with a particular asset. There cannot exist a person who is willing to buy that asset at a price another person is willing to sell it for. Why? Because if that were the case, they would have *already* transacted.

So there must be a highest price anyone is willing to buy the asset for and a lowest price anyone is wiling to sell the asset for. And the highest buy price *must* be lower than the highest sell price.

So may there are people willing to buy ABC for $100 or less and people willing to sell ABC for $101 or more. At this exchange, you can now buy ABC for $101 or sell ABC for $100.

This can happen for some time, with people buying ABC at $101 and selling ABC at $100. The trades take place at different prices (buys at $101, sells at $100) but the price isn't actually changing. (This is why even though every transaction is both a buy and a sell since someone is selling and someone is buying, a "buy" is still a logically different transaction from a "sell" at an exchange.)

If someone buys *all* the ABC that people are willing to sell for $100, then anyone who wants to buy ABC will have to pay *more* than $100 for it. That's how prices go up.

Similarly, if sells exhaust all the willing buyers at $100 by selling more ABC than that, the next sales will have to go to buyers willing to pay less than $100. That's how prices go down.

> **Comments:**
> **username_0**: Well put, thank you (+1). A couple of clarifications before I accept the answer: 1/ Does that mean that when Binance or other exchanges force le to buy a certain amount of coins for the inputted value of exchanged currency, it's really a snapshot at a given time of the lowest price I can buy this amount of coins in the exchange at this time? 2/ Can you confirm this means the buy and sell prices shown on exchanges can be very different and only depend on respectively the sellers' and buyers' offers in the exchange? 3/ What's the point of liquidity in the exchange's pool then?  
> **username_3**: 1. Yes. If you buy more than is available at the stated price, you will pay more. 2. Yes, but in practice they will be very close in efficient markets. 3. Those people willing to buy and sell *are* liquidity in the exchange's pool. They're what lets you go to the exchange and buy and sell because there are people already willing to sell and buy.  
> **username_0**: Excellent, thanks. I had it all wrong. I accepted the answer, thanks. As a bonus: when you create a new coin, does that mean that you basically first give some for free to the exchange itself, and buy it back for a price which is automatically accepted by the exchange in order to set the initial price reported?  
> **username_0**: Update: again, I was wrong. Looks like when adding liquidity, we're actually staking a pair, so both the token and its exchange currency - the ratio sets the price of the token. I wonder if the exchange automatically accepts a buy request up to the number staked at the reported price? I assume that if we can, as soon as we siphon the exchange, the price will go up if someone else wants to buy and offers a buy request for a higher price.  
> **username_3**: @username_0 Exchanges don't own tokens, they just bring buyers and sellers together and hold tokens owner by others to facilitate staking and trading. When a token changes hands between someone who wants to buy it and someone who wants to sell it, exchanges report the transaction, including the price. Someone placing a buy request for a higher price will not change the price unless nobody was willing to sell at less than that price.  
> **username_3**: @username_0 Say I want to buy one bitcoin and I'm willing to pay up to $40,000 if I have to. That won't change the price of bitcoin to $40,000 since there are still plenty of people willing to sell for less than that and I won't have to pay $40,000. The price of bitcoin only goes up to $40,000 if nobody is willing to sell for less than that.  

---

