How to get the number of accounts per level using Robo 3T and steemdata

in #steemdata6 years ago (edited)

Do you want to calculate by yourself how many whales are currently in steem? You can do this by using steemdata by @furion. Please do not forget to vote for @furion as one of your witnesses, if you want to use steemdata (server are costly). The steem data are provided as a MongoDB service. In order to get familiar with MongoDB you can use Robo 3T. Download it and install it.

Create a new connection and enter the following data:

and

The following collections are available:

  • AccountOperations - Same as Operations but with account ownership,
  • Accounts - All steem accounts can be found here,
  • Comments - contains all comments,
  • Operations - contains all blockchain operations,
  • Posts - contains all posts,
  • PriceHistory - contains the Steem, SBD, BTC and USD price,
  • stats - contains information about the database.
    You can find more information in this guide.

Number of inactive users

Double-click on Accounts, to open a new tab in Robo 3T. You can now enter your own commands in the dark
terminal at the top.

Let's find out how many inactive fishes are currently in steemit. Inactive means:

  • no post within the last 30 days or
  • no comment within the last 30 days or
  • no vote within the last 30 days.

At first, we need a time constraints:

 time_constraints = {
    '$gte': ISODate('2018-01-11 00:00:00.000Z'),
}

$gte is a comparison query operator and stands for greater than or equal. ISODate is a date datatype. In the next step, we build a condition using the logical query operator $or:

conditions = {
    $or: [
    {'last_post': time_constraints}, 
    {'last_root_post': time_constraints}, 
    {'last_root_post': time_constraints}
    ]
}

We will now substract the number of all account by the number of account that fullfill the condition:

db.getCollection('Accounts').find().count() - db.getCollection('Accounts').find(conditions).count()

It should look now like this:

Number of red fishes

We need now a condition for vesting_shares:

vesting_condition = {
    'vesting_shares.amount': {'$lte': 999999}
}

The find condition can then be extended by

db.getCollection('Accounts').find({$and: [conditions,vesting_condition]}).count()

Number of Minnows

The vesting_conditionchanges to

vesting_condition = {
     $and: [
     {'vesting_shares.amount': {'$lte': 9999999 }},
     {'vesting_shares.amount': {'$gte': 1000000  }},
     ]
}

Number of Dolphins

The vesting_conditionchanges to

vesting_condition = {
     $and: [
     {'vesting_shares.amount': {'$lte': 99999999 }},
     {'vesting_shares.amount': {'$gte': 10000000  }},
     ]
}

Number of Orcas

The vesting_conditionchanges to

vesting_condition = {
     $and: [
     {'vesting_shares.amount': {'$lte': 999999999 }},
     {'vesting_shares.amount': {'$gte': 100000000  }},
     ]
}

Number of Whales

The vesting_conditionchanges to

vesting_condition = {
     'vesting_shares.amount': {'$gte': 1000000000  }
}

Results

TypeVestsNumber of account
Inactive-604089
Red fishbetween 0 and 999999 VESTS146109
Minnowbetween 1000000 and 9999999 VESTS4026
Dolphinbetween 10000000 and 99999999 VESTS919
Orcabetween 100000000 and 999999999 VESTS141
Whalemore than 1000000000 VESTS12

Do you have questions or comments? Please let me know.

Sort:  

This post is too hard for me to compreend with my limited skills, but I can see a lot of work went into making it and that it adds a lot of value for those interested in these things, so really great job Holger!

Cheers

Thank you. I learned a lot for myself during writing this post :).

Nice post, very useful , thanks

I follow you

Hello, you received an upvote from @steemdunk thanks to @holger80! Steem Dunk is an automated curation platform that is easy and free for use by everyone. Need an instant boost? Send 0.200 SBD with your full post url as the memo to @steemdunk for an upvote. Join us at https://steemdunk.xyz

Hi @holger80,

Excellent post and good data. I see a lot of utlity in using steemdata. I hope to one day host a low cost SQL alternative. I have much more experience with SQL but trying to get a feel for mongo db as well.

Do you think you would be able to look over a query of mine for advice? Having a hard time getting it to work as expected.

Let me know if it is ok and I will post it in a comment.

Thanks, I will try to help you :).

Here it is. I'm really new to this so please excuse the formatting.

db.getCollection('Posts').find(
{$and: [{ 'active_votes' : {$elemMatch: { 'rshares' :{$lt : 0}}}}, {'created_at': {$gte: ISODate("2018-02-05T00:00:00.000Z")}}]}, limit=10)

I just noticed the second field should be created and not created_at. Not sure if that is the extent of my problems, though.

AND... It looks like we're in BUSINESS. :) Thanks for the willingness to help.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by holger80 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.