Getting AgX scheduled jobs ready

in #utopian-io7 years ago (edited)

image.png

On my previous posts about AgX, I have first extracte STEEM/SBD data to calculate their 200 days moving average (AgX factor), and then used this data to draw a chart of the evolution of the price ratio and of the AgX factor itself.

The task was then run manually with npm run start

New Features

  • In order to automatize the whole thing I have integrated Express.js framework and set the main route to start fetching data and drawing the chart.
  • The call to the the job is secured by a secret token
  • If a chart has already been drawn that day, the process aborts
  • If a chart has already been drawn that day but the admin wants to override, he can add the parameter force=true to the URL

The new flow is as follow:

  • API is called
  • Authentication is checked thanks to the token
  • If Authentication succeeds, check if the chart has already been drawn
  • If the chart has not been drawn yet or if the admin forced it, get data from Bittrex API
  • Calculate 400 days STEEM/SBD ratio and 200 days AgX factor
  • Draw chart
  • Store it in public folder

The chart has been improved to follow @aggroed suggestions:

2018-02-05.jpg

  • Factor renamed to AgX
  • Tooltip shows today values for AgX and Steem/SBD ratio

Next steps

Next step will probably be the final one and will integrate Steem.js to allow the backend to publish posts containing the AgX information.

Release coming soon!

@stoodkev



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

After a long time I have seen someone write Jade!(My preffered EJS & Handlebars)

You can contact us on Discord.

[utopian-moderator]

Actually, I usually use EJS, but Express generated these files, and since I had just a few lines to render, I thought I d give it a try =)

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

Achievements

  • Seems like you contribute quite often. AMAZING!

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

connect each other thank you

Interesting information. Thanks for sharing and for following as well.

Your publication is a great work of mathematical analysis.
Excellent work and contribution

I agree.

Pretty informative. It's interesting that we are all used to just endless contribution but steemit incentivizes less content that is more impactful.

Spamming degrades your value, but not posting enough does so as well. Where the happy medium is, is hard to find. And it can kind of suck when you feel you have to balance interaction with your account value/ability but I guess the end-goal may be worth it (curated, paid-out content)

Spam is discouraged by the community, including comment spam.

Tips to avoid being flagged

Thank You! ⚜

great a job.....@stoodkev,your post is very inspiring for me..Thanks

Coin Marketplace

STEEM 0.15
TRX 0.16
JST 0.028
BTC 67807.24
ETH 2423.65
USDT 1.00
SBD 2.33