bisq-network / bisq

A decentralized bitcoin exchange network
https://bisq.network
GNU Affero General Public License v3.0
4.68k stars 1.26k forks source link

Web page for displaying trade statistics #546

Closed ManfredKarrer closed 7 years ago

ManfredKarrer commented 8 years ago

In the upcoming release there will be trade statistics included.

The basic concept is that the traders publish a trade statistics object to the P2P network and every node gets that data and build up a global statistics view and stores that locally.

As there is no central point in Bitsquare, logging trade data is not that trivial. The alternative approach would require a lookup of the Bitcoin network for transactions to the arbitrator (trade fee receiver) and match that with the data from the offer book. Additionally get the market price to estimate the price if a market based price was used. @metabit has started to work on that, but I think the new approach I implemented now is much easier. Sorry @metabit that I did not come up earlier with that solution, but it was not rellay planned but due the high demand with ETC I was forced to work on that.

There are no privacy leaks with that statistic gathering as it contains only the data from the offer (public in the offerbook) plus the trade price and amount. Data which could be derived from the blockchain as well but would be much more complex and would be time delayed (need to be confirmed int he blcokchain to be sure to get the data).

The current solution to display the statistics (price cahrt, volume chart, trades table) looks like that inside the app: bildschirmfoto 2016-07-26 um 00 56 37

It is just a very limited chart, but I don't have time yet to build a fully fledged price chart and there are no good (free and OS) "out of the box" price chart components available in JavaFX.

It would be good to display that data also on a webpage (market.bitsquare.io). I added a prog arg for dumping the data to a json file: --dumpStatistics If that is set to true your app (there is also a headless version) will dump the json into the data directory.

Here is an example JSON: [ { "currency": "ETHC", "direction": "SELL", "tradePrice": 35000000, "tradeAmount": 10000000, "tradeDate": 1469334726728, "paymentMethod": "BLOCK_CHAINS", "offerDate": 1469280483663, "useMarketBasedPrice": false, "marketPriceMargin": 0.0, "offerAmount": 10000000, "offerMinAmount": 10000000, "offerId": "a659e034-9c31-4ca9-9a5c-0ca5713ca384", "depositTxId": "c1e8209d1ee4bbc4aaf9d3cbcc5006ab1bb7108a4a4b1358559f777773eff9a5" }, { "currency": "CRC", "direction": "BUY", "tradePrice": 3488805600, "tradeAmount": 10000, "tradeDate": 1469485518002, "paymentMethod": "SAME_BANK", "offerDate": 1469485041093, "useMarketBasedPrice": true, "marketPriceMargin": 0.03, "offerAmount": 10000, "offerMinAmount": 10000, "offerId": "926ba832-ccc5-4982-8208-6bcf71548fa3", "depositTxId": "a133f813b28363fbcdea467a1f7ab2e984a0f1d9c459c0d12fe543766d423cee" },....

BTC amounts are displayed as satoshi, fiat/altcoin price is multiplied by 10000, so 600 EUR/BTC -> 6 000 000. Altcoin prices use the same style like fiat (ETH/BTC). It is planned for later to invert the altcoin price (BTC/ALT) but that will require a non-backward compatible update and is not planned soon.

If anyone is interested to work on that please get in touch with me. The webpage should follow the same style as the Bitsquare main webpage. Hosting will be provided by myself.

Additionally to the webpage we need an API for providing the trade data as well. I leave actual specifications to the candidate working on it, but it should satisfy typical Bitcoin market price aggregators, so Bitsquare volume and prices can be included.

ManfredKarrer commented 8 years ago

I will offer an intial bounty of 1 BTC for that.

Klakurka commented 8 years ago

The Coin Dance team can take this one.

We'll need to put together a list of basic requirements, then we can build from that.

ManfredKarrer commented 8 years ago

@Klakurka That would be phantastic! Coin Dance would fit perfect to Bitsquare, so very happy for any cooperation!

The basic requirements from my side is just that is should at least display the same information like inside the application (see screenshot above). A more sophisticated chart would be nice to have, but for the start it is not required.

Additionally a totals for trade volume (sum of all currency pairs) would be nice to have as well.

The format of the data dump (JSON) can be changed if required, as well as replaced by a more sophisticated solution (e.g. database instead of single file dump). At the moment there is still not so much activity so the current solution will work but for mid term it would be better to use a DB. But I leave that up to the person who implements it. The Headless module can be used for the data dump, or we can create a custom module for it.

dan-da commented 8 years ago

Sorry I didn't say something before. I was working on this today and I already have a functional backend. The hardest part is finding a javascript library for candlestick charts + volume that actually works and is also license compatible. highcharts and amcharts would work, but I doubt they are acceptable due to license? ( coinmarketcap uses highcharts, and is very nice. ) Other options seem more limited or harder to integrate.

actually I had amcharts working, but it displays a link back to amcharts on 3 areas of the graph. :( highcharts offers a full-functionality non-commercial license: Creative Commons Attribution-NonCommercial 3.0 License. maybe we could use them for now? relevant info:

If using highcharts is ok, I expect I can have a prototype up in a day or two max.

Klakurka commented 8 years ago

If you have a handle on things then we'll stay hands off for now.

ManfredKarrer commented 8 years ago

@dan-da The highcharts non-commercial license will probably not work. Amcharts cheapest option seem to be 140 USD, which I can pay. Have not read much about the license though. The page will be only hosted on 1 server and its only 1 domain. I would like to keep the rest of the webpage code (and backend) OS. Maybe @Klakurka has a recommendation?

dan-da commented 8 years ago

That's too bad because highcharts has an example for loading 1.7 million data points dynamically via ajax calls and smoothly transitioning hloc interval based on graph's date range. I got that working against my backend (with some mods) last night. The only issue is that this demo does not include volume, so my next effort today was going to be to try and merge in a volume demo that they have.

I will just save that in a branch just in case, and go back to the amcharts code. I can make it load data dynamically also, and it is a bit closer to what the bitsquare graph looks like.

ManfredKarrer commented 8 years ago

I did not look very close to the license, but I had the impression that it would not fit, and their commercial license is a bit high for the moment. But if you think otherwise we can check closer or ask them. You don't need to take too much care about the chart style I use in the app. That was just copied from an Oracle demo and is far away from what it should be. But I dont have time to work more on that yet. So in future I might add a sophisticated chart in the app as well.

dan-da commented 8 years ago

@ManfredKarrer hey there doesn't seem to be any programmatic way to distinguish between fiat currencies and crypto in the trade stats, but they use different precisions.

I could fake it by creating a static list, but that's really gross going forward.

Probably the best thing would be a separate file: currencies.json that specifies the currency list with fields such as: symbol, name, precision, type (fiat, blockchain), and anything else you can think of.

While we're at it, a list of trading pairs (markets) would be good too. For now I am just using the heuristic that everything trades against BTC, but I don't know if that will be true forever. So I guess I am asking for a markets.json file also.

ManfredKarrer commented 8 years ago

Yes thats who I distinguish. I check in my currency list if its fiat or altcoin. in CurrencyUtils there are all lists. Yes BTC is always on one side. There are no plans to change that as that would require a huge dev effort to replace BTC by any other coin. Monero would be the only where it would make sense but they dont have Multisig and no SPV. So nothing to consider for the mid term...

dan-da commented 8 years ago

ok, I will just use a currency list for now. maybe get fancier later.

dan-da commented 8 years ago

a couple more quick things.

  1. I am using advisory locking, ie flock() when reading the stats file to prevent corrupted reads due to simultaneous writes/reads. That will only work if bitsquare also uses advisory locking. Is it? With such low volume, it shouldn't really be an issue now, but better to do it right the first time...
  2. There is some garbage at the beginning of the trade stats json file that I have just been stripping out. I thought maybe it was a byte order mark or something, but doesn't seem right.
<AC><ED>^@^Et<E4><8C>[
  {
    "currency": "XMR",
    "direction": "SELL",
ManfredKarrer commented 8 years ago

Yes the few bytes are from java serialisation. I just use my java serialisation based persistance framework to store the json. So it is actually a serialised String object. You can simply stip it out.

In FileManager.saveToFile is the code for saving the file. It first writes to a temp file and after that renames the tempFile to the real file. I used that strategy from how BitcoinJ saves the wallet file. There is no explicit lock. After a quick research it seem there is no good support for Unix style locking due the nature of crossplatform compatibility of Java. We could add a lock file for signaling when Bitsquare is accessing the file if needed. Not sure if that is a good idea though... I assume it would be better to look for a existing persistance framework or database (like https://github.com/dain/leveldb) if we need more sophisticated featues. Maybe @mrosseel has any recommendation?

But for the low volume atm that might be not really critical. What would happen if there is a file conflict? I assume the rename from java side would fail if you have the file open for read. And if I rename and you try to open for read you might get an error. Maybe you can copy the file before opening, so the timewindow for conflicts is reduced to the renaming which is very fast. On both sides we just can repeat the failed operation after a short interval. And even if not the file will be written at the next data update. So you might lose a data update for a few seconds. The whole P2P model is based on eventually consistancy. We never have a perfect accurate view of the data in the network, and that is not a problem because inconsistancy does not have critical consequences (u might miss an offer or trade statistics object,...).

dan-da commented 8 years ago

ah, since you are using a tmp+rename, then we are fine, because rename is atomic.

If my program is still reading, I believe (from distant memory) what happens at a low level is that the filename is mapped to a new inode, but my program continues to read from the old inode location. When my program finishes and nobody else has an open file handle, the filesystem can actually wipe out the old inode(s). it even works over nfs.

dan-da commented 8 years ago

ok, time to take a break. Here's a screenshot of what I have so far.

screenshot

The biggest todos are:

edit: colors will be changed. those are default graph colors. eg positive candlesticks will be green.

ManfredKarrer commented 8 years ago

Just pushed it to dev branch. If dumpStatistics is set I dump 2 json files.

Json for fiat: [ { "code": "ARS", "name": "Argentinischer Peso" }, { "code": "AUD", "name": "Australischer Dollar" },

json for altcoins: [ { "code": "XMR", "name": "Monero" }, { "code": "SC", "name": "Siacoin" },

ManfredKarrer commented 8 years ago

Ah the name is using the system language, so if you have english OS you will have the english names.

dan-da commented 8 years ago

thx. I would still recommend adding a precision field to indicate how to convert into decimal. That way if there are ever abnormalities, they can be dealt with automatically by clients. your call.

dan-da commented 8 years ago

https://docs.oracle.com/cd/E39583_01/fscm92pbr0/eng/fscm/fsgl/task_ConfiguringCurrencyPrecision-9f1bd0.html

According to the ISO standard, currency precision can range from zero decimals to three decimals. For example, USD amounts have two digits to the right of the decimal, and Japanese yen (JPY) have none. To support this dynamic currency precision, PeopleSoft software delivers all its currency-sensitive amount fields with a standard length of 23.3, or 23 digits to the left of the decimal and three digits to the right. There is a control currency on the same record to control the display and processing of such amount fields.

I'm not sure, but I think some altcoins may vary also, or could in the future.

ManfredKarrer commented 8 years ago

All prices use the same presicision: price 6 000 000 -> 600 EUR/BTC. As we use inverted altcoin prices like 50 ETH/BTC (0.02 BTC/ETH at other exchanges) we don't have issues with missing precision at prices like 0.00000001 as that is represented as a rather lange number in our style. So on your side just dive with 10000 and if its an altcoin make 1/price to get the usual display price (0.02 BTC/EHT). In Bitsquare I plan to show he inverte altcoin price (0.02 BTC/EHT) in future, but that will cause a backward incompatible change so need to wait until there is a strong reason to do that.

Actually the currency pairs are inverted in finance so not the logical division but the opposit (600 BTC/EUR). Seems that has strange historical reasons and most finance platforms follows that. I use the mathematical logical verison, where price is EUR per BTC so EUR/BTC not the other way round. Maybe in future if people complain we will change that but until yet just one user noticed that and he confirmed that it is a stupid tradition. And I dont see much reason to follow stupid finance domain language. I also dont like the ask/buy and prefer the more intuitive buy/sell....

dan-da commented 8 years ago

ok, I have proof of concept running here. You can let me know what is missing, needs tweaking, etc.

Also, code is up on github here.

basic API docs are here.

frontend I have not integrated with the bitsquare header/footer/styles yet. Shouldn't be a big deal, I hope.

I'm defaulting to eur_usd for now, because it has the most volume.

I am displaying a market summary at the top. Price data is only present if there have been trades during the current trading day. ( trading day is UTC based. )

Last trades up to 100 are displayed in a table at the bottom. Trade date/time are displayed in user's localtime via some JS magic. Or could display as UTC or other timezone if desired. If I had open buy/sell orders from bitsquare, those could be displayed also, in separate tables. would require another .json file.

The graph is not functioning as well as I would like. Basically, the bulk of time spent on this project has been fighting with amcharts. I have a laundry list of complaints and plenty of torn hair!! Anyway, for the moment, the graph has the following limitations:

CSV data is loaded from backend as a separate request after page loads. amcharts typically wants the data embedded in the page, so this required a separate plugin, loaddata. csv format is used instead of json because it means less data across the wire, important for large data sets.

backend The backend is not efficient at all. It reads the trade files directly and uses brute force to generate hloc summaries for each request. The only optimization is that it caches the json files in mem across requests and re-reads them if modified. many future optimizations possible if/when necessary. My theory is that its better to "go fast and break things", ie get something up and running sooner rather than later. Trade volume is so small now that optimizations aren't necessary yet.

An obvious optimization would be to pre-generate the hloc data, say each minute from cron. that would go a long way before needing to get fancier.

The code is written in PHP using a back-to-basics approach. There is no crazy framework to install and user-facing endpoints are generally short plain scripts without functions that utilize a small class library for any heavy lifting. PHP strict mode is used and most things that would normally be a notice, warning, or error get thrown as an exception instead, and can optionally send an email to admin. Installation is basically just dropping it into a docroot somewhere and setting path to json files. README has details.

dan-da commented 8 years ago

oh also, I can/should add REST APIs for currencies and markets. Since I already have backend classes for those.

ManfredKarrer commented 8 years ago

Wow great thanks!

Do you use the latest release of Bitsquare? Do you use the live data because the latest trades are 25.7. missing the last trades (I have trade data of today).

After reading your complaints about amcharts I am wondering if highstock would have been a better choice. I think it costs 780 USD instead of 280 USD for amcharts. But that price is always relative to dev effort and the end result. The visual quality of highstock would be much better as well. Maybe its better to switch to highstock? What do you think?

I will set up a module for a headless app for the statistic dump. So we can optimize things there.
Will have a look to add offer data as json as well. In a second step we can add then offer data as charts and table as well. But lets keep focussed on the trade part first and get that published before working on offers.

Here some feedback:

I will rent a hosted server at digital ocean. Can you do the set up there for the market.bitsquare.io page? Which OS do you prefer? Ubuntu 16 or 14? or any other? I will pass you the credentials then so you have full access (I will buy a SSL cert and setup the DNS as well).

Regarding performance: That is the same in the app. I have not optimized yet as with current volume it's not needed. But will do once it's needed. I share your opinion regarding that. Go out fast and don't do premature optimization.

mrosseel commented 8 years ago

the last site I made I used https://letsencrypt.org/ , the 'open-source' ssl certs and it was pretty smooth and free. Also updates can be automated so you no longer have to remember to renew.

ManfredKarrer commented 8 years ago

@mrosseel Ah wow thanks!

dan-da commented 8 years ago

yes, using bitsquare built yesterday after latest public release. I setup a cron job to copy the .json files to the server, but it wasn't working last night apparently. I've got it working now, and verified I see today's market summary for EURO.

btw, I found a fun new json edge case. The leading garbage data contained an "[" which I was looking for as my start of data. I changed it to look for newline - 1 instead. I really think you should fix this though, I'm sure others will be using those files for all sorts of things. what... java doesn't have ye old basic json_encode()? :tongue:

I'm pretty sure highstock is a better choice. I will try it with my latest backend so you can see it. If we decide to go with that, I'd suggest talking with them and explain your situation and see if they agree to non-commercial license usage. Or well, up to you how you want to handle it.

btw, I did find one open source solution that looked possibly workable and with some very pro features like bollinger bands, but it uses ReactJS (.jsx) and somehow compiles to JS and I couldn't find clear instructions for that, and it all seemed a headache so I didn't actually try it out. But maybe someone else would want to take on that project. The project is react-stockcharts.

Avg price was wrong because amcharts is crazy. haha. Well it really only understand high, low, open, close and "value". If you zoom to higher levels eg year then it recalcs those values. But it doesn't do any recalcs for volume or value, or avg and in fact nulls those fields out when calling the tooltip. Worse yet, I was assigning avg to value, and yet it was somehow ignoring that and using close instead. Anyway, for now I've just mapped avg to avg, so it displays correctly in regular mode, but when zoomed is null. I don't know how to display a different tooltip text when summarized or would do that. Easiest thing would be to just remove avg and volume fields from tooltip entirely. I feel like the amcharts people use it for making pretty demos but have not put the stock charts to any real world usage themselves, or these rough edges would be fixed already.

Re sorting of currencies by volume: It can be done, though the frontend doesn't presently have the necessary info at that stage. The currency class only looks at the currency json files, not the trades. not a big deal... should just mean a 10 minute change instead of 10 seconds. To my mind though, its a usability issue: when I lookup items in a list I much prefer them sorted alphabetically rather that having to hunt all around. Is sorting by volume an industry standard? If we are going to do it, it seems we should also display the volumes in the select, so at least it is clear there is SOME type of order.

yes I can do the server setup, provided access. Ubuntu 16 LTS is fine, or else 14 LTS. Here's an ssh pubkey. Oh, and I would need sudo access temporarily for installing apache/php packages.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCu12FEesP+ykbwDlrZIY3nZ0dmZDzmj99Sgz9yqx7vNbOD2mYjnJR1LLNF8vNXjS8wXkZA8CL9PV1Hm3lS7t5/Z1iBGziAQPgzdq90TS5tHkyeIon6MQZEtdszOklRV3nM5KTPobJ+bNs7K/1szpQgLEy8rglmKeoPWfoPXUgziVduP4hWRolX1kcKcgXn5MLWH71OOwfXS3Jc9ZFTwwjEk2/ucbCqV6G3x4JUi21mFYn9TGwFQwaaW13HaF3NFvWbBJKPhxglhgGW94t3o0UkHuV78FpE6P9Qt/8NNQwbVQ6FYj/YL8E1fYHnZwwwduKujJ1M0CuPRi6q5U5xskqJ dan-da@bitsquare

fyi I will likely be afk most/all of next week. not certain yet though. anyway the install is quite simple in case you need to do it without me.

dan-da commented 8 years ago

one more thing. I am presently displaying in the select only markets that have at least 1 trade. ( hmm, come to think, I guess I already did deal with getting some trade data at that stage. hey, it was late. ) At present this filters out a bunch of markets. I added a param "allmarkets=1" that you can append to the url to see the full list. Markets without any data get a short message instead of displaying the empty graph and order boxes. So that's a first draft, but I'm putting it up for discussion how best to handle empty markets.

see example.

ManfredKarrer commented 8 years ago

The java serialisation bytes are because I am lazy and re-used my persistence framework, so I store a String with the JSON as content as java serialized object. But I can store it as extra file also, just need to add some extra handling for that...

So sounds amchart is really not a good solution. Lets switch to highstock. I will contact them to ask regarding the license.

Re sorting of currencies, yes you are right, lets keep it alphabetically.

dan-da commented 8 years ago

there was something nagging me about highstock. I never got it working with volume displayed below. That was going to be my next task before we switched to amcharts. I think it shouldn't be a big challenge though... I have an example just without the dynamic data loading. anyway, I will work on it later tonight and see if I can't get something up for you to look at.

ManfredKarrer commented 8 years ago

Just changed the storage code: https://github.com/bitsquare/bitsquare/commit/5c86e6ed5d3bdc67507c0307e0987a6f080e6b0b Now you get a plain text without nasty bytes form java serialisation...

ManfredKarrer commented 8 years ago

Ah also added a module statistics. That is headless so you can run it on the server. Needs the prog arg as well --dumpStatistics=true.

https://github.com/bitsquare/bitsquare/commit/ea757050851795a87b888725b682088d5fc46830

Btw. Is a 2GB server enough? We can upgrade later if needed.

ManfredKarrer commented 8 years ago

@dan-da Great, but no stress, it is not so super urgent....

ManfredKarrer commented 8 years ago

Offers are dumped as well now: [ { "direction": "BUY", "currencyCode": "SC", "minAmount": 10000000, "amount": 50000000, "price": 9820000000, "date": 1469440861965, "useMarketBasedPrice": true, "marketPriceMargin": 0.018, "paymentMethod": "BLOCK_CHAINS", "id": "6bcf3fbe-2432-4df6-9042-eb0f38fed03c", "offerFeeTxID": "2487900db47a341aaeed4e1b0842fa0dbe767639796c8dd84abe73d445e1037c" }, { "direction": "BUY", "currencyCode": "DASH", "minAmount": 2000000, "amount": 20000000, "price": 691100, "date": 1468927329295, "useMarketBasedPrice": true, "marketPriceMargin": 0.02, "paymentMethod": "BLOCK_CHAINS", "id": "57204229-7128-425b-b1d5-f6e225d62c1a", "offerFeeTxID": "8f5f58bab9d7143534db33f7ad2a9e7f64f7b7e1fb63ef6f7bb35f925a19f746" },

marketPriceMargin is % value 0.01 -> 1 %.

https://github.com/bitsquare/bitsquare/commit/814bf8d06593470b90d222bbe678fdd4c341827b

dan-da commented 8 years ago

ok, I have new code with highcharts up for you to look at. Actually, there are two versions, one does a bit of caching; or rather it avoids unnecessary server requests if newly requested data set is within the current set.

highcharts is definitely nicer and more logical to work with. But it is also not really designed for dynamically loading different size intervals from the server, and it also isn't crazy about data with gaps. I was able to bend it to my will mostly though with some creativity.

So at the heart of things, server side and client side are both aware of many size intervals:

function get_interval(start, end) {
    // Note: this logic mirrors the logic in api/hloc/index.php
    var range = (end - start) / 1000;   // in seconds.
    if(range <= 3600) {
        // up to one hour range loads minutely data  ( 60 / hour )
        return 'minutes';
    }
    else if(range <= 1 * 24 * 3600) {
        // up to one day range loads half-hourly data  ( 48 / day )
        return 'half_hours';
    }
    else if(range <= 3 * 24 * 3600) {
        // up to 3 day range loads hourly data  ( 72 / 3 days)
        return 'hours';
    }
    else if(range <= 7 * 24 * 3600) {
        // up to 7 day range loads half-daily data  ( 84 / week )
        return 'half_days';
    }
    else if(range <= 60 * 24 * 3600) {
        // up to 2 month range loads daily data  ( 60 / 2 months )
        return 'days';
    }
    else if(range <= 12 * 31 * 24 * 3600) {
        // up to one year range loads weekly data ( 52 / year )
        return 'weeks';
    }
    else if(range <= 12 * 31 * 24 * 3600) {
        // up to 5 year range loads monthly data ( 60 / 5 years )
        return 'months';
    }
    else {
        // greater range loads yearly data
        return 'years';
    }
}

So we pretty much always return a small chunk of data per request. That's not ideal when our total size would easily fit on the client side and allow for smooth animation there, but it should scale to millions of data points over years with similar client-side performance. A more advanced version would do smart look-ahead/behind caching for smoother client-side, but that's something the chart builders should make, not me.

So that's the tradeoff I'm making. @ManfredKarrer If you want a real simple version where I just load all the data for all time into the client as minute interval and let it calculate from there with no server refreshes, I can whip that up pretty easily I think because that's bread/butter for highcharts. It could be that we start off with that, and move to this model if/when there is enough market data to necessitate it. At least now the backend supports chunked data pretty well and concept is proven on the frontend.

A UI issue that is faced with either way of doing things is that of intraday vs long-term data. Because the scrollbar is fixed to long-term, it becomes difficult to navigate for intraday, though it displays fine in the graph. It may be cleanest just to provide an Intraday graph and a longer term graph, perhaps in tabs on the same page.

The way the interval buttons work in bitsquare (java) graph is a bit different. The JS graphing libs tend to be oriented around an X axis scrollbar and then interval buttons for "zooming" into a section of the graph, eg a month's worth of data with each data point a day. The bitsquare graph has buttons that directly specify the interval of the data points. Doubtless that model could be done with highcharts, but would likely require using external buttons, not the builtins for zooming. Anyway, it would take some more research and experimentation.

btw, I made a mode for testing with random data in the gaps. just add parameter fillgaps=random to url. So you can get an idea how it would look with full data.

The testing URLs are:

sorry, the amcharts version is offline for now. it's in a different branch.

I haven't had opportunity to do anything with the offer data yet.

ManfredKarrer commented 8 years ago

Great!!! Highchart looks much better!

I leave the decisions regarding the data/chaching/server load handling to you. You can stick with the easier solution now and we can adopt once needed.

The java chart is not optimal. I did that fixed interval because it was easier, so just keep it like it is in highcharts, that is the more standard way to display it and I (or some dev taking that task) will some day improve the java chart with a zoomable time area.

The average price is different to the one I calculate. For instance for 30.7 we have 3 EUR trades (1m view): 614,16 621,96 603,8 with those btc volumes: 0,75 0,75 0,5 results in those EUR volumes: 460,62 466,47 301,9 I calculate the av price as the sum of fiat volume / sum of btc volume = av price which results in 614,495 in that case. In highchart is dislays 613,3.

I will setup the server today and send u the credentials then. Will rent a 2GB server.

mrosseel commented 8 years ago

don't know about the requirements of this server, but I run my java webapps on 512mb droplets at digital ocean; if you can downgrade later no problem of course, haven't tried that yet

Mike

On 1 August 2016 at 14:15, Manfred Karrer notifications@github.com wrote:

Great!!! Highchart looks much better!

I leave the decisions regarding the data/chaching/server load handling to you. You can stick with the easier solution now and we can adopt once needed.

The java chart is not optimal. I did that fixed interval because it was easier, so just keep it like it is in highcharts, that is the more standard way to display it and I (or some dev taking that task) will some day improve the java chart with a zoomable time area.

The average price is different to the one I calculate. For instance for 30.7 we have 3 EUR trades (1m view): 614,16 621,96 603,8 with those btc volumes: 0,75 0,75 0,5 results in those EUR volumes: 460,62 466,47 301,9 I calculate the av price as the sum of fiat volume / sum of btc volume = av price which results in 614,495 in that case. In highchart is dislays 613,3.

I will setup the server today and send u the credentials then. Will rent a 2GB server.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bitsquare/bitsquare/issues/546#issuecomment-236564459, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZb3kdwRn1RBNNoB2N0u0BF_tDZZSnCks5qbeNFgaJpZM4JVNIs .

dan-da commented 8 years ago

another update. three things:

  1. I made a new test page that loads all data as minutes and does everything client side. I think we should go with this solution for now, and can step up to the other one later perhaps. Given how sparse the data is even in the busiest market, I think this should be fine until at least the end of year probably longer. And it is the most responsive solution. check it out!
  2. fixed the average price calc, per @ManfredKarrer's advice.
  3. charts are now auto-refreshing every 5 minutes. (in all 3 demos).

I have some minor tweaks to do yet, such as fixing decimal display. Then will setup on server.

ManfredKarrer commented 8 years ago

@dan-da Great!

dan-da commented 8 years ago

This is pretty much done. Now online at market.bitsquare.io.

code is at: https://github.com/dan-da/bitsquare_market You'll likely want to clone into bitsquare github account and make that the official repo for future contributions.

if approved, bounty can be paid to: 1MVDBkzmgXRHivztao5ua6qYyWPa78Sa1k

or let me know if any changes required.

Some improvement tasks for the future could be:

ManfredKarrer commented 8 years ago

1000 thanks @dan-da for the great job! Bounty payout is on the way... https://blockchain.info/address/1MVDBkzmgXRHivztao5ua6qYyWPa78Sa1k

ivilata commented 8 years ago

Wow, both achievements (node UI and web UI) look really impressive. Congratulations, @ManfredKarrer and @dan-da!

ManfredKarrer commented 8 years ago

Thanks @ivilata! Welcome back!