demo.pool_reserves.eth and Function demo.read_pool_reserves.
Configure the source and function
Create a Notebook indemo with the following script. Sync events in the source table trigger reserve reads; ROW passes the current event to the saved Function.
The example Function queries the contract using the event’s
block_id, keeping reserve reads at that event’s block state.
Run a historical backfill
Save the script, choose compute resources, and click Run.backfill() includes both boundary heights; this example processes ten blocks.
When the run completes, check the Notebook output: this example processes 10 blocks and writes 2 records. Then open the target table to check its records and processed ranges.
Declare dependencies
If the function reads another Block State Table, add that table torequires. For example:
sources with your configured source list and both table IDs with actual tables. A dependency is not passed to the function automatically and does not independently trigger computation. It requires data at the corresponding height to be ready; the function must still read that table explicitly.
Keep the table updated
After verifying a small backfill, replace the script’s final line with:update() fills gaps based on the target table’s start height and processed ranges, then keeps processing new events.
