Inspecting the queue and battle submission times of multiple accounts in Splinterlands

in #hive-133233 months ago

Image created with Bing image creator

In this post I provide a way to inspect a set of players' queue times at once. This is based on a simple python program that fetches battle data from the splinterlands api, and plots the times for battle queue start, opponent found and team submission. In this post, I've censored the player names for the example plots I provide. The purpose of this post is to provide a convenient little tool to look up accounts that you find suspicious.

I recommend also inspecting transactions on the accounts with a hive explorer site like Hivehub

The plot will contain the player names on the left side, and the time points at the bottom axis. So every player's battles will lie on one horizontal line in the plot.

The Python script can be found at the bottom of this post.

separator.png

Running the script, a result might look like this (Here I've looked at 12 accounts I found to be pretty suspicious):

image.png
The script will open this plot in an interactive window where its possible to zoom.

The script is made plot each battle queue time, battle match time and team submission time like this:

image.png

The first black plus is the queue time. The grey line is the wait time, and the plus marks when an opponent was found. Then the red line until the green square is the time the user took to generate a team.

So zooming in to a set of battles here it might look like this:

image.png

In this case, this player submits the first five battles within a minute. Thats incredibly fast. Its possible to do, but I dont find it particularly likely that a player can keep this up for extended periods of time.

separator.png

Python code

import requests,json
import matplotlib.pyplot as plt
import datetime as dt
username = "your_username"
token = "your_token"
players = ["player1", "player2", "etc"] #replace this list with the players you want to inspect. 

def getBattleTimes(player):
    dat = requests.get(f"https://api2.splinterlands.com/battle/history?player={player}&username={username}&token={token}&format=modern&limit=50").json()
    # You can remove the "&format=modern" part from the line above if you want more than just modern matches. 
    # "&format=wild" will limit it to wild battles. 
    qtimes = []
    stimes = []
    mtimes = []
    for b in dat['battles']:
        try:
            p1 = b['player_1']
            p2 = b['player_2']
            if(b['format'] == "modern"):
                qt = json.loads(b['queue_times'])
                p1_qcd = qt['player1_queue_created_date']
                p2_qcd = qt['player2_queue_created_date']
                p1_md = qt['player1_match_date']
                p2_md = qt['player2_match_date']
                p1_sd = qt['player1_submit_date']
                p2_sd = qt['player2_submit_date']
                if(p2 == player):
                    qtimes.append(dt.datetime.fromisoformat(p2_qcd))
                    stimes.append(dt.datetime.fromisoformat(p2_sd))
                    mtimes.append(dt.datetime.fromisoformat(p2_md))
                else:
                    qtimes.append(dt.datetime.fromisoformat(p1_qcd))
                    stimes.append(dt.datetime.fromisoformat(p1_sd))
                    mtimes.append(dt.datetime.fromisoformat(p1_md))
        except:
            pass
    return qtimes, stimes, mtimes
    
f = plt.figure()
plt.subplots_adjust(left=0.25)
ax = f.add_subplot(1,1,1)

for i,p in enumerate(players):
    qt, st, mt = getBattleTimes(p)
    ax.plot(qt, [i]*len(qt), 'k+')
    for j in range(len(st)):
        ax.plot([qt[j],mt[j]], [i,i], 'C7-', zorder=-1)
        ax.plot([mt[j], st[j]] , [i,i], 'r-+')
        ax.plot(st[j] , i, 'gs')
ax.set_yticks(range(len(players)))
ax.set_yticklabels(players)
plt.xticks(rotation=45, ha="right")
plt.show()

separator.png

Final words

I hope you found this post interesting. If you have not yet joined Splinterlands please click the referral link below to get started.

Join Splinterlands

Best wishes
@Kalkulus

Sort:  

Thank you for writing this! Way to go!

@slobberchops what do you think about the code?

Always good to see more code examples, esp, using libraries I am not familiar with. The dubious accounts, I am not sure about.., maybe it's a new secret BOT underground development..., BOT's generally take their time about deciding the line-up.

This post has been supported by @Splinterboost with a 15% upvote! Delagate HP to Splinterboost to Earn Daily HIVE rewards for supporting the @Splinterlands community!

Delegate HP | Join Discord

Thanks for sharing! - @azircon

I can barely play a single game in 5 minutes.... maybe I could sneak in 2.

That would be very interesting to find bot activity and/or battle helpers. Although, those usually take quite a while until they submit the team. If I understand correctly, a hint for bot activity would be a long grey line, and then a short red line up to the green block, correct?

That is right if the bot submits as fast as it can, I think. Of course it would depend entirely on how the bot operates :)

