stellar-deprecated / kelp

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
https://kelpbot.io
Other
1.1k stars 261 forks source link

feat(424): generic price feed #735

Open clD11 opened 3 years ago

clD11 commented 3 years ago

This PR adds a generic price feed which takes a url and response path separated by a semi-colon to retrieve the price

Two examples urls and responses paths are shown below, to see the expected json response paste the url in the browser without the response path. This feat uses a library gjson and the full syntax for traversing json responses can be seen here https://github.com/tidwall/gjson/blob/master/SYNTAX.md

Examples

https://api.kraken.com/0/public/Ticker?pair=XBTUSD;result.XXBTZUSD.a.0 https://api.kraken.com/0/public/Depth?pair=XBTUSD;result.XXBTZUSD.asks.0.0