Exploring the SMARTCASH API with STEEMIT Blockchain Transfer Comparison

in #utopian-io7 years ago (edited)

SmartCash is a community governance, cooperation & growth focused blockchain based currency & a decentralized economy.>

They have a public API, which enables data analysis. The aim of this analysis is to explore the JSON data available from the API call
https://explorer3.smartcash.cc/ext/getlasttxs/10/100

I also wanted to get a quick comparision of the last 100 transaction on the Smartcash blockchain against the last 100 transaction on the Steemit blockchain

Extracting SmartCash JSON data

I have connected to the API call above using Power BI. Using the query editor the following M code can be used

 let
Source = Json.Document(Web.Contents("https://explorer3.smartcash.cc/ext/getlasttxs/10/100")),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"),
#"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"_id", "txid", 
  "blockhash", "__v", "blockindex", "timestamp", "total", "vout", "vin"}, {"_id", "txid", "blockhash", "__v", 
   "blockindex", "timestamp", "total", "vout", "vin"}),
  In     #"Expanded Value1"

A sample of the returned data can be seen in the image below

4.png

From here we can see that the vout and vin are in lists. To expand this the code can now be updated to

let
Source = 
Json.Document(Web.Contents("https://explorer3.smartcash.cc/ext/getlasttxs/10/1000")),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"),
#"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"_id", "txid", 
 "blockhash", "__v", "blockindex", "timestamp", "total", "vout", "vin"}, {"_id", "txid", "blockhash", "__v", 
 "blockindex", "timestamp", "total", "vout", "vin"}),
#"Expanded vout" = Table.ExpandListColumn(#"Expanded Value1", "vout"),
#"Expanded vout1" = Table.ExpandRecordColumn(#"Expanded vout", "vout", {"addresses", 
 "amount"}, {"addresses", "amount"}),
#"Expanded addresses" = Table.ExpandListColumn(#"Expanded vout1", "addresses"),
#"Renamed Columns" = Table.RenameColumns(#"Expanded addresses",{{"addresses", "Sending 
 address"}}),
#"Expanded vin" = Table.ExpandListColumn(#"Renamed Columns", "vin"),
#"Expanded vin1" = Table.ExpandRecordColumn(#"Expanded vin", "vin", {"addresses", "amount"}, 
 {"addresses.1", "amount.1"}),
#"Renamed Columns1" = Table.RenameColumns(#"Expanded vin1",{{"addresses.1", "rec. address"}, 
 {"amount", "sent amt"}, {"amount.1", "rec amt"}}),
  in
  #"Renamed Columns1"

In this part of the code we have expanded and also renamed the new address columns to ‘sending address’ and ‘rec address’

A sample of the expanded lists can been seen in the image below

5.png

There were still some transformations required. The amounts shown in the data are in satoshis. I would like to report in Bitcoin value. Also each side of the transaction is now shown, the sending and receiving. That means that the total value will be repeated based on the number of lines in the transaction. Therefore we also need to remove duplicate rows in the transactionid column

The m code can now be amended to the following

  let
Source = 
  Json.Document(Web.Contents("https://explorer3.smartcash.cc/ext/getlasttxs/10/1000")),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandListColumn(#"Converted to Table", "Value"),
#"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"_id", "txid", 
  "blockhash", "__v", "blockindex", "timestamp", "total", "vout", "vin"}, {"_id", "txid", "blockhash", "__v", 
  "blockindex", "timestamp", "total", "vout", "vin"}),
  #"Expanded vout" = Table.ExpandListColumn(#"Expanded Value1", "vout"),
  #"Expanded vout1" = Table.ExpandRecordColumn(#"Expanded vout", "vout", {"addresses", 
   "amount"}, {"addresses", "amount"}),
     #"Expanded addresses" = Table.ExpandListColumn(#"Expanded vout1", "addresses"),
  #"Renamed Columns" = Table.RenameColumns(#"Expanded addresses",{{"addresses", "Sending 
 address"}}),
    #"Expanded vin" = Table.ExpandListColumn(#"Renamed Columns", "vin"),
#"Expanded vin1" = Table.ExpandRecordColumn(#"Expanded vin", "vin", {"addresses", "amount"}, 
 {"addresses.1", "amount.1"}),
#"Renamed Columns1" = Table.RenameColumns(#"Expanded vin1",{{"addresses.1", "rec. address"}, 
  {"amount", "sent amt"}, {"amount.1", "rec amt"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns1", "total BTC value", each 
  [total]/100000000),
#"Removed Duplicates" = Table.Distinct(#"Added Custom", {"txid"}),
#"Changed Type" = Table.TransformColumnTypes(#"Removed Duplicates",{{"total", type number}, 
  {"total BTC value", type number}})
   in
  #"Changed Type"

After loading the data into the model, I then used DAX to carry out further calculations.

Analyzing the Last 100 Smartcash Transactions

The data was extracted at 23:13 GMT 02/01/18

6.png

The last 100 transaction on the Smartcash blockchain amounted to 3.44 Bitcoin. 69 accounts were involved in sending smartcash to 54 receiving accounts.

