For some reason this code is not returning the top holders of the token it is starting somewhere way below that and then just listing random balances I want it to return the top 10 holders why is it not doing that ?
import requests
import json
# Step 1: Access token
access_token = "real access token here"
# Step 2: GraphQL API endpoint and headers
url_graphql = "https://streaming.bitquery.io/graphql"
headers_graphql = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
# The GraphQL query
query = """
query MyQuery {
EVM(network: base) {
BalanceUpdates(
where: {Currency: {SmartContract: {is: "0x6921B130D297cc43754afba22e5EAc0FBf8Db75b"}}}
orderBy: {descendingByField: "balance"}
limit: {count: 10}
) {
BalanceUpdate {
Address
}
balance: sum(of: BalanceUpdate_AmountInUSD, selectWhere: {ne: "0"})
Currency {
Name
Symbol
SmartContract
}
}
}
}
"""
# Prepare the request payload
payload = {
"query": query
}
# Send the POST request
response = requests.post(url_graphql, json=payload, headers=headers_graphql)
# Parse and print the response
data = json.loads(response.text)
print(json.dumps(data, indent=2))