[Steem Examples] Steem Price Rate History

in #utopian-io7 years ago (edited)

[Steem Examples] Steem Price Rate History

image.png
Img src


I recently made a post about how I removed USD payout display from SteemLiberator Condenser and instead show the actual SBD and STEEM (SP) payouts. Due to the fact that it has been receiving such great support, I have decided to also release the microservice that I created to handle this function.

The reason a micro-service was created is because the application needs to keep a living history of all of the filled conversion requests to be able to properly estimate the STEEM rate at the time of payout. Instead of polluting the Condenser code base with these extra dependencies, I have created this micro-service example to keep things nice and sectioned off.

Here's the original post


Steem Price Rate History

This is a microservice application used to get the actual SBD/SP payout of a given post

Hosted at https://steemrate.steemliberator.com:9001

Getting Started

  • Clone the repo
    • git clone https://github.com/SteemDevs/steem-examples
  • Enter the app directory
    • cd steem-examples/javascript/steem-price-rate-history
  • Install dependencies
    • npm install
  • Start your MongoDB client
    • mongod --fork --logpath ./logs/mongodb.log
  • Configure database
    • config.js
  • Seed data from SteemData
    • npm run setupdb
  • Start the application
    • npm run start

Required Params

  • created
  • promoted
  • pending_payout_value
  • percent_steem_dollars
  • total_payout_value
  • curator_payout_value
  • author_rewards
  • max_accepted_payout

Example Object

{ created: '2018-01-23T00:42:03',
  promoted: '0.000 SBD',
  author_rewards: '0',
  total_payout_value: '0.000 SBD',
  max_accepted_payout: '1000000.000 SBD',
  curator_payout_value: '0.000 SBD',
  percent_steem_dollars: '10000',
  pending_payout_value: '2.370 SBD',
  total_pending_payout_value: '0.000 STEEM' }

Example Request

  • curl 'https://steemrate.steemliberator.com/?created=2018-01-23T00%3A42%3A03&promoted=0.000%20SBD&author_rewards=0&total_payout_value=0.000%20SBD&max_accepted_payout=1000000.000%20SBD&curator_payout_value=0.000%20SBD&percent_steem_dollars=10000&pending_payout_value=2.370%20SBD&total_pending_payout_value=0.000%20STEEM'

Example Response

{"payoutPending":true,"averageRate":0,"fallbackActive":true,"sbdPayout":1.185,"steemPayout":null,"curatorSteemPayout":0}

More Information

What Does Fallback Active Mean In The Response?

The STEEM Rate is calculated from a moving average over the payout period of the post. If you check the value of a newly created post, there likely will not be enough information to calculate this average. In this situation, the current median STEEM price is determined from the Steem API at that time.

How Is The STEEM Rate calculated?

The STEEM Rate is calculated by checking Filled Convert Requests that occured over the course of the payout period of the post. By viewing how much SBD went in and how much STEEM came out, we are able to get a very accurate estimate of the STEEM price.


Links



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

always baller man

his is past its future is 100usd

Thanks for sharing good stuff

I like this gem from your last linked post.

Despite not showing the right value SBD is worth more than Steem. SBD is a debt asset that is supposed to be pegged around $1. Due to this, I would not recommend buying SBD to speculate on the price.

But I definitely recommend buying Steem with SBD while the SBD price is high. SBD should return to $1 eventually if the system works as intended.

Do you think we're attracting interest from more developers, is the growth of steem's app economy being subsidized by fresh Korean Won? Lol. I feel like it is.

Very cool work, and will probably come in handy for many considering how wild the prices have been. Wish I had a project to implement this in. It's raining money and I don't think many are looking the gift horse in the mouth!

SBD is definitely being pumped. The price rise correlated to SBD/STEEM getting listed on Upbit exchange. Did that cause the pump solely? Who knows....

Either way, I like to see it the way you do. STEEM development and even content creators are being rewarded with gold bars while SBD is high due to traders. I don't think that is a problem exactly, but it definitely means SBD as a debt asset is less than useful.

Steem really is revolutionary ;)

As long as there's only as few SBD as we currently have in circulation, SBD is too easy a target for traders. It doesn't take much (money) to make the SBD curve look better than anything Six Flags could design and build. Daily trading volume is not huge, despite rises and drops.

For all we know it could be that only 2-5 traders are having a blast with SBD. It definitely will not last as always more SBD is printed.

Yes, the price action is nuts, crazy how far a few Won move the candlesticks. For all we know the people being dumped on have no idea that SBD is minted at the rates it is.

Yeah I find something... "interesting" about having to look at upbit to know what sbd is really up to at any given moment. I'm guessing there is a 200% chance that they are responsible for driving the prices.

True, I think stable prices allow for more certainty to continue to use sbd and steem for their intended purposes, given that much of the steem economy runs on a 7 day cycle.

It definitely changes things up a bit.

The characterization of SBDs really needs to be reassessed. They aren't pegged to the USD, that was just fanciful thinking when the steem blockchain was first conceived two years ago. The peg is unenforceable and in denial of free flowing supply/demand forces; the market has clearly demonstrated that over the past few months.

The Smart Media Tokens White Paper describes SBDs as an experimental asset and the increased demand for them and corresponding value ascension has likely been spurred by their correlation to SMT creation, as noted therein: "Initially smt_creation_fee will be set to 1 SBD & no means will be provided to update it."

If true, that would mean people are being silly and not reading.

The rest of that paragraph:

SMT creation fee
Issuing a smt_create_operation requires payment of smt_creation_fee. The amount
required is set by the smt_creation_fee field of dynamic_global_properties_object.
This field may contain a value in STEEM or SBD. If specified in SBD, an equivalent amount of STEEM will be accepted, at the current price feed.

Initially, smt_creation_fee will be set to 1 SBD, and no means will be provided
to update it. Updates to the smt_creation_fee amount may occur in future hardforks,
however, so user-agents should read the smt_creation_fee value from the
dynamic_global_properties_object. User-agents should not assume the fee will
always be 1 SBD and they should be prepared to charge a separate fee paid to the
user-agent if the aim of the interface is to enable only a curated set of tokens.
The fee is destroyed by sending it to STEEM_NULL_ACCOUNT.

If specified in SBD, an equivalent amount of STEEM will be accepted, at the current price feed.


smt_creation_fee, no matter whether set with SBD or STEEM as the asset, will accept both SBD and STEEM (using the 3.5 witness feed) as payment.

So it's a semantics game and steem/SBDs are interchangeable from the SMT creation standpoint, except that the minimum amount will be set at the nominal value of whatever 1 SBD is.

Perhaps then some deep pocketed players have deemed it necessary to accumulate SBDs and drive their value higher to establish a cost barrier to entry in the SMT creation market whenever SMTs are ultimately launched. Who knows really.

Nonetheless, SBDs are plainly described as an experimental asset in the SMT white paper: "SBD (Steem Blockchain Dollars) are an experimental asset on Steem that relate to the US Dollar, originating with Steem’s launch in 2016."

And this experiment of being pegged in value to $1 USD has been disproved by the free market since November 2017. I don't understand why the inherent potential of SBDs continues to be misrepresented to the userbase and general public. Why impose a self-defined constraint on their value when the free market has no interest in doing so?

Some of those questions might be best answered by the creator of Steem or SteemIt.

However, I can clear up the fact that the 3.5 witness feed rate does not care about the market value of SBD. It cares about the value of STEEM and uses that to make the conversion between SBD->STEEM.

So if the traders keep pumping SBD, users will be able to sell SBD and buy STEEM and create more and more SMTs. This is the opposite of prohibitive.

Example from Steemd.com demonstrating SBD as the base independent of exchange value:

Screen Shot 2018-01-22 at 11.36.08 PM.png

Thanks for the response. Trying to understand this all better myself and you're among the few Witnesses that has ever acknowledged the questions so I appreciate that.

Getting mixed messages though because I've seen other Witnesses say they are fine with the ongoing free market price discovery that is occurring with SBDs. Most recently @aggroed said in an interview with @jerrybanfield: "The other debate that I've been able to partake in a lot is, what should we do with the SBD? My response is, help it be as high as possible because this is good for the platform."

Helpful post thanks for sharing .

thanks, happy today

i enjoy your post! thanks

Thank you for the contribution. It has been approved.

The examples are clear. I really like how you gave the reason for this microservice. Good work explaining some of the terms and concepts.

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

I always try to support who contribute to open source project, upvote you.