0

Which Horizon endpoint should we be using to access current prices for tokens?

I've read through the docs entirely and am assuming the order_book endpoint contains the current price in its response. However, is this the best way?

Any advice would be helpful.

1 Answer 1

1

The current SDEX price can be retrieved from the order_book endpoint. You can also check the liquidity_pools/POOLID/trades endpoint to see the last price from the liquidity pool. Finally, to get the best price you should use paths/strict-send.

New contributor
Vinamo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
3
  • can you give an example of the path finding you mention? I cannot get any path queries to return a path to use in a strict payment. Jun 23 at 16:21
  • horizon.stellar.org/paths/… This will give you the best path to convert 100XLM to USDC. If the path is empty, it just means there is no intermediary market that offers a best price that XLM/USDC.
    – Vinamo
    2 days ago
  • Yes, that's a strict send payment. Why do people continue to speak of path finding? The endpoint /path exists and I'd like to ask it for a valid path then use the response to execute a strict payment once it proves valid. Why is this process so convoluted? And in your example there are no paths. yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.