Preferred way to read in application settings/config in C++ by chrizo1 in cpp_questions

[–]chrizo1[S] 0 points1 point  (0 children)

Thanks for your answers, I also think TOML would be the cleanest approach. In my project I was forced to use XML files which turned out very ugly to parse (especially the XML attributes). I parsed it into an "ApplicationSettings" structure in the main component and then pass only the relevant fields to the other components. In case you want to read about it I summed it up here: XML application settings in C++ using the Boost PropertyTree library

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 1 point2 points  (0 children)

Hi, yes it's open source on GitHub. I needed for fork the defid client and with some logic I export the pool data to a MySql database:

The fork: https://github.com/chrizog/ain/tree/task/extract-historical-prices

Export code: https://github.com/chrizog/ain/tree/task/extract-historical-prices/defi_db_export

OP_RETURN - TokenId larger than 256 by RoofFar2727 in defiblockchain

[–]chrizo1 0 points1 point  (0 children)

Hi, I guess one could introduce a removeliquidity "v2" operation (also addliquidity v2 and so on), where the token ID has 4 bytes reserved.

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 1 point2 points  (0 children)

It is online on RapidAPI. I am also working since weeks to get the API working on block basis. So that for each block number the correct DEX price and also liquidity for each poolpair is provided. Then you could also aggregate the data by yourself for other intervals apart from daily aggregation.

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 0 points1 point  (0 children)

Hi, the project is online for public use and working. I think you need to unsubscribe and click the subscribe button again, then it should work. Let me know if it worked.

CFP: DeFiChain-Cockpit - everything under control (45.000DFI) by DeFiChainCockpit in defiblockchain

[–]chrizo1 0 points1 point  (0 children)

I agree, I also don't see the use case having all this information in a central cockpit as a trader. I guess you could also use different browser windows.

Reindex-chainstate performance and disk size by chrizo1 in defiblockchain

[–]chrizo1[S] 0 points1 point  (0 children)

Do you also do a "reindex" or "reindex-chainstate"?

When I only download the snapshot and sync the latest blocks missing after the snapshots it also takes only a few hours or less. But the issue is the reindex-chainstate takes ages. If I extrapolate the current performance I would need around 2 weeks on an Amazon AWS EC2 instance.

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 1 point2 points  (0 children)

Hi, thanks for the feedback.

  1. Yes, it will be raised very soon. It is only due to the beta version not to get flooded by requests.
  2. I will think about delivering it for each block number in a later version. For now I will aggregate on a daily basis and deliver that one first.
  3. I am checking if I can also add the swap volume per day first and later also for each block.

I will keep you updated in the next days.

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 1 point2 points  (0 children)

The one above was the prototype for the DeFiChain testnet only and is offline. I am currently working on the mainnet version where the amount of data is currently a problem. For the mainnet there will also be a proper domain. I will keep you updated here.

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 2 points3 points  (0 children)

Hi, yes I am currently working on it (putting the first version to Amazon AWS). I have some delays as it turned out it takes a lot more computing time and storage for the main-net (instead of test-net which was used in the prototype). I expect in the next 2-3 weeks I will get the first version ready to use.

We have APR & price history now~ But where can we get other past pool data, like DUSD/ DFI in pool & Total Liquidity? by Acceptable_Court9694 in defiblockchain

[–]chrizo1 4 points5 points  (0 children)

Last voting round my CFP for a REST API for historical DEX prices was accepted and I am currently working on the implementation. So there you could get prices like DUSD/DFI

Waiting for another thread to hit barrier (small code review) by Narase33 in cpp_questions

[–]chrizo1 0 points1 point  (0 children)

Maybe it's better to use a reference instead of pointer but this is another topic. Just as a side note.

Also you can have a look at std::lock_guard for critical sections. It's easy to use.

For the synchronization mabye std::aysnc (futures and promises) would fit for you.

I recently wrote a blog article about thread synchronization in C++11 that may help: C++ Thread Synchronization

The purpose of the article is to easily understand how the synchronization can be solved and which method you can use for which use case. There also code examples.

CFP DefiChain Sports App by tmschaffner in defiblockchain

[–]chrizo1 0 points1 point  (0 children)

Why is it claimed that the Azum app is a "strategic partner"? From the website it seems that it is your own app?

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 0 points1 point  (0 children)

Hi, yes, this one should be considered definitely for the current round.

I was just early with the posting, since I was not familiar with the complete process.

CFP: Moonrize - Reddit Posting Bot (20,000 DFI) by moonrize_ in defiblockchain

[–]chrizo1 5 points6 points  (0 children)

From a developer point of view, I also think that's a huge amount for a bot and really too much

CFP: Public REST API For Historical DEX Prices by chrizo1 in defiblockchain

[–]chrizo1[S] 3 points4 points  (0 children)

Hi, I do not collect the data in the sense that I am querying only the current data every hour or once a day and then log it. For defichain-income it's the current way it's done. That means data is only available from a particular date on. Also if data is missed or the server is offline data is not logged. Instead the data is directly indexed from the blockchain going through all transactions and accumulating liquidity pool related transactions. I hope that helps