SteemDesk—Crypto Price History

in utopian-io •  7 years ago  (edited)

The Missing Tool Chain For Steemit Users

SteemDesk is an existing project which provides missing tools for Steemit users.

SteemDesk Cover PriceHistory

About The Project

SteemDesk tries to make a Steemit user's life easier by providing the tools missing on Steemit.com.

Existing Features

Dashboard

  • exact user reputation
  • follower count
  • following count

Delegations

  • View current delegations of an account with APR calculations
  • Make new delegations from one account to another account

Activities

  • Display and filter for different transactions on your blockchain
  • Load account history incrementally

Features Added In This Update

Price History Feed

On the current delegations page, one can see an overview of the delegations a user has made. The delegations view looks like this:

Current Delegations Page

The annual percentage return (APR) is given in the penultimate column.

The calculation for the APR was not correct because it has been assumed that Steem and SBD have more or less the same value. The assumption was made because the app did not retrieve the current prices for Steem and SBD. Therefore a price feed for cryptos has been added in this update.

The prices for the cryptocurrencies are provided by CryptoCompare. The attribution is given in the About page of the application and the README.

Crypto price support has been added to the Redux store. The relevant code can be found in src/state/crypto/.

The part of the state tree looks like this:

priceHistory: {
  STEEM: {
    inBTC: [1.00],
    inUSD: [1.00]
  },
  SBD: {
    inBTC: [1.00],
    inUSD: [1.00]
  }
},
// EMPTY, LOADED, LOADING
priceHistoryStatus: 'EMPTY'

The operation to request a price history for a cryptocurrency looks like this:

const priceHistoryRequested = (symbol = 'STEEM') => async (dispatch, getState) => { … }

This operation is used in src/App.js to retrieve the prices for Steem and SBD on application startup. When the Redux store holds the prices they will be used on the delegations page and the Dashboard page.

To make the prices easily accesible two selectors have been added:

const steemPrice = cryptoSelectors.selectSteemPrice(state)
const sbdPrice = cryptoSelectors.selectSBDPrice(state)

Improved Calculation Of APR For Current Delegations

With the added support for crypto prices, the calculation of the APR for a delegation has been improved.

The amount of SBD received as a reward for a delegation is now converted to Steem. This amount will be added to the Steem we received for the same delegation on the same day. This sum is the total amount received which then can be used to calculate the APR.

The code can be found in /src/pages/delegation/CurrentDelegations.js.

Minor Changes

  • About page with attribution to CryptoCompare.
  • Replaced Home page with Dashboard page.
  • Prices on Dashboard and improved styling with Level components.

Steem Prices On Dashboard

Technology Stack

Roadmap

  • Improve display of activity items by replacing the table with dedicated components
  • Show APR for transfers to Steem
  • Show lifetime author rewards
  • Show lifetime curation rewards
  • Show upvotes in a list (filterable for a time frame, etc.)
  • Show followers in a list (filterable for a time frame, reputation, etc.)
  • Improve display of delegation items
  • Improve error messages when the network is down

Getting Started

Building the app locally on your computer should be straightforward. Clone the app. Then install the dependencies with yarn. When the installation has finished, you can run the app with yarn start. These are the steps in more detail:

git clone https://github.com/cutemachine/SteemDesk.git
cd SteemDesk
yarn
yarn start

Demo

Check out the live version of SteemDesk.

How To Contribute

Do you want to contribute to this project? Great. You can contact me through my Github profile page or send a pull request.



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:  
  ·  7 years ago 

Thank you for your contribution.


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

Hey @justyy, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Great to see that you keep doing new features. :)

Oh, there is so much I would like to add. The limiting factor is only time :)

Hopefully I'll find the time the next week to work on my project. I'll be a big surprise if everything will work smoothly. :)

Good to hear; keep me updated.

Hey @cutemachine! Thank you for the great work you've done!

We're already looking forward to your next contribution!

Fully Decentralized Rewards

We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.

Utopian Witness!

Vote for Utopian Witness! We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

Want to chat? Join us on Discord https://discord.me/utopian-io

Nice work , can i have your contact on discord?