# Not returning the top token holders on BASE NETWORK

**URL:** <https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108>\
**Category:** GraphQL API\
**Created:** [October 5, 2024, 10:41pm UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108 "2024-10-05T22:41:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scotsoradis121](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@scotsoradis121](https://community.bitquery.io/u/scotsoradis121)\
**Post date:** [October 5, 2024, 10:41pm UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108/1 "2024-10-05T22:41:59Z")

</div>

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 ?

```auto
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))

```

---

<div class="post-metadata">

**Author:** ![Prg1990](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Prg1990](https://community.bitquery.io/u/Prg1990)\
**Post date:** [October 6, 2024, 1:56am UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108/2 "2024-10-06T01:56:05Z")

</div>

> **Summary**
>
> This text will be hidden

---

<div class="post-metadata">

**Author:** ![Omkar](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@Omkar](https://community.bitquery.io/u/Omkar)\
**Post date:** [October 6, 2024, 6:27am UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108/3 "2024-10-06T06:27:14Z")

</div>

Hello @scotsoradis121 ,

Below is the token holder query to get Top Holder of Base Token

```auto
query MyQuery {
  EVM(dataset: archive, network: base) {
    TokenHolders(
      date: "2024-10-06"
      tokenSmartContract: "0x6921B130D297cc43754afba22e5EAc0FBf8Db75b"
      orderBy: {descending: Balance_Amount}
      limit: {count: 10}
    ) {
      Holder {
        Address
      }
      Balance{
        Amount
      }
    }
  }
}

```

Docs - [Token Holders API | Blockchain Data API (V2) (bitquery.io)](https://docs.bitquery.io/docs/examples/token-holders/token-holder-api/)

---

<div class="post-metadata">

**Author:** ![scotsoradis121](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@scotsoradis121](https://community.bitquery.io/u/scotsoradis121)\
**Post date:** [October 6, 2024, 8:52pm UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108/4 "2024-10-06T20:52:31Z")

</div>

It worked thanks Omkar!!!

---

<div class="post-metadata">

**Author:** ![scotsoradis121](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@scotsoradis121](https://community.bitquery.io/u/scotsoradis121)\
**Post date:** [October 7, 2024, 5:49pm UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108/5 "2024-10-07T17:49:13Z")

</div>

Hello Omkar I have an additional question regarding this…How recent does bitquery get the data from base network because in the date I put “2024-10-07” and I the order of the top holders is more or less correct but some of the balances are not accurate as shown on basescan so I am wondering how old exactly is the most recent data that bit querey can pull.

If you run that code request and go base scan to holder #29 of that token and then see how many tokens the querey says they have they do not match it is alittle bit less so I am wondering why exactly that is ?

---

<div class="post-metadata">

**Author:** ![Omkar](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@Omkar](https://community.bitquery.io/u/Omkar)\
**Post date:** [October 11, 2024, 6:01am UTC](https://community.bitquery.io/t/not-returning-the-top-token-holders-on-base-network/2108/6 "2024-10-11T06:01:26Z")

</div>

Hello @scotsoradis121 ,

The token holder archive currently only works on “archive” dataset. It is like 2 delay than Realtime.So that might be reason for some discrepancy as those address might have some activity during recent 2 hours

Thanks
