# Sampling Frequency for Price Data

**URL:** <https://community.bitquery.io/t/sampling-frequency-for-price-data/317>\
**Category:** GraphQL API\
**Tags:** support, closed\
**Created:** [July 14, 2021, 2:00pm UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317 "2021-07-14T14:00:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://community.bitquery.io/u/vaibhav)\
**Post date:** [July 14, 2021, 2:00pm UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/1 "2021-07-14T14:00:27Z")

</div>

I am looking a POC that can derive the price of a cryptocurrency on the Binance Smart Chain up to 16 months in the past. Regarding this, I have a few questions:

- What is the sampling frequency for the pricing data. I noticed that, on average, the price data is updated every 4 minutes if I check up to 5000 queries in the past. Is this true? With the paid version of the API, is it possible to get price data for every block (~3 seconds)?
- How accurate is this pricing data? Some queries to check the historical prices show big spikes in price from one row to the other, are these prices subject to sporadic changes?

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://community.bitquery.io/u/vaibhav)\
**Post date:** [July 16, 2021, 9:03am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/2 "2021-07-16T09:03:43Z")

</div>

@gaurav waiting for your reply

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [July 17, 2021, 5:28am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/3 "2021-07-17T05:28:58Z")

</div>

We have a little delay in our APIs, check here ([https://bloxy.info/status](https://bloxy.info/status))…however, we are building a new real-time system.

- How accurate is this pricing data? Some queries to check the historical prices show big spikes in price from one row to the other, are these prices subject to sporadic changes?

Please show us queries and results and how did you verify the problem…

We get market data for different vendors and apply them with dex data. The main thing is here we use one hour candle for market data …and then show prices in DEX trades… … so prices of the past won’t be changes .however if we decide to add more granularity … you will get more granular data…

is this answers your question?

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://community.bitquery.io/u/vaibhav)\
**Post date:** [July 19, 2021, 9:40am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/4 "2021-07-19T09:40:33Z")

</div>

@gaurav thank you for your reply. Is there any documentation on the granularity of the data depending on the timestamp? I assume more recent data has higher granularity.

Regarding the price spikes, this is the query and result.

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      baseCurrency: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}
      quoteCurrency: {is: "0x55d398326f99059ff775485246999027b3197955"}
      options: {asc: ["block.height", "transaction.index"], limit: 10}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      transaction {
        index
      }
      baseCurrency {
        symbol
      }
      quoteCurrency {
        symbol
      }
      quotePrice
    }
  }
}

