Is there a limit on the length of a ERC20 Token symbol? I would like to use 4 letters, one of which is lower case, but that isn't an issue. My concern is if Exchanges have setup their tools to only handle 3 letters which is what most are today.
2 Answers
I used the CoinMarketCap API to pull down a list of all registered currencies and assets (so not just ERC-20 tokens... ), and fed it into a quick Python script to count the number of occurrences of symbols of different lengths.
import urllib, json
from collections import Counter
url = "https://api.coinmarketcap.com/v1/ticker/"
response = urllib.urlopen(url)
data = json.loads(response.read())
counts = Counter([len(asset['symbol']) for asset in data])
for i, j in sorted(counts.items()):
print("Asset symbols of length %d: %d" % (i, j))
Gives the following counts:
Asset symbols of length 1: 3
Asset symbols of length 2: 35
Asset symbols of length 3: 639
Asset symbols of length 4: 273
Asset symbols of length 5: 121
Asset symbols of length 6: 18
Asset symbols of length 7: 2
Asset symbols of length 8: 4
Asset symbols of length 9: 3
So while the most common length is 3, you're probably good for longer lengths. Of course, different exchanges and websites may format their UIs differently...
Edit:
I was reminded of this thread by a newly posted question. (Naming conventions for ERC-20 instancies)
Running the script again, just for fun, as of 28 Nov 2017:
Asset symbols of length 1: 3
Asset symbols of length 2: 37
Asset symbols of length 3: 768
Asset symbols of length 4: 350
Asset symbols of length 5: 143
Asset symbols of length 6: 17
Asset symbols of length 7: 4
Asset symbols of length 8: 2
Asset symbols of length 9: 1
-
4really liked the fact that you have not only provided an answer, but provided a script that should help get the dynamic data on symbol length at any given time! Commented Sep 5, 2020 at 1:05
This same code for py 3.10 and new API coinmarket :
from requests import Request, Session
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
from collections import Counter
import json
url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/map'
parameters = {
'start':'1',
'limit':'5000',
}
headers = {
'Accepts': 'application/json',
'X-CMC_PRO_API_KEY': 'Your-Coin-Market-API-Key ;-)',
}
session = Session()
session.headers.update(headers)
try:
response = session.get(url, params=parameters)
data = json.loads(response.text)
counts = Counter([len(asset['symbol']) for asset in data['data'] ])
for i, j in sorted(counts.items()):
print("Asset symbols of length %d: %d" % (i, j))
except (ConnectionError, Timeout, TooManyRedirects) as e:
print(e)
result at 2021-12-30 :
Asset symbols of length 5: 609
Asset symbols of length 6: 168
Asset symbols of length 7: 100
Asset symbols of length 8: 57
Asset symbols of length 9: 25
Asset symbols of length 10: 9
Asset symbols of length 11: 2
Asset symbols of length 12: 3
Asset symbols of length 13: 1
Asset symbols of length 23: 1
-
Don't have enough reputation points to answer so here's the script and data I pulled from Coingecko in 2024: gist.github.com/peterpeterparker/… Commented Jul 4 at 16:32