Orderbook retrieval

Technical questions about the Ripple API, the protocol, etc.

Orderbook retrieval

Postby kmash » Tue Mar 21, 2017 10:54 am

Hi Everyone
I'm trying to get orderbook for bitstamp-usd and bitstamp-btc currencies.
For this I'm using dual 'books_offers' rpc calls like below (with switched gets/pays currencies).
But comparing the received orderbook with ordebook found in online services like gatehub, it seems like *a lot* of entries are missing.
The spread is definitely much larger than it should be.
Tested on public s1.ripple.com server, didn't try on local one.
What could be the problem? Any pointers would be much appreciated.

Code: Select all
{
  "id": 1,
  "command": "book_offers",
  "taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
  "taker_gets": {
    "currency": "BTC",
    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
  },
  "taker_pays": {
    "currency": "USD",
    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
  }
 }
kmash
 
Posts: 6
Joined: Tue Jan 06, 2015 4:14 pm

Re: Orderbook retrieval

Postby JoelKatz » Wed Mar 22, 2017 8:25 pm

That should definitely give you accurate information.

Can you be more precise about what you mean by the spread being larger than it should be? Do you mean that the tip rates you see from the book_offers results are further apart than the tip rates you see online? Can you be more specific about what you're comparing it to?

The gatehub wallet should, I think, show the very same information that book_offers returns.
User avatar
JoelKatz
Ripple
Ripple
 
Posts: 1859
Joined: Sun Dec 23, 2012 3:45 pm
Location: Oakland, CA

Re: Orderbook retrieval

Postby kmash » Thu Mar 23, 2017 10:28 pm

Yes, by 'spread' I mean the distance between tips of bid/ask rates.
I've just executed the above-mentioned request. I'm receiving only 123 items for btc/usd bids and 17 items for asks. Can't say exactly for bids, but obviously there is lack of asks.
The top bid/ask prices are: 967/1027
At the same time at gatehub: 982/1003


JoelKatz wrote:That should definitely give you accurate information.

Can you be more precise about what you mean by the spread being larger than it should be? Do you mean that the tip rates you see from the book_offers results are further apart than the tip rates you see online? Can you be more specific about what you're comparing it to?

The gatehub wallet should, I think, show the very same information that book_offers returns.
kmash
 
Posts: 6
Joined: Tue Jan 06, 2015 4:14 pm

Re: Orderbook retrieval

Postby JoelKatz » Sun Mar 26, 2017 7:17 am

I bet the gatehub display includes paths through XRP. Sometimes there's more liquidity going BTC->XRP->USD than going directly from BTC->USD. When you place an order, it is autobridged against paths through XRP and payments can consider many paths.
User avatar
JoelKatz
Ripple
Ripple
 
Posts: 1859
Joined: Sun Dec 23, 2012 3:45 pm
Location: Oakland, CA


Return to Developers

Who is online

Users browsing this forum: No registered users and 4 guests
cron