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
refactor bounty.value_in_usdt into two functions #693
Comments
This issue now has a funding of 0.12 ETH (56.58 USD @ $471.48/ETH) attached to it.
|
@isaacadams Thanks for picking this up! Feel free to reach out to me if you have any questions or need assistance with this bounty. |
Work has been started on the 0.12 ETH (56.06 USD @ $467.2/ETH) funding by: Please work together and coordinate delivery of the issue scope. Gitcoin doesn't know enough about everyones skillsets / free time to say who should work on what, but we trust that the community is smart and well-intentioned enough to work together. As a general rule; if you start work first, youll be at the top of the above list ^^, and should have 'dibs' as long as you follow through. On the above list? Please leave a comment to let the funder (@owocki) and the other parties involved what you're working, with respect to this issue and your plans to resolve it. If you don't leave a comment, the funder may expire your submission at their discretion.
|
Hi @mbeacom , @owocki I noticed that the issue was put back to open. @isaacadams if you are still working on this, I will leave it to you. Otherwise I will be happy to jump in. |
@isaacadams did you want to work on this still? please let us know today |
@owocki @cryptomental @mbeacom Hey fellas, sorry that I haven't been communicating! I am new to the community and wanted to try to finish up what I was doing but haven't had the time to do it. Go ahead and work on it as I am no longer able to do so for the time being. |
thanks for letting us know @isaacadams -- hope to see you around again when things cool down for you @cryptomental all you! |
Ok. Thanks a lot. I will pick it up tomorrow morning! |
I have a lot of fun diving in, I suspect that the first issue will take me a few days as I need to dive in and look around at the codebase. I have so far set up the workspace, built docker images, refactored value_in_usdt into value_in_usdt_now, locally changed data retention policy to days_back = 365*3 , managed to fetch historic bounties using
@mbeacon or @owocki I would be greatful for any hints on how to populate ConversionRate with historic prices from created_on timestamp. I thought about implementing a loop over all bounties that would trigger an "get_historic_price" from polo/etherdelta against timestamp of created_on, but perhaps there is already a way that I did not discover yet e.g. running a test that will populate historic ConversionRate prices in the database. |
I start to understand more and more. Just wanted to double check if ConversionRate object should point to 'web3_created' property, or 'created_on'.
Additionally, currently the cron job updates ConversionRate every three hours querying polo and etherdelta, and retention policy wipes data older than 7 days. If we are to access all old bounties data, the ConvertionRate should be preserved for all bounties web3_created timestamps to save hits to external APIs. One simple idea is to iterate the bounties, keep the ConversionRate timestamps, wipe everything older out and merge the bounties ConversionRates back. Currently convert_amount() from economy/utils always returns the latest price and my idea is to extend it with the optional timestamp argument:
The trick is though that ConversionRate is collected every three hours, and a created_on price will either mean price within 3 hour window before the web3_created or get_prices will have to be called when the bounty is submitted to have the "almost" exact value. We will need to clarify those three issues for me to be able to implement the right approach.
|
web3_created pls! |
yes i think so
i think that the 3 hour window is a fine degree of granularity |
The bounty property and all methods were renamed to use value_in_usdt_now. Issue: gitcoinco#693
The convert_amount method accepts optional timestamp datetime.datetime argument. If the argument is not provided, the latest available ConversionRate is returned. As a fallback if no data for a given timestamp is available, the latest available rate is return. Issue: gitcoinco#693
The value_in_usdt property returns value of the bounty using first available ConversionRate after web3_created bounty creation time. Issue: gitcoinco#693
As required by bounty requirements. Issue: gitcoinco#693
Update the fields to reflect the current status. value_in_usdt holds bounty USD value at web3_created timestamp. Issue: gitcoinco#693
…t the time of the web3_created. To stop fluctuating prices on bounties explorer, use ConversionRate at the web3_created bounty timestamp. Issue: gitcoinco#693
The bounty property and all methods were renamed to use value_in_usdt_now. Issue: gitcoinco#693
The convert_amount method accepts optional timestamp datetime.datetime argument. If the argument is not provided, the latest available ConversionRate is returned. As a fallback if no data for a given timestamp is available, the latest available rate is return. Issue: gitcoinco#693
The value_in_usdt property returns value of the bounty using first available ConversionRate after web3_created bounty creation time. Issue: gitcoinco#693
As required by bounty requirements. Issue: gitcoinco#693
Update the fields to reflect the current status. value_in_usdt holds bounty USD value at web3_created timestamp. Issue: gitcoinco#693
…t the time of the web3_created. To stop fluctuating prices on bounties explorer, use ConversionRate at the web3_created bounty timestamp. Issue: gitcoinco#693
get_prices iterates over all bounties in the DB and retrieves ConversionRates from CryptoCompare if not yet available. Add cryptocompare dependency to requirements. Refs: gitcoinco#693, gitcoinco#491, gitcoinco#692
get_prices iterates over all bounties in the DB and retrieves ConversionRates from CryptoCompare if not yet available. Add cryptocompare dependency to requirements. Refs: gitcoinco#693, gitcoinco#491, gitcoinco#692
The bounty property and all methods were renamed to use value_in_usdt_now. Refs: gitcoinco#693
The convert_amount method accepts optional timestamp datetime.datetime argument. If the argument is not provided, the latest available ConversionRate is returned. As a fallback if no data for a given timestamp is available, the latest available rate is return. Refs: gitcoinco#693
The value_in_usdt property returns value of the bounty using first available ConversionRate after web3_created bounty creation time. Refs: gitcoinco#693
As required by bounty requirements. Refs: gitcoinco#693
Update the fields to reflect the current status. value_in_usdt holds bounty USD value at web3_created timestamp. Refs: gitcoinco#693
…t the time of the web3_created. To stop fluctuating prices on bounties explorer, use ConversionRate at the web3_created bounty timestamp. Refs: gitcoinco#693
Verify that historic ConversionRate objects can be retrieved. Refs: gitcoinco#693
…ate not found. Refs: gitcoinco#693
…in_usdt and value_in_usdt_now. Refs: gitcoinco#693
…now. Also handled in get_prices. Refs: gitcoinco#693
…ateNotFoundError. Fixed typo and made the name PEP8 compliant. Refs: gitcoinco#693
get_prices iterates over all bounties in the DB and retrieves ConversionRates from CryptoCompare if not yet available. Add cryptocompare dependency to requirements. Refs: gitcoinco#693, gitcoinco#491, gitcoinco#692
Added created_on property. Refs: gitcoinco#693
#853 is live now |
The funding of 0.12 ETH (56.06 USD @ $467.2/ETH) attached to this issue has been approved & issued to @cryptomental.
|
what
refactor bounty.value_in_usdt into two functions
value_in_usdt_now
- returns the value in usdt nowvalue_in_usdt
- return the value in usdt at the time of the created_onother considerations
you might also have to edit the data retention policy in the
cleanup_db_space
script and possibly also import some historical ETH to USD data to the database.please be mindful of performance -- dont hit an external API when these methods are called. instead, please leverage the
ConversionRate
object.downstream implications
as for the ui, and what function should be used when:
activity_report should show the latter
bounty explorer stats module should show the latter
bounty detail pages should show the former
success criteria
value_in_usdt_now
- returns the value in usdt nowvalue_in_usdt
- return the value in usdt at the time of the created_onvalue_in_usdt
returns correct data forETH
bounties for the timeframe of 9/1/2016 to presentThe text was updated successfully, but these errors were encountered: