title: How to calculate total transaction fees paid by users?
body: <p>I want to calculate total transaction fees paid by users by using a <code>substrate-api-sidecar</code> on any substrate-based chain.</p>
  <p>I tried reading two docs on calculating fees but none could help me out in deducing what to look for while querying a block. Click <a href="https://docs.substrate.io/how-to-guides/v3/weights/calculate-fees/" rel="nofollow noreferrer">here</a> for document 1, <a href="https://docs.substrate.io/v3/runtime/weights-and-fees/" rel="nofollow noreferrer">here</a> for document 2.</p>
  <p>Would that differ from chain to chain implementation?</p>
  <p>I checked <a href="https://docs.moonbeam.network/builders/tools/sidecar/" rel="nofollow noreferrer">Moonriver documents</a> on using substrate-api-sidecar and it seems possible to calculate fees. But I could not find out how to do so against a Polkadot parachain(relay chain)?</p>
  <p>For setting the base premise, <a href="https://www.tokenterminal.com/terminal/projects/polkadot/key_metrics" rel="nofollow noreferrer">Token Terminal</a> states that in a blockchain, total revenue generated means total transaction fees paid by the users.</p>