```

Result:

```auto
{
  "ethereum": {
    "dexTrades": [
      {
        "block": {
          "height": 440486,
          "timestamp": {
            "time": "2020-09-13 10:33:58"
          }
        },
        "transaction": {
          "index": 1
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 0.9870299999999957
      },
      {
        "block": {
          "height": 441894,
          "timestamp": {
            "time": "2020-09-13 11:44:22"
          }
        },
        "transaction": {
          "index": 0
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 0.889351298011014
      },
      {
        "block": {
          "height": 444900,
          "timestamp": {
            "time": "2020-09-13 14:14:40"
          }
        },
        "transaction": {
          "index": 1
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 31.473754147838687
      },
      {
        "block": {
          "height": 445116,
          "timestamp": {
            "time": "2020-09-13 14:25:28"
          }
        },
        "transaction": {
          "index": 0
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 31.007290100350136
      },
      {
        "block": {
          "height": 445155,
          "timestamp": {
            "time": "2020-09-13 14:27:25"
          }
        },
        "transaction": {
          "index": 2
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 31.194174399175598
      },
      {
        "block": {
          "height": 445572,
          "timestamp": {
            "time": "2020-09-13 14:48:16"
          }
        },
        "transaction": {
          "index": 0
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 54.32703983278307
      },
      {
        "block": {
          "height": 445612,
          "timestamp": {
            "time": "2020-09-13 14:50:16"
          }
        },
        "transaction": {
          "index": 1
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": **6.248908679122841**
      },
      {
        "block": {
          "height": 445627,
          "timestamp": {
            "time": "2020-09-13 14:51:01"
          }
        },
        "transaction": {
          "index": 4
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": **30.88798047749476**
      },
      {
        "block": {
          "height": 445640,
          "timestamp": {
            "time": "2020-09-13 14:51:40"
          }
        },
        "transaction": {
          "index": 4
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": **40.07092312475807**
      },
      {
        "block": {
          "height": 445659,
          "timestamp": {
            "time": "2020-09-13 14:52:37"
          }
        },
        "transaction": {
          "index": 1
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": **20.638651371935147**
      }
    ]
  }
}

```

You can see the price of WBNB spikes from ~6USDT to 31USDT in a matter of minutes. Can you please address this issue or explain the underlying problem & solution.

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [July 20, 2021, 7:22am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/5 "2021-07-20T07:22:28Z")

</div>

I guess we are showing the correct data

I just added hash in the query so you can look into individual transactions

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      baseCurrency: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}
      quoteCurrency: {is: "0x55d398326f99059ff775485246999027b3197955"}
      options: {asc: ["block.height", "transaction.index"], limit: 10}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      transaction {
        index
        hash
      }
      baseCurrency {
        symbol
      }
      quoteCurrency {
        symbol
      }
      quotePrice
    }
  }
}

```

Now if you see that 6USDT price transaction

> **[Binance Smart Chain Mainnet DEX Trades](https://explorer.bitquery.io/bsc/tx/0x96f7e723660c9d32d34a0f914334c45a2d49da5adbbff7a8567f0c72cf0a3251/dex_trades)**
>
> Trades on decentralised exchanges (DEX), smart contracts on Binance Smart Chain Mainnet

Looks at the buy amount and sell amount… It will give you the price of 6USDT.

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://community.bitquery.io/u/vaibhav)\
**Post date:** [July 20, 2021, 7:39am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/6 "2021-07-20T07:39:22Z")

</div>

Using your query with added transaction hash, I get this result

```auto
{
  "ethereum": {
    "dexTrades": [
      {
        "block": {
          "height": 440486,
          "timestamp": {
            "time": "2020-09-13 10:33:58"
          }
        },
        "transaction": {
          "index": 1,
          "hash": "0xd87c8679aaae81a7db8a304e68201799d266d66684c1bc110987e6042e3e82a9"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 0.9870299999999957
      },
      {
        "block": {
          "height": 441894,
          "timestamp": {
            "time": "2020-09-13 11:44:22"
          }
        },
        "transaction": {
          "index": 0,
          "hash": "0xeb78ed774a9bfaf4aa399640e02b312880608abdd7b44cd7a49fbd677092af4c"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 0.889351298011014
      },
      {
        "block": {
          "height": 444900,
          "timestamp": {
            "time": "2020-09-13 14:14:40"
          }
        },
        "transaction": {
          "index": 1,
          "hash": "0x116ba21f5fa4ee2b18bede12be493255fb175c3082ce94e863d26f214a25ab82"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 31.473754147838687
      },
      {
        "block": {
          "height": 445116,
          "timestamp": {
            "time": "2020-09-13 14:25:28"
          }
        },
        "transaction": {
          "index": 0,
          "hash": "0xbee9d449a9ae5b8d7e4376d6c451f2e21c4e28afcc181e7064c707831bd41501"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 31.007290100350136
      },
      {
        "block": {
          "height": 445155,
          "timestamp": {
            "time": "2020-09-13 14:27:25"
          }
        },
        "transaction": {
          "index": 2,
          "hash": "0x3e3452667a04275408a9bb9478083e2c61e3a907133802b2e62a8bbdaf4fcf7a"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 31.194174399175598
      },
      {
        "block": {
          "height": 445572,
          "timestamp": {
            "time": "2020-09-13 14:48:16"
          }
        },
        "transaction": {
          "index": 0,
          "hash": "0xb5dca7e59b420ddc40d37285c972031f28bb7e3408224bdb1f487097a67752b4"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 54.32703983278307
      },
      {
        "block": {
          "height": 445612,
          "timestamp": {
            "time": "2020-09-13 14:50:16"
          }
        },
        "transaction": {
          "index": 1,
          "hash": "0x96f7e723660c9d32d34a0f914334c45a2d49da5adbbff7a8567f0c72cf0a3251"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 6.248908679122841
      },
      {
        "block": {
          "height": 445627,
          "timestamp": {
            "time": "2020-09-13 14:51:01"
          }
        },
        "transaction": {
          "index": 4,
          "hash": "0xc680256966f99de79bb30011c3f4d954cb2e39813bac3f072246c5acb6dfb28b"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 30.88798047749476
      },
      {
        "block": {
          "height": 445640,
          "timestamp": {
            "time": "2020-09-13 14:51:40"
          }
        },
        "transaction": {
          "index": 4,
          "hash": "0x313febcc758933c51db9dec12b84b677b0bc34ddaa328d337a09d97f65ee1da2"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 40.07092312475807
      },
      {
        "block": {
          "height": 445659,
          "timestamp": {
            "time": "2020-09-13 14:52:37"
          }
        },
        "transaction": {
          "index": 1,
          "hash": "0x1b7515382c251a4f80cb70adbf2b14af39910ff22deb6d2d665be812a0a18c23"
        },
        "baseCurrency": {
          "symbol": "WBNB"
        },
        "quoteCurrency": {
          "symbol": "USDT"
        },
        "quotePrice": 20.638651371935147
      }
    ]
  }
}

```

Here you can see that the prices for timestamp `"2020-09-13 10:33:58"` = `0.9870299999999957` which seems incorrect. Also if you look at these consecutive rows for timestamp and price,  
`"2020-09-13 14:48:16"` = `54.32703983278307`  
`"2020-09-13 14:50:16"` = `6.248908679122841`  
`"2020-09-13 14:51:01"` = `30.88798047749476`  
`"2020-09-13 14:51:40"` = `40.07092312475807`  
There are large fluctuations in price in short periods of time. Can you explain how this works?

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [July 20, 2021, 8:00am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/7 "2021-07-20T08:00:45Z")

</div>

If you check the details of the corresponding transaction, using which we calculate the price, you will see we are showing what we are getting.

For example, in the case of 6USDT price, check the following sell and buy amount - [tx](https://explorer.bitquery.io/bsc/tx/0x96f7e723660c9d32d34a0f914334c45a2d49da5adbbff7a8567f0c72cf0a3251/dex_trades)

 ![Screenshot 2021-07-20 at 1.27.03 PM](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/33a332600d3ec36834769f79e4cbf3e8f4277871.png)

in case of 54 USDT - Check this [tx](https://explorer.bitquery.io/bsc/tx/0xb5dca7e59b420ddc40d37285c972031f28bb7e3408224bdb1f487097a67752b4/dex_trades)

 ![Screenshot 2021-07-20 at 1.29.58 PM](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/329d72ff3aba8cb44191a9e6962ed9758cfe8c46.png)

You can check all transactions in a similar way…

is this answer your query?

If not please DM me on Telegram @gaurav\_zen

---

<div class="post-metadata">

**Author:** ![Aleksey](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Aleksey](https://community.bitquery.io/u/Aleksey)\
**Post date:** [July 22, 2021, 10:36am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/8 "2021-07-22T10:36:45Z")

</div>

> [@vaibhav](#):
>
> `0xd87c8679aaae81a7db8a304e68201799d266d66684c1bc110987e6042e3e82a9`

This transaction has very low volume. For such transations, the price can be very different from a regular one.  
What you can do to filter out such queries are several options to modify your query:

1. Use filter by minimum amount in USD, say to 100USD minimum by trade
2. Use price assymetry filter, set. it to 0.5…0.9 and see if it will solve the issue
3. Filter out specific exchanges from query, or use query by specific exchanges

Hopefully that helps

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [July 29, 2021, 11:27am UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/9 "2021-07-29T11:27:44Z")

</div>

@vaibhav have you got the answer to what you were looking for?

---

<div class="post-metadata">

**Author:** ![vaibhav](https://avatars.discourse-cdn.com/v4/letter/v/c68b51/32.png) [@vaibhav](https://community.bitquery.io/u/vaibhav)\
**Post date:** [July 29, 2021, 4:52pm UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/10 "2021-07-29T16:52:10Z")

</div>

Yes, thank you @sayon

---

<div class="post-metadata">

**Author:** ![rupertk](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@rupertk](https://community.bitquery.io/u/rupertk)\
**Post date:** [August 30, 2022, 4:28pm UTC](https://community.bitquery.io/t/sampling-frequency-for-price-data/317/11 "2022-08-30T16:28:38Z")

</div>

hi @Aleksey! @gaurav I’m wondering if there is any more documentation about priceAssymetry somewhere, since I have a similar issue with an outlier trade, here is the link to the query:

> **[Query with outliers](https://graphql.bitquery.io/ide/Query-with-outliers)**
>
> Bitquery is analytical engine for blockchains
