The Rule
Watch forProposalSettledEvent from the Trench governance program. When one arrives with executed: true, the proposal passed and its action was written on-chain, so refetch that token’s metadata.
Why Settlement Is the Moment
Voting closing does not apply anything. A proposal sits closed but unapplied until someone calls settle, which computes the outcome and, if it passed, writes the change. Settling is permissionless, so it can happen minutes or days after voting ends, and anyone can trigger it, including you. There is therefore no fixed delay between a vote ending and metadata changing, which is why a timer based onvotingEndsAtUnix is not a substitute for watching for the event.
The Event
The governance program atFmy9Mi1RbcHPEht6ydGmrLGFCiU3P9JSUomVDEsYwF2J emits ProposalSettledEvent once per settlement.
The field to branch on is
executed. Most settlements change nothing, because the proposal failed, expired, or was superseded, and only executed: true means state was written.
The event carries the governance state as it stands after settlement, so
content_revision and the lock flags can be applied straight to your cache without a follow-up read. Only the metadata itself has to be fetched.What Each Action Changes
Refetching on every
executed: true regardless of action is simpler and always correct. The distinction only matters if a refetch is expensive for you.
What to Refetch
A content change touches two places, and both have to be re-read.1
The metadata account
Name and symbol live on-chain, alongside the URI. The account address is
metadata on the governance read response.2
The JSON at the URI
Image, description, and links live off-chain in the document the URI points at. A content change pins new JSON, so the URI itself changes.
contentRevision Is Your Cache Key
The governance object exposescontentRevision, which increments on every applied content change. Store it alongside whatever you cached and you can establish staleness by comparison rather than by guesswork.
Watching in Practice
Subscribe to program logs for the governance program and decode everyProgram data: line you receive. Decoding needs the governance IDL, which Trench provides, so ask your contact for it if you do not have it yet.
@coral-xyz/anchor 0.32, the decoder hands back the IDL’s snake_case field names rather than the camelCase Anchor uses elsewhere, so the field is content_revision and not contentRevision. Enum values also arrive as an object keyed by the variant name, which is why the action is tested with in rather than compared against a string.
Subscribing per Token
If you follow a small, fixed set of tokens, an account subscription skips decoding altogether. The governance account is written on every settlement, so a change notification is your cue to re-read.contentRevision for your tracked tokens on a slow loop costs little and bounds how long a missed update can survive.
When You Can Stop Watching
A token whose governance reportsfinalized: true has locked its metadata permanently, and no further content change is possible. The same becomes true once mutableUntilUnix has passed, whether or not anyone voted. Both are safe points at which to drop a token from your refresh set.