# Ethereum token quotes using 'Dextrades' query - how acccurate?

**URL:** <https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-acccurate/422>\
**Category:** GraphQL API\
**Tags:** closed\
**Created:** [August 19, 2021, 9:45am UTC](https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-acccurate/422 "2021-08-19T09:45:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stcroix](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stcroix](https://community.bitquery.io/u/stcroix)\
**Post date:** [August 19, 2021, 9:45am UTC](https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-acccurate/422/1 "2021-08-19T09:45:12Z")

</div>

Hello again,

I am struggling to determine how historic quotes are calculated using the Bitquery graph.

Take for example, a quote of token “SAFU” in WBNB at txHash 0x6c26d2e320739be9022d8454fbdc68346e3a86c82224d0bd5c8b4ccb1ac2f3ab

```auto
{
  ethereum(network: bsc) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      exchangeName: {in: ["Pancake v2"]}
      baseCurrency: {is: "0x2eba09fb8063aedba27424de9bf0dcb41567a943"}
      quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      txHash: {is: "0x6c26d2e320739be9022d8454fbdc68346e3a86c82224d0bd5c8b4ccb1ac2f3ab"}
    ) {
      transaction {
        hash
      }
      tradeIndex
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
          unixtime
        }
        height
      }
      baseCurrency {
        symbol
        address
      }
      quoteCurrency {
        symbol
        address
      }
      quotePrice
    }
  }
}

```

The result returned is `4.726269578406308e-16`

However, if I look at the bscscan logs for this transaction and manually adjust the “Sync” reserve amounts to their pre-Swap equivalents, the calculated result is `4.7578e-16` (0.000000000000000475780) which is close, but not the same as the Bitquery result.

This can be confirmed by looking at the previous transaction and dividing the reserves in the sync event (reserve1 / reserve0 = 4.7578e-16):

> **[Binance Transaction Hash (Txhash) Details | BscScan](https://bscscan.com/tx/0x242809f0f5a2e43cc24d3e4b9de88444e85eedc4aca5f776de1563e0b90cf6d6#eventlog)**
>
> Binance (BNB) detailed transaction info for txhash 0x242809f0f5a2e43cc24d3e4b9de88444e85eedc4aca5f776de1563e0b90cf6d6. The transaction status, block confirmation, gas fee, BNB, and token transfer are shown.

Which result is the correct one, and am I missing something fundamental in deriving the token value using the sync/swap method above?

Many thanks!

---

<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:** [August 19, 2021, 11:43am UTC](https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-acccurate/422/2 "2021-08-19T11:43:40Z")

</div>

The **txHash** used in the GraphQL query and **txHash** used in the above link are different. If you check for the txHash used by you in the above query i.e.

> **[https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-...](https://graphql.bitquery.io/ide/UAMNFQ25nF)**
>
> Bitquery is analytical engine for blockchains

So, if you check for “sync” reserve the (reserve1 / reserve0 = **4.7184781e-16** ) which is near to **4.726269578406308e-16** (the value returned by the GraphQL query for the txHash **0x6c26d2e320739be9022d8454fbdc68346e3a86c82224d0bd5c8b4ccb1ac2f3ab** )

> **[Binance Transaction Hash (Txhash) Details | BscScan](https://bscscan.com/tx/0x6c26d2e320739be9022d8454fbdc68346e3a86c82224d0bd5c8b4ccb1ac2f3ab#eventlog)**
>
> Binance (BNB) detailed transaction info for txhash 0x6c26d2e320739be9022d8454fbdc68346e3a86c82224d0bd5c8b4ccb1ac2f3ab. The transaction status, block confirmation, gas fee, BNB, and token transfer are shown.

---

<div class="post-metadata">

**Author:** ![stcroix](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stcroix](https://community.bitquery.io/u/stcroix)\
**Post date:** [August 19, 2021, 12:19pm UTC](https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-acccurate/422/3 "2021-08-19T12:19:28Z")

</div>

Thanks for the reply @sayon. I had understood that the “sync” event on that transaction was the token price _after_ the sell (what the next person will buy it at). Which is why referenced that other transaction below to show what the reserves were before the txhash in my bitquery query. But you are right, those amount are very similar if just dividing the WBNB by the token amount on that txhash, That would indicate what the price is after the token sell in that transaction right? Also, any idea why the amounts still differ in your example? Thanks!
