Bitcoin Forum

Bitcoin => Project Development => Topic started by: UniBanker on November 23, 2017, 06:49:53 AM



Title: Best way to synchronize a price?
Post by: UniBanker on November 23, 2017, 06:49:53 AM
I'm working on grabbing prices from multiple exchanges, and I know with things like EtherDelta it's far too easy to place an out-of-order trade way beyond the reasonable bid/ask range. So for an application to represent the accurate price, we can't go with the *last* price. Should we just present the latest bid? The average between bid and ask? The last closing trade that also is still within 10% of the bid/ask?


Title: Re: Best way to synchronize a price?
Post by: BrewMaster on November 23, 2017, 03:43:17 PM
*last* price is the most accurate price because it is the price that a trade has actually happened. the market price like bids and asks may be anything at anytime but as long as nobody is willing to fill these orders the "real price" is the last one.

besides, in a liquid market there is not much difference between last price and bid and ask prices. they are all within a very small space probably less than 0.5% apart.
give it a try yourself. for example take bitcoin price, Last, Bid, Ask. and see how different these are from each other. usually the APIs have one call called Ticker which gives you all 3 and some more in one place.


Title: Re: Best way to synchronize a price?
Post by: evgen_povt on November 23, 2017, 07:45:52 PM
I'm working on grabbing prices from multiple exchanges, and I know with things like EtherDelta it's far too easy to place an out-of-order trade way beyond the reasonable bid/ask range. So for an application to represent the accurate price, we can't go with the *last* price. Should we just present the latest bid? The average between bid and ask? The last closing trade that also is still within 10% of the bid/ask?

It depends on your purposes.
I believe the prices should be weighted based on volume, especially for low liquid coins.


Title: Re: Best way to synchronize a price?
Post by: CryptoMonitorBot on November 23, 2017, 07:56:39 PM
*last* price is the most accurate

Nop, nop nop nop.

Imagine if the price increase from 600 sats to 800 sats because someone spent 50k USD
Do you want to buy at 800 sats ? No.

You need to check if the bid is up the last, or if the ask is down the last and check the % difference.
In certain situations there's something wrong and you don't want to buy high or sell low.

I would clearly create multiple scenarios based on the situation and adapt the price according to that  8)


Title: Re: Best way to synchronize a price?
Post by: BrewMaster on November 24, 2017, 05:03:54 PM
*last* price is the most accurate
In certain situations there's something wrong and you don't want to buy high or sell low.

well OP didn't say anything about buying or selling.
my understanding was that he wanted to just "display" the price possibly for analysis purposes.

of course if you want to make a trade you have to check the orderbook itself (bids/asks). that much is obvious.