<p>There is not a way around this unless you are using an exchange. But, even exchanges have a disclaimer:</p>

<blockquote>
  <p>Market orders may be partially filled at several prices. Each part of
  your order will be shown in the fills panel. See <a href="https://support.pro.coinbase.com/customer/en/portal/articles/2945313-overview-of-order-types-and-settings-stop-limit-market-?b_id=17474" rel="nofollow noreferrer">Coinbase Pro - overview of order types</a></p>
</blockquote>

<p>The <a href="https://bitcoin.stackexchange.com/questions/19251/how-do-bitcoin-exchanges-work">way exchanges work</a> is sellers place limit orders, which show up on the order book. When a buyer does a market order, it will buy up the lowest priced volume that <strong><em>is already on the order book</em></strong>. Basically, you have to remember there is a seller for every buyer, and everyone is choosing their price. Things happen fast, if your order is placed right after someone else buys all the volume at the price you wanted, you might get a different price.</p>

<p>Your best option is probably to use an exchange api, and get a feed of the order book, so it is as real-time as possible. E.g. see <a href="https://docs.pro.coinbase.com/" rel="nofollow noreferrer">Coinbase Pro API</a> and their <a href="https://docs.pro.coinbase.com/#the-code-classprettyprintlevel2code-channel" rel="nofollow noreferrer">Level 2 channel in Websocket Feed</a>.</p>

CC BY-SA 4.0
2018-08-09T15:56:27.307Z
2018-08-09T15:56:27.307Z
JBaczuk
<p>So the ASK price of BTC is constantly moving -- every second. I'm trying to build out a simple UI where the user can enter in the amount of BTC they want to buy, and then display how much that will cost them in USD. But when the user finally presses the 'Buy' button, the price of BTC might have changed slightly, and the user will be charged a different value of USD than what was displayed in checkout. WTF? Is there a way around this? How are other exchanges handling this? I know this can be achieved with limit orders and such, but I'm trying to accomplish this with simple market orders.</p>

<buy-bitcoins><marketplace><ticker>
With the btc price changing every second, how can you accurately display conversion to fiat currency?
user2514324
# With the btc price changing every second, how can you accurately display conversion to fiat currency?

(Asked by: username_0 on 2018-08-09)

So the ASK price of BTC is constantly moving -- every second. I'm trying to build out a simple UI where the user can enter in the amount of BTC they want to buy, and then display how much that will cost them in USD. But when the user finally presses the 'Buy' button, the price of BTC might have changed slightly, and the user will be charged a different value of USD than what was displayed in checkout. WTF? Is there a way around this? How are other exchanges handling this? I know this can be achieved with limit orders and such, but I'm trying to accomplish this with simple market orders.

**Tags:** buy-bitcoins, marketplace, ticker


---

## 1 answers

### Answer by username_1 on 2018-08-09. Score: 1

There is not a way around this unless you are using an exchange. But, even exchanges have a disclaimer:

> Market orders may be partially filled at several prices. Each part of
> your order will be shown in the fills panel. See [Coinbase Pro - overview of order types](https://support.pro.coinbase.com/customer/en/portal/articles/2945313-overview-of-order-types-and-settings-stop-limit-market-?b_id=17474)

The [way exchanges work](https://bitcoin.stackexchange.com/questions/19251/how-do-bitcoin-exchanges-work) is sellers place limit orders, which show up on the order book. When a buyer does a market order, it will buy up the lowest priced volume that ***is already on the order book***. Basically, you have to remember there is a seller for every buyer, and everyone is choosing their price. Things happen fast, if your order is placed right after someone else buys all the volume at the price you wanted, you might get a different price.

Your best option is probably to use an exchange api, and get a feed of the order book, so it is as real-time as possible. E.g. see [Coinbase Pro API](https://docs.pro.coinbase.com/) and their [Level 2 channel in Websocket Feed](https://docs.pro.coinbase.com/#the-code-classprettyprintlevel2code-channel).


---

