Steem for Script Kiddies: Displaying account classifications by amount vested

in #chatgptlast year (edited)

It turns out that ChatGPT is a pretty good companion for writing python code to interact with the Steem blockchain. It does markdown, too.

image.png

Pixabay license from janrye at source.



Just for fun, I spent an hour and a half with ChatGPT 3.5 this morning and we put together an example python script that will look up an account's vesting total and tell the operator what classification group the account belongs to.

Here is a link to the transcript, which will be available for a while - until the next time I clear my chat history, I guess.


And here are the groups and VESTS thresholds that I used:

Account ClassMinimum VESTSMaximum VESTS
Plankton010,000
Krill10,000100,000
Redfish100,0001,000,000
Minnow1,000,00010,000,000
Dolphin10,000,000100,000,000
Orca100,000,0001,000,000,000
Whale1,000,000,00010,000,000,000
Blue Whale10,000,000,000No maximum
Note that ChatGPT even produced that markdown table for me...

image.png

I defined my own standards for "plankton", "krill", "redfish", "whale", and "blue whale" because I think the typical groupings for "redfish" and "whales" are too broad. As normally understood, "plankton" and "krill" would be "redfish", and "blue whales" would be "whales". The values for "minnow", "dolphin", and "orca" are long-time standards, as seen at @steemchiller's SDS.

In order to run the script, the steem-python library must be installed.

Here is the script that we generated (tested in ubuntu linux under WSL and Oracle Virtual Box):

#!/usr/bin/python3

from steem import Steem
import sys

def isPlankton(account_vests):
    # max_vests = 10,000
    max_vests = 10000
    return account_vests >= 0 and account_vests < max_vests

def isKrill(account_vests):
    # min_vests = 10,000, max_vests = 100,000
    min_vests = 10000
    max_vests = 100000
    return min_vests <= account_vests < max_vests

def isRedfish(account_vests):
    # min_vests = 100,000, max_vests = 1,000,000
    min_vests = 100000
    max_vests = 1000000
    return min_vests <= account_vests < max_vests

def isMinnow(account_vests):
    # min_vests = 1,000,000, max_vests = 10,000,000
    min_vests = 1000000
    max_vests = 10000000
    return min_vests <= account_vests < max_vests

def isDolphin(account_vests):
    # min_vests = 10,000,000, max_vests = 100,000,000
    min_vests = 10000000
    max_vests = 100000000
    return min_vests <= account_vests < max_vests

def isOrca(account_vests):
    # min_vests = 100,000,000, max_vests = 1,000,000,000
    min_vests = 100000000
    max_vests = 1000000000
    return min_vests <= account_vests < max_vests

def isWhale(account_vests):
    # min_vests = 1,000,000,000, max_vests = 10,000,000,000
    min_vests = 1000000000
    max_vests = 10000000000
    return min_vests <= account_vests < max_vests

def isBlueWhale(account_vests):
    # min_vests = 10,000,000,000, no maximum
    min_vests = 10000000000
    return account_vests >= min_vests

def getAccountVests(account_name):
    s = Steem()

    try:
        account_info = s.get_account(account_name)

        if account_info:
            vests = float(account_info['vesting_shares'].split()[0])
            return vests
        else:
            return None
    except Exception as e:
        print(f"Error fetching account information: {e}")
        return None

def getAccountClass(account_name):
    account_vests = getAccountVests(account_name)
    if account_vests is not None:
        if isPlankton(account_vests):
            return "Plankton"
        elif isKrill(account_vests):
            return "Krill"
        elif isRedfish(account_vests):
            return "Redfish"
        elif isMinnow(account_vests):
            return "Minnow"
        elif isDolphin(account_vests):
            return "Dolphin"
        elif isOrca(account_vests):
            return "Orca"
        elif isWhale(account_vests):
            return "Whale"
        elif isBlueWhale(account_vests):
            return "Blue Whale"
        else:
            return "Unknown"
    else:
        return "Failed"

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python script.py <account_name>")
        sys.exit(1)

    account_name = sys.argv[1]
    account_class = getAccountClass(account_name)
    print(f"The account class for {account_name} is {account_class}")

    account_vests = getAccountVests(account_name)
    print(f"{account_name} VESTS: {account_vests:,.2f}")

    print(f"{account_name} is Plankton: {isPlankton(account_vests)}")
    print(f"{account_name} is Krill: {isKrill(account_vests)}")
    print(f"{account_name} is Redfish: {isRedfish(account_vests)}")
    print(f"{account_name} is Minnow: {isMinnow(account_vests)}")
    print(f"{account_name} is Dolphin: {isDolphin(account_vests)}")
    print(f"{account_name} is Orca: {isOrca(account_vests)}")
    print(f"{account_name} is Whale: {isWhale(account_vests)}")
    print(f"{account_name} is Blue Whale: {isBlueWhale(account_vests)}")



And here is some sample output:

+ ./acctType.py berniesanders
The account class for berniesanders is Plankton
berniesanders VESTS: 4,602.51
berniesanders is Plankton: True
berniesanders is Krill: False
berniesanders is Redfish: False
berniesanders is Minnow: False
berniesanders is Dolphin: False
berniesanders is Orca: False
berniesanders is Whale: False
berniesanders is Blue Whale: False
+ ./acctType.py justinsunsteemit
The account class for justinsunsteemit is Krill
justinsunsteemit VESTS: 29,430.85
justinsunsteemit is Plankton: False
justinsunsteemit is Krill: True
justinsunsteemit is Redfish: False
justinsunsteemit is Minnow: False
justinsunsteemit is Dolphin: False
justinsunsteemit is Orca: False
justinsunsteemit is Whale: False
justinsunsteemit is Blue Whale: False
+ ./acctType.py remlaps2
The account class for remlaps2 is Redfish
remlaps2 VESTS: 402,587.11
remlaps2 is Plankton: False
remlaps2 is Krill: False
remlaps2 is Redfish: True
remlaps2 is Minnow: False
remlaps2 is Dolphin: False
remlaps2 is Orca: False
remlaps2 is Whale: False
remlaps2 is Blue Whale: False
+ ./acctType.py rpalmer13
The account class for rpalmer13 is Minnow
rpalmer13 VESTS: 2,579,965.44
rpalmer13 is Plankton: False
rpalmer13 is Krill: False
rpalmer13 is Redfish: False
rpalmer13 is Minnow: True
rpalmer13 is Dolphin: False
rpalmer13 is Orca: False
rpalmer13 is Whale: False
rpalmer13 is Blue Whale: False
+ ./acctType.py remlaps1
The account class for remlaps1 is Dolphin
remlaps1 VESTS: 32,872,029.35
remlaps1 is Plankton: False
remlaps1 is Krill: False
remlaps1 is Redfish: False
remlaps1 is Minnow: False
remlaps1 is Dolphin: True
remlaps1 is Orca: False
remlaps1 is Whale: False
remlaps1 is Blue Whale: False
+ ./acctType.py cmp2020-pb
The account class for cmp2020-pb is Orca
cmp2020-pb VESTS: 112,449,900.08
cmp2020-pb is Plankton: False
cmp2020-pb is Krill: False
cmp2020-pb is Redfish: False
cmp2020-pb is Minnow: False
cmp2020-pb is Dolphin: False
cmp2020-pb is Orca: True
cmp2020-pb is Whale: False
cmp2020-pb is Blue Whale: False
+ ./acctType.py steemcurator01
The account class for steemcurator01 is Whale
steemcurator01 VESTS: 5,959,640,340.36
steemcurator01 is Plankton: False
steemcurator01 is Krill: False
steemcurator01 is Redfish: False
steemcurator01 is Minnow: False
steemcurator01 is Dolphin: False
steemcurator01 is Orca: False
steemcurator01 is Whale: True
steemcurator01 is Blue Whale: False
+ ./acctType.py misterdelegation
The account class for misterdelegation is Blue Whale
misterdelegation VESTS: 37,968,087,333.99
misterdelegation is Plankton: False
misterdelegation is Krill: False
misterdelegation is Redfish: False
misterdelegation is Minnow: False
misterdelegation is Dolphin: False
misterdelegation is Orca: False
misterdelegation is Whale: False
misterdelegation is Blue Whale: True



Feel free to use or modify this code. Enjoy playing with it and please let me know if you see any problems.

Update (August 13): Here is the markdown table from ChatGPT after updating for a conversion factor of 570 STEEM per MVEST. As you can see, we have drifted a bit from the 2016 estimates where a Minnow had about 500 SP.

Account ClassMinimum VESTSMaximum VESTSSP (Steem Power)
Plankton010,0000 - 5.701 SP
Krill10,000100,0005.701 - 57.015 SP
Redfish100,0001,000,00057.015 - 570.159 SP
Minnow1,000,00010,000,000570.159 - 5701.595 SP
Dolphin10,000,000100,000,0005701.595 - 57015.947 SP
Orca100,000,0001,000,000,00057015.947 - 570159.478 SP
Whale1,000,000,00010,000,000,000570159.478 - 5701594.784 SP
Blue Whale10,000,000,000No maximumAbove 5701594.784 SP

image.png

Pixabay license, source

Reminder


Visit the /promoted page and #burnsteem25 to support the inflation-fighters who are helping to enable decentralized regulation of Steem token supply growth.

Sort:  

As far I know 5k steem power holder is known as Dolphin. But according to chatGPT its 10k. First time I read about rank blue whale. I thought whale rank is in the top but its not, blue whale is in the top. Thanks for sharing such interesting post.

It depends how you define it, by VESTS or by Steem Power.

Whoever did the original classification used vests, not steem power. That's what @steemchiller implemented in SDS, so I did the same. Back in 2016, 5k steem power was a decent estimate for 10 million vests, which is why people started using that standard. 7 years later, the conversion factor has drifted a bit.

The exact conversion factor is always changing due to blockchain inflation, but can be obtained from any block explorer. SteemDB currently shows it is 570.142 SP per MVEST (million vests), so the cutoff now would be 5701.42 SP under the VESTS definition given above.

Thank you so much for the kind explanation, this is helpful to me to learn more about it. Have a nice day!

Man , the truth is that ChatGPT is a great help , but it is also programmed by human beings , let me explain , if you ask him for an opinion about a person , I do not think he understands , he would not give his opinion , he simply limits himself to saying something about the person , Well, if it's important, if you ask him, I want to know what you think about something, maybe he'll do the same, that is, he's programmed, his sensitivity doesn't come into any focus, but if he could give his true opinion, everything would change, that's what I think. conclusion, it is a help that is not human, if very manipulated

Yes, I totally agree. I've been playing with it for the past few weeks, and I think it's very useful. It helps with answering questions, writing text, and with programming. I can do all of those things better and faster than I could without an AI assistant.

It's a powerful tool, but it's still just a tool. IMO, the appearance of creativity comes almost entirely from the prompts that humans give to it.

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 62468.23
ETH 2442.12
USDT 1.00
SBD 2.61