Is there an api for incognito price?
curl https://api.incscan.io/pdex/market | jq -r '.lastPRVPrice'
Are there in the meantime more ways to request the PRV price via API?
Hi @binh, do we have any PRV price API to share with the public?
This would be great, I want to build small tool and need the live PRV price for this. Would be important, that if the data is submitted via JSON that the price comes as double not as a string
You may use this address: https://api.incognito.org/ptoken/list
From that address, you may get the price of any currency listed in pDEX in terms of Prv (PricePrv attribute). For incscan-style, you should get pUSDT/pUSDC prices and average the reverse of them.
Or you may use my brand-new Python SDK: abduraman - Python API for Incognito SDK . There is a Incognito.Public.getTokenList() method which does the same.
There are some other methods to get/calculate the price but this is the easiest one.
Thank you so much @abduraman. This was exactly what I was looking for during the last days. You really made my day. Again thanks a lot, for the link.
Hi, this API get prices from where ? Is it possible to read prices from fullnode ?
You can change the url. Specifically the end (“USD”) to any of the supported base currencies of your choice.
getpdestate to get liquidity pools current status so you can recalculate current price. That’s what I use to get last PRV price on Incscan.
PRV price in USD on Incscan : average of PRV price on [PRV-pUSDT,PRV-pUSDC,PRV-pDAI]
@abduraman , is there documentation for api.incognito.org?
If I open api.incognito.org on Brave, it doesn’t resolve to anything. Is there a page on that site for docs/help?
(… Nevermind, I can just run api.incognito.org/ptoken/list through python to get the results I want).
… However this will just give the current price on all assets.
Is there a known way to query historical prices?
… I want to build a price database, not working on a smart contract.
Also I noticed that you haven’t updated your python library since Dec 2020.
Have you discontinued that proj after that unfortunate run-in you had on the SDK thread?
I’m just looking for an API for PRV (not an Oracle).
Unless the team has any cached option, your only option is to use on-chain data.
After then, Incognito got many updates especially on pDEX. Those updates require so much time which I haven’t and besides, unfortunately I have health problems. So, yes, I cannot continue the project.
Very interesting concept for me… Especially since I may be interested in building a complete price database of more than 1 asset not avail on most APIs… & historical prices are gonna be even more difficult to get listings for.
So, when reading a blockchain, I would be looking for DEX swap events.
Is it even possible to read a blockchain via Python? Would I need to use a smart contract language? I’ve obv done programming, but never previously had a blockchain project.
I’ll do some searching about how to parse a blockchain & go from there…
Not for whole blockchain events but for price manipulation events. You may use liquidity amounts and/or swap events.
You may use any language. My Python SDK is just a wrapper for RPC messages. In other words, you will query blockchain by RPC messages.
Or there is a command line tool in the repo: incognito-cli. You may also check it out.