# How t create a query that find all wallets that bought a token before x time

**URL:** <https://community.bitquery.io/t/how-t-create-a-query-that-find-all-wallets-that-bought-a-token-before-x-time/1325>\
**Category:** GraphQL API\
**Created:** [January 5, 2023, 1:35pm UTC](https://community.bitquery.io/t/how-t-create-a-query-that-find-all-wallets-that-bought-a-token-before-x-time/1325 "2023-01-05T13:35:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sksk12](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sksk12](https://community.bitquery.io/u/sksk12)\
**Post date:** [January 5, 2023, 1:35pm UTC](https://community.bitquery.io/t/how-t-create-a-query-that-find-all-wallets-that-bought-a-token-before-x-time/1325/1 "2023-01-05T13:35:30Z")

</div>

how t create a query that find all wallets that bought a token before x time

---

<div class="post-metadata">

**Author:** ![Divya](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Divya](https://community.bitquery.io/u/Divya)\
**Post date:** [January 5, 2023, 3:01pm UTC](https://community.bitquery.io/t/how-t-create-a-query-that-find-all-wallets-that-bought-a-token-before-x-time/1325/2 "2023-01-05T15:01:25Z")

</div>

```auto
{
  ethereum(network: ethereum) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 10}
      baseCurrency:{is:"0x24dA31e7BB182cb2cABfEF1d88db19C2AE1f5572"}
      quoteCurrency:{ is:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}
      date: {before: "2023-01-03"}
    ) {
      quotePrice
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      protocol
      exchange {
        fullName
      }
      baseAmount
      baseCurrency {
        symbol
        name
      }
      quotePrice
      quoteAmount
      quoteCurrency {
        symbol
        name
      }
      transaction {
        hash
        txFrom {
          address
        }
        to {
          address
          
        }
      }
    }
  }
}

```

Put the date in date: {before: “2023-01-03”} and token address in quoteCurrency.

Is this what you’re looking for?
