Get average of coins price

How can I get the price average of my coins if I bought them at different times? Let’s say I have a wallet and I want to fetch all transactions in matic chain and see the price at which I bought the token, the date/time, hash and amount?

I’m trying this but it’s not working :confused:

query MyQuery {
  ethereum(network: matic) {
    address(address: {is: "0x59820C7a02Ba744140c325c94D0Ab0D2449ea6B5"}) {
      address
    }
    transfers {
      amount
    }
  }
}

This is the correct query

query MyQuery {
  ethereum(network: matic) {
    transfers (sender: {is: "0x59820C7a02Ba744140c325c94D0Ab0D2449ea6B5"}){
      amount(calculate: average in:USD)
    }
  }
}