BitShares Forum
Main => Technical Support => Topic started by: monsterer on October 20, 2015, 07:57:05 pm
-
I'm looking at cli_wallet, all I can find is get_limit_orders, but there is no documentation.
Is that just one side of the book? Are the results ordered? Is there a better way to get the orderbook?
-
I'm looking at cli_wallet, all I can find is get_limit_orders, but there is no documentation.
Is that just one side of the book? Are the results ordered? Is there a better way to get the orderbook?
gets the best of both sides.
Documentation is found in the source for now.
https://github.com/bitshares/bitshares-2/blob/bitshares/libraries/wallet/include/graphene/wallet/wallet.hpp
-
gets the best of both sides.
Documentation is found in the source for now.
https://github.com/bitshares/bitshares-2/blob/bitshares/libraries/wallet/include/graphene/wallet/wallet.hpp
Ok, great, its ordered, so:
get_limit_orders BTS USD 1 will get me the best bid ask?
Or is it:
get_limit_orders USD BTS 1
?
-
gets the best of both sides.
Documentation is found in the source for now.
https://github.com/bitshares/bitshares-2/blob/bitshares/libraries/wallet/include/graphene/wallet/wallet.hpp
Ok, great, its ordered, so:
get_limit_orders BTS USD 1 will get me the best bid ask?
Or is it:
get_limit_orders USD BTS 1
?
both will get you the same data, just the order the data is received is reversed. Best is to try both and see what the data looks like. The concept of bid/ask is a little ambiguous as the only operation is to "sell" on asset for another.
-
get_limit_orders USD BTS 1
[{
"id": "1.7.1148",
"expiration": "2020-10-20T17:33:00",
"seller": "1.2.18208",
"for_sale": 8033,
"sell_price": {
"base": {
"amount": 18533,
"asset_id": "1.3.121"
},
"quote": {
"amount": 49112450,
"asset_id": "1.3.0"
}
}
},{
"id": "1.7.1139",
"expiration": "2020-10-20T16:45:29",
"seller": "1.2.32886",
"for_sale": 260000000,
"sell_price": {
"base": {
"amount": 260000000,
"asset_id": "1.3.0"
},
"quote": {
"amount": 100000,
"asset_id": "1.3.121"
}
}
}
]
unlocked >>> get_limit_orders BTS USD 1
get_limit_orders BTS USD 1
[{
"id": "1.7.1139",
"expiration": "2020-10-20T16:45:29",
"seller": "1.2.32886",
"for_sale": 260000000,
"sell_price": {
"base": {
"amount": 260000000,
"asset_id": "1.3.0"
},
"quote": {
"amount": 100000,
"asset_id": "1.3.121"
}
}
},{
"id": "1.7.1148",
"expiration": "2020-10-20T17:33:00",
"seller": "1.2.18208",
"for_sale": 8033,
"sell_price": {
"base": {
"amount": 18533,
"asset_id": "1.3.121"
},
"quote": {
"amount": 49112450,
"asset_id": "1.3.0"
}
}
}
]
-
Thanks :)
-
Here's a good resource for future reference:
http://docs.bitshares.eu/api/database.html
Also this.. but a bit outdated:
https://bitshares.org/doxygen/
-
Ok, for clarity's sake, say I want to get the best bid, priced in USD for market BTS/USD - which order is it (1/2), and which sell price is it (base/quote)?
-
Still struggling with this - best I can figure is all the values returned by this function are 10 times too big?
Anyone know how to get a price robustly from this data?
-
Usd precision is 4 digits. Bts is 5 digits
-
Precision is part of get_asset .. that will make any pai robust .. you can take a look at the last third of the pricefeed script
-
Precision is part of get_asset .. that will make any pai robust .. you can take a look at the last third of the pricefeed script
Thanks, got it - turned out I had my base quote precisions around the wrong way :)