dan-da / bitsquare_market Goto Github PK
View Code? Open in Web Editor NEWA simple web interface to view bitsquare markets
License: GNU Lesser General Public License v3.0
A simple web interface to view bitsquare markets
License: GNU Lesser General Public License v3.0
I found this problem in the course of investigating:
bisq-network/analytics#1 (comment)
A memory cache is used to store results temporarily during a request. The cache key was not including information about the basecurrency, thus the first result stored for a given key would be used even for other base currencies.
wrong code:
static $results = null;
$val = @$results[$key];
if( $val ) {
return $val;
}
fixed code:
static $results = null;
$fullkey = $file . $key;
$val = @$results[$fullkey];
if( $val ) {
return $val;
}
call: https://market.bitsquare.io/api/trades/?market=btc_eur&limit=2?timestamp_from=1471976042413
result:
[{
"direction": "BUY",
"price": "543.32970000",
"amount": "0.10000000",
"trade_id": "ad85bb39-d80b-4e7b-8bb4-c9537eaeb5ec",
"trade_date": 1475150469519
}, {
"direction": "BUY",
"price": "542.00640000",
"amount": "0.10000000",
"trade_id": "7fa96e8b-eeac-45ee-880e-51e1670bbf2f",
"trade_date": 1475102281499
}]
While these results are possible:
}, {
"direction": "SELL",
"price": "515.65000000",
"amount": "0.20000000",
"trade_id": "135e162f-48ef-4722-957b-fa37689b6bbc",
"trade_date": 1472132093072
}, {
"direction": "BUY",
"price": "517.51000000",
"amount": "0.05000000",
"trade_id": "76f22a82-be54-486c-9462-1a9c9e4109d8",
"trade_date": 1471976042413
}]
Just a heads up that the API endpoint has been returning an error for the past 2 months or so which has prevented us from gathering data over that period.
Here's an example API call that is failing: https://market.bisq.io/api/trades?market=all&sort=asc×tamp_from=1503887527&limit=10
Let us know if you need anything from us to help troubleshoot and resolve this.
Per bisq-network/dao#30, this repository has moved to https://github.com/bisq-network/markets.
The ?market=all option is implemented by calling the trades::get_trades() method once for each basecurrency and then aggregating results. The get_trades() method applies sort and limit params.
However, the original code was not applying sort and limit after the aggregation.
These sorts of complications are a consequence of the fact that the web ui and api is hiding the messiness of multiple basecurrencies in the underlying data source (bisq app).
Host: markets.bisq.network
market.bisq.io/*
=> markets.bisq.network/$1
Note the intentional pluralization of "markets" in the new name.
Background Discussion:
danda
ok, dash is active on website.
seems there were 3 trades in GBP. only market so far.
M
Manfred_Karrer
cool. yes 3 trades
D
danda
ok, all is well then.
M
Manfred_Karrer
but there are offers about 7
D
danda
hmm, offers not showing up for some reason. let me check other markets.
M
Manfred_Karrer
i can only select GBP is that for the offers as well? the offers are other currnecies
D
danda
oh, i see.
M
Manfred_Karrer
seems the selector is only showing traded currencies
D
danda
at present, the check for active markets only considers markets that have ever had at least 1 trade. does not consider offers.
M
Manfred_Karrer
at doge wher no trades have been all currencies are displayed. i think that should be the default behaviour.
D
danda
you can also add &allmarkets=1 param, but no ui for that now.
M
Manfred_Karrer
otherwise offers are omitted if never traded
can u change the selector logic to either show all currencies or all which have either trade or offer (better)
D
danda
yes, doge does that because there are zero markets with any trades.
it is much more expensive to also parse the offers file.
remember it is for every request also.
the inter-request caching would help with that, but is proken on prod server for some reason. ( research project )
I'm reluctant to just show all markets. very cluttered, and annoying to flip through many empty markets.
what I could do is add a UI button or checkbox to toggle showing all markets or traded markets.
i will make a github issue for it. no time today.
MM
Manfred_Karrer
15:53
i leave it up to you but current state should get fixed
This would be a feature where users could enter an email address and receive notifications when a new offer is posted.
To do this on the website would require that we run an external process, eg from cron each minute. It would also require some type of database to store the email and associated market(s) for notifications. In turn, we then need a way for users to modify or delete the alerts, which implies some type of authentication system.
So it quickly gets a bit complicated.
I'm not sure but sending SMS might require some type of paid account. I think that starting out with email alerts should be sufficient.
There are some privacy implications, as we would now be storing email addresses associated with markets.
So upon review, I think that this feature is easier and better to implement in the Bisq app itself, which has no need of user auth and can easily call a callback when new offers are posted, plus no central place to store user emails.
anyway, I am entering the issue here for the record.
idea gentlemen that having alerts to email or sms for new trades posted cud double to triple the amount of completed transactions thru the bisq client (:
On Thu, Jul 6, 2017 at 4:45 PM, Manfred Karrer wrote:
yes that is a longer requested feature, though i am too busy with other stuff...
maybe Dan can deliver something from the markets page?
> On 06.07.2017, at 20:07, Patrick wrote:
>
> Q:could we get alerts for when a new trade is posted for cad/BTC for
> example? Liquidity is low so it would be cooler just to get an alert when a
> new offer is posted than running the app all the time as its decently
> resource-intensive to run
Currently it is not possible to view all trades across all of the markets (showing mainly the trade volume in BTC, as you can with the Bitsquare application).
Could you make it the default view so that it displays the trade history (BTC volume) for all markets, if a specific market is not selected?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.