BitShares Forum

Main => General Discussion => Topic started by: kaibakker on March 18, 2015, 10:49:13 pm

Title: An open letter to MetaExchange
Post by: kaibakker on March 18, 2015, 10:49:13 pm
Dear people of MetaExchange,
First of all, i think MetaExchange is doing a great job in helping the BitShares platform by becoming our main gateway to and from our BitShares. It feels solid and works really well.

I am working on an website where I compare different Instant Cryptocurrecy exchanges, and tried to implement your api into my project. But i found it pretty hard to use your API first off all, sometimes you have to use POST sometimes GET, it isn't REST.
Second thing that struck me is the amount of parameters that I get back when I ask for the rates :
Code: [Select]
{"symbol_pair":"bitBTC_BTC","ask":"1.006","bid":"0.994","ask_max":"1","bid_max":"0.8","ask_fee_percent":"0","bid_fee_percent":"0","up":false,"btc_volume_24h":"0","last_price":"0","asset_name":null,"realised_spread_percent":"0","price_delta":"0","flipped":false}
Code: [Select]
url: shapeshift.io/rate/<pair>
method: GET
 
 => {
        "pair" : "btc_ltc",
        "rate" : "70.1234"
    }

If you are planning to do a API update ever in the future, have a look at the shapeshift API: https://shapeshift.io/api.html
Help the people that want to build upon your API. But you ofcourse you are busy with other stuff and understand if it doesn't have much priority. If you need some help I am a programmer, so maybe could do somethings myself.

But thanks for the already amazing service!

PS: And it would really help me if it was possible in the future to send to a bishares address in stead of a username.
Title: Re: An open letter to MetaExchange
Post by: xeroc on March 19, 2015, 06:46:33 am
paging @monsterer
I am sure that kind of input is much appreciated
+5%
Title: Re: An open letter to MetaExchange
Post by: monsterer on March 19, 2015, 08:06:35 am
The documentation does indicate which HTTP method each call is, but maybe this is not clear enough.

Also, there is no call just to get the rates, what you are referring to is /api/1/getMarket which gets all the summary details for a particular market, which contains the bid/ask prices among other things.

The reason for not having a single call just to get bid/ask, is that these are rarely useful by themselves - for example you might also want to know what the maximum amount you can buy/sell is in a single transaction. If I made them two different api calls, it's double the work for you.

Send to public key is something which is right on the top of my todo list :)
Title: Re: An open letter to MetaExchange
Post by: kaibakker on March 19, 2015, 08:33:12 am
Great to hear from you, I get that some extra information that you probably will need is useful, but I would like to know how much btc I get for my bts when I use the service.
ask_fee_percent, bid_fee_percent, asset_name, realised_spread_percent, price_delta

Now I have to think is this considers to be an ask of a bid action?
Then do something like ask*(1-ask_fee_percentage) is this my final rate?
Or do I have to do I have to do something with realised_spread_percentage and price_delta.
Maybe you documented it somewhere, but there is a good chance that the developers who implement your Api, make an mistake implementing it. And it would be nice if a developer wouldn't been forts to learn all you application logic.

It just feels confusing and I think Apis shouldn't me confusing.

And I understand that you are not going to change your api tomorrow, but I just want you to know how I felt implementing it, and that the hassle could slow down adoption of your Api.
Title: Re: An open letter to MetaExchange
Post by: monsterer on March 19, 2015, 08:54:08 am
Great to hear from you, I get that some extra information that you probably will need is useful, but I would like to know how much btc I get for my bts when I use the service.
ask_fee_percent, bid_fee_percent, asset_name, realised_spread_percent, price_delta

Now I have to think is this considers to be an ask of a bid action?
Then do something like ask*(1-ask_fee_percentage) is this my final rate?

Ahhh, understood - yes, the conversion from bid/ask into rates is somewhat involved.

Here is the reference JS I use in metaexchange website itself (re-written slightly for you):

https://github.com/wildbunny/metaexchange/blob/master/js/Pages/main.js

Code: [Select]
var qa, qb;
if (data.flipped)
{
// flipped market means flipped order types as well
qa = parseFloat(data.bid);
qb = parseFloat(data.ask);
}
else
{
qa = 1 / parseFloat(data.ask);
qb = 1 / parseFloat(data.bid);
}

var buyFee = (qa * data.ask_fee_percent / 100.0);
var sellFee = (qb * data.bid_fee_percent / 100.0);

var buyQuantity = qa - buyFee;
var sellQuantity = qb + sellFee;

Hope that helps :)
Title: Re: An open letter to MetaExchange
Post by: kaibakker on March 19, 2015, 05:25:46 pm
Thanks that helps a lot, maybe good to put something like that into your documentation as well
Title: Re: An open letter to MetaExchange
Post by: monsterer on March 20, 2015, 10:36:39 am
Thanks that helps a lot, maybe good to put something like that into your documentation as well

I'll stick that on my todo :)
Title: Re: An open letter to MetaExchange
Post by: kaibakker on March 22, 2015, 05:24:00 pm
Hey Monsterer,
Today I started implementing your api. Is there a rule for the directions your markets are in? alphabetical or something. Otherwise I have to store this information somewhere.
Is there a reason market information isn't to ways?
Thanks
Title: Re: An open letter to MetaExchange
Post by: kaibakker on March 22, 2015, 05:33:47 pm
And another question, when is flipped true?