React/Redux Help [10 SBD/$80 USD Bounty]

in utopian-io •  7 years ago  (edited)

Payout Valuation Help [10 SBD/$80 USD Bounty]

The Steem2Fiat Chrome Extension is a tool that helps users better understand the real-world value of their posts. It does this by examining the content of the page inline, and adding data wherever it finds a payout <div>. So
image.png
Becomes
image.png

The Problem

When I created Steem2Fiat I assumed that the value in the div prefaced with $ was indicative of sort of amalgamation of Steem+SBD that would be paid out. I recently found out that it is actually generated by Condensor/Busy/Etc. and is based on a moving average of STEEM prices, and (maybe?) fixes SBD at $1. So my method of using the inlined dollar value is pretty much bunk.

Example

Here is a screenshot of one of my posts that has just payed out. It was supposed to pay out to the author (me) $15.13 USD, apparently.
Screen Shot 2018-01-04 at 1.39.27 PM.png

What I actually received was 7.56 SBD and 1.158 STEEM, worth over $80 at the time of writing. Hence my confusion.

Screen Shot 2018-01-04 at 1.39.44 PM.png

What I Want

In order for this extension to be useful, I need a clear path from the payout number shown below to the actual STEEM/SBD values the writer will receive. From there, I am already pulling current market prices and exchange rates, and I already can inject the final value back into the page.

The easy way: If someone could explain the formula in human-readable terms with 2-3 examples, that would be amazing. If they could point to a Steemit or Busy API that would let me do the calculations myself, that would also be great. Just provide documentation of how the calculations work in a pull request (code encouraged, but not required) and I'll be very happy.

edit: The above idea won't work for old posts that have already paid out, because the feed price changes w.r.t. time. I need to look at the properties of the underlying object in React.

Idea - React Related

Here is a screenshot of a comment on one of my posts, examined using React Dev Tools. I can see the properties of the post including rshares, SBD, and STEEM payouts, so I think that they should be accessible from the content script injected into the page. Unfortunately, I'm no React expert and Google hasn't been very helpful. I'd love to have a way to "clip in" to the Redux state and grab those values. From there it should be pretty easy to calculate the real value of the post.

Screen Shot 2018-01-04 at 1.32.28 PM.png

This method is great because it lets me filter for things like post benefactors and will make it easy to add more features in the future.

To this end, I'm offering a bounty of 10 SBD / $80 USD MINIMUM. If the price of SBD dips below $8, you'll get more. Any way you want it - as STEEM, as SBD, sent to a voting bot of your choice, converted to ETH and put in a poorly implemented Smart Contract, I don't care. All yours.

Thank You For Reading!

If you have any questions, I'm maxg in the Utopian Discord. You can also find my email at https://maxgerber.com



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Approved.

You can contact us on Discord.
[utopian-moderator]

hi Max, is your issue solved do you still need help with this issue ?
I'd like to use your extension when ready .. atm it just shows the same amount ..

ups sorry, looks like just the first time I look at it after installing it displays the same amount, now seems to work, works on busy.org as well

Yeah, it takes a little time to load.. Will be improving the UI and load speed in the next update!

Dragos's original asking post is what prompted me to create this one - and it looks like he's answered my first question for me :)


I should edit the bounty to specify that it must be React help - since knowing current feed prices won't make it possible to accurately see payouts for older posts and comments. Unless I want to do something truly awful like parse the timestamp and keep a history of feed prices...

Okay, so I've read your post and I know React & Redux in the way, that I can help you. The only problem is level of post complexity- you have very specific problem, but provide just a little bit of specific information.
For now, without touching the code and without wider view I can tell, that if Connect is your component, the simplest and yet best solution is to start not from fetching data into the Redux store, but refactoring Connect component, in order to have clear, declarative state. There are clearly too much arrays, when this structure of data can be presented in a 'key: value' form. With refactored state shape it will be much easier to fetch the data.
If it is not your component, then this is non-trivia problem to solve on a complex level. What you can do is a 'hardcoded' solution, and fetching data in non-elastic way, but then you are closely coupled with your dependecy, which is not a solution here.
I can help you to get the solution, but I have to have a look for your code and your more pecific information- please catch me on discord, nick is olo2552 - I will be very glad to help you.

Wow, totally missed this comment! Sorry about that - I'll be reaching out on Discord ASAP 😃

Hey @maxg I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x