---
title: "ResourceShark movements"
description: "Learn how movements record changes to balances and how to follow those changes by scope and sequence."
url: "https://agentpost.tools/docs/resourceshark/concepts/movements"
kind: concept
---

# Movements

A movement records one change to a [resource’s balance](/docs/resourceshark/concepts/scopes.md#availability). It commits with the change and identifies the resource, its scope, and the reason. Adding supply, placing a hold, committing it, correcting a count, and transferring stock all leave movements.

## What moved

`quantity` is the signed change to `onHand`. `before` and `after` show its old and new values. A change to `held` or `expected` has its own signed quantity and before and after values. So does a change to `owed`, what a balance owes beyond its supply entries; its `pegs` name the entries that paid it down. [Owing](/docs/resourceshark/concepts/supply.md#owing) explains when a balance owes. Placing a hold changes `held` and leaves the on-hand quantity unchanged.

Placing a hold records one `hold` movement for each balance a line affects, one per `bucketStart` on a resource that counts time in buckets. Each movement records `quantity` as `0`, with equal on-hand `before` and `after` values. Its `held.quantity` equals the line’s quantity, and `held.before` and `held.after` show the held balance before and after placement.

On a resource that counts time in buckets, `bucketStart` identifies the bucket. A write spanning several buckets records each bucket’s change separately. On a resource that tracks units individually, `scope.instanceId` identifies the unit. A movement that draws from separately tracked [supply](/docs/resourceshark/concepts/supply.md) entries carries `pegs` that tell you how much it drew from each entry.

## Why it moved

The `reason` says which kind of change this is, such as `add`, `hold`, `commit`, or `use`. A movement names its `actor` and, when the actor acted under a delegation, `onBehalfOf`, as [Who acted](/docs/platform/concepts/principals.md#who-acted) describes. Evidence and links to records such as a supply entry, claim, hold, or transfer explain a particular change when those records apply.

Movements are append-only. For example, taking back an added receipt records a `reversal` movement and keeps the earlier `add` movement. A transfer records a take and an add, linked by `transferId`.

## Reading the history

[List movements](/docs/resourceshark/reference/movements.md#list-movements) answers in increasing `seq`, as a feed. Filter by resource, place, holder, batch, or instance. A signed-in principal’s user token reaches only the history of their own holder. [Totals](/docs/resourceshark/concepts/totals.md) sums the on-hand changes by reason over a time period.

## Where to act on it

-   [Sell prepaid credits](/docs/resourceshark/guides/prepaid-credits.md) reads a holder’s movements. [Sum usage with totals](/docs/resourceshark/guides/usage-totals.md) chooses which reasons count as usage.
-   [Stock](/docs/resourceshark/reference/stock.md) records transfers, counts, corrections, and conversions. [Movements](/docs/resourceshark/reference/movements.md) reads the resulting history.
