-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd choice of returned units from orderbookCallBuilder.call() in stellar-sdk #612
Comments
@ire-and-curses should we move this to the javascript repo? |
I think this issue is to do with the data returned from Horizon and not the SDK. As noted in the linked issue above #1193 (comment) this is also something users of the Go SDK has to deal with. |
Yeah I phrased the repro in terms of the JS SDK, but this is actually a problem with the representation in Horizon. |
I see this is still an open issue as of today. When working with the testnet orderbook, I am still seeing the bids amount and the asks amount in different units. If we speak of amount as how many times one could execute 1 unit, (i.e. size in equity world) and depth as the total available to be executed at that price, then currently, the bids amount is representing "depth" and asks amount is amount. IMHO the bids amount needs to be fixed to not be depth but amount that could be executed at the price. Based on what I'm seeing on StellarTerm/testnet, they've fixed this internally which leads me to believe that this would be a "breaking" change if made as people have hacked around it already. To fix or not to fix.... |
My JS hack looks like this currently. (I know my JS looks like C, I'm old school... ;) ) ob now looks like an order book most would expect. |
If I do
Then I get something like this:
I'd like to use XLM units for everything. However, it looks like
•
price
is in XLM for bids•
amount
is amount of XLM for bids•
price
is in XLM for asks•
amount
is amount of ABDT for asks?!I can work around this with something like
but the original returns are surprising, and not documented, AFAIK.
The text was updated successfully, but these errors were encountered: