How to get balance at a specific block height

Hi I’m researching how to get the balance of an address in a specific block height and I’m reaching to the conclusion that the only way is to get all the transactions from that address and aggregate inputs and outputs in order to get the balance at that height.

Also if take stake rewards into consideration I should get all the rewards received by an address and filter up to the specific block and aggregate those too.

Is this correct? Is there any simpler way to do this? Do any of you guys have a query already built up for this?

Usually the common requests are fetching transactions ‘from’ a block. But you can find queries used by koios below, to you can modify as per your needs:

  1. Address tx from a specific block - here
  2. Address Info , which includes balance, UTxOs, assets, etc- here
  3. Complete account balance (includes rewards/MIRs) - here
1 Like