It's always good to have more code examples, but BOT's typically work until the last few seconds to get the best results possible, I know this from the days I used Battle Helpers and also watching XBOT in action for Wild matches.

How do these accounts fare when it comes to winning, that could be factored in?

Sure, more analytics than just the one I provide here has to be included if we want to determine if the behaviour is human or not.

What I'm sceptical about in the example I provided here is the stamina to keep playing so many accounts so fast for a long time. The guy plays almost 12 hours in one go in the latest session (small break in the middle there), with 6 accounts at a time. But perhaps there are people who will do this.

That said, the purpose of this post was just to provide a tool to the community, not to pursue this player in particular :)

The guy plays almost 12 hours in one go in the latest session (small break in the middle there), with 6 accounts at a time. But perhaps there are people who will do this.

Now that's a different thing, and it sounds ropey. Do the accounts win a large percentage of the games?

Not really, the win rate on average for these accounts was just below 50% (47.3%), so that's not suspicious.

Congratulations @kalkulus! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You got more than 800 replies.
Your next target is to reach 900 replies.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

The countdown to HiveFest⁹ is one week away - Join us and get your exclusive badge!
Our Hive Power Delegations to the August PUM Winners
Feedback from the September Hive Power Up Day

Yes, I found this post interesting. But, while it is an excellent start to identify possible suspicious (bot) activity from some accounts in modern format, I am not convinced that reliable information can be obtained with this parameter alone. For example, If you're an experienced Splinterlands player, it usually takes you no more than 30 seconds to put together a team. So less than a minute or not-too-short team selection times are not indicators of any suspicious activity in my opinion.

What I do find interesting is that you, like many of us, are convinced that there are accounts that use bots and helpers in the modern format. If you weren't, you wouldn't be making this kind of post.

In my particular case, I have never been concerned about the use of bots or helpers, except for those that are cheaters and that should definitely be eliminated and sanctioned. Which bots do I consider cheaters? Those that are able to read or know in advance the monster team that you have sent in your battle. In this situation, if those accounts have the necessary cards, they will be able to beat your team almost immediately.

That's why even though I can select my battle team in less than 30 seconds, I don't click the battle button until there are less than 5 seconds left. Maybe it's paranoia, but this simple strategy increases my battle win rate considerably.

For me there are clear criteria for users who are using bots, for example, those who always send their teams 15-20 seconds after you send yours. The time has been getting shorter over time, I guess the use of cloud computing makes them faster and more versatile. So, for me, a stronger criterion in finding cheating bots is the fact that they always send their team second, i.e. they are always the number two player. Another criterion can be having a relatively high percentage of battles won compared to other players who have more or less the same cards. Another criterion for searching can be the way cards are rented, i.e. if most cards are rented right when the battle is taking place, it can mean that that account knows which card it needs right then to beat its opponent.

Of course, none of these criteria are indicative per se that the account is using bots or helpers. But, if it meets these, and many other criteria, then it can be considered an account suspected of using bots or helpers.

Great post!

You make great points. I agree completely that queue times alone are not a strong indicator of bot activity, but it can be one small indicator among many.

I hope it is not possible to read the opponents submitted team before submitting. I know that used to be possible in the past, but my impression is that it can no longer happen. If it can, then that's a huge problem.

Thanks for your feedback!