82% of the value in these 100 transaction was transferred to Coinbase, which is a well know crypto exchange. 57% of the value transferred to coinbase was transferred from the 1 sending address. This same sending address was responsible for 47% of the overall value transferred.

The last 100 Steemit Transactions

Steemit blockchain is rather different and the comparable data would be the transferes table in the Steemsql database.

Bitcoin Exchange rates

Exchange rates for Steem and SBD to Bitcoin were taken at 23.30 GMT from http://www.steemdollar.com/

The following M code was used to extract data from the Steemsql database

 let
Source = Sql.Database("sql.steemsql.com", "DBSteem", [Query="SELECT *   #(lf)             FROM 
TxTransfers (NOLOCK)#(lf) WHERE timestamp >= CONVERT(datetime,'01/01/2018') #(lf)             
  and         timestamp< CONVERT(datetime,'01/03/2018')#(lf)"]),
#"Kept Last Rows" = Table.LastN(Source, 100)
 in
#"Kept Last Rows"

7.png

The last 100 transfers on the STEEMIT blockchain amounted to 34.05 Bitcoin. 63 accounts were involved in sending smartcash to 51 receiving accounts.

99.6% of the value in these 100 transaction were transferred to Bittrex, blocktrades and poloniex, which are well know crypto exchanges. 95% of the value transferred to bittrex was transferred from @rainman. This same sending address was responsible for 95% of the overall value transferred.

Conclusion

The Smartcash API allows you gather and analyse data from the smartcash blockchain. In addition to the API above, there are also other APIs for different data.

It is very interesting to see that the value of bitcoin in the last 100 transactions is 9.9 time greater on Steemit than on Smartcash.

The current price of Steem is bitcoin 0.00045
And Smart is 0.00002923
The price of STEEM is therefore 15.3 times greater than Smartcash

It is also interesting to see that 99.6% of the last 100 Steem transfers are to exchanges while this is only 82% on Smartcash

I am part of a Blockchain Business Intelligence community. We all post under the tag #BlockchainBI. If you have an analysis you would like carried out on Steemit or Blockchain data, please do contact me or any of the#BlockchainBI team and we will do our best to help you...

You can find #BlockchainBI on discord https://discordapp.com/invite/JN7Yv7j



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

It is very interesting to see that the value of bitcoin in the last 100 transactions is 9.9 time greater on Steemit than on Smartcash.

I don't think the term value fits correctly here.

It is also interesting to see that 99.6% of the last 100 Steem transfers are to exchanges while this is only 82% on Smartcash

Can we conclude more P2P trading is happening with SMART ?

Interesting data analysis. Seems that you were just testing out data mining from the SmartCash blockchain rather than an actual comparison. Not too shabby ay.

True. I believe that's the intention of this post. To try extracting data from other blockchain.

Yes @cryptonfused I just wanted to see what data was accessible with the api. It gives the BI team some stuff to consider and is just the beginning of the analysis that the team will be doing moving forward. its a bit of a learning curve as I am new to blockchain data and I dont know what to expect.

I think we're going to need a little more information to really contextualize this data.

For example, 100 transactions is a rather small sample. Exactly how small a time period do those 100 transactions represent on Smartcash versus steem? I assume that both are quite small, but they can't be epsilon.

Two things look different at an order of magnitude more transactions? Given the rate at which transactions hit the steem blockchain, I wouldn't be surprised if things look considerably different at larger scale.

The main take away in terms of interpretation that I come away with from this data is that steem, a more mature blockchain, has more traffic than Smartcash. That's not exactly the level of revelation I was hoping for.

yes I agree. The time stamp on used in the smartcash blockchain is not a standard timestamp so i am looking a little further into this

Nice post,, good job and good luck.

i don't get it how you suppose to make money here !

I just followed you cause your posts seems to be informative post you can find similar crypto news on my steemit that might be productive for you too...
@reewy

Thank you for taking the first step. I've been wondering what type of comparisons to make with other blockchain data. The question that lingered in my head were - do other cryptos offer APIs to get data? of which I haven't searched for an answer. Another is, if they do offer APIs, in what format and how do I compare that with STEEM?

So thank you Paula for taking the first step. It was a very good point to focus on one aspect of data to compare - the bitcoin value transactions.

it's all a learning curve @eastmael. I think a better comparison would be smartcash and bitshares as they are both 'worker' platforms. Unable to figure out the bitshares api still.

Sorry, but what are 'worker' platforms? It's a new term for me.

I dont think that is an 'official term' but to explain from what I understand. On both bitshare and smartcash if you can do some 'work' that is of benefit to the platform you can submit a workers proposal to get paid with that coin. If you proposal is accepted then 'community' coins are used to pay for the work. I know with smartcash a portion of all mined is put into a community pool for workers payments

Thank you for the contribution. It has been approved.

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

Dont know how to code but this is good comunity for steemit @paulag

Sounds very intersting Paulag about the smartcash blockchain would love to know more and how I could user it. : )

Very informative thanks for sharing

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 90226.35
ETH 3085.20
USDT 1.00
SBD 